Linux LVM安装

绝世美人儿
974次浏览
2020年07月29日 19:14
最佳经验
本文由作者推荐

星期的英语-跋怎么读

calVolume[Path] |
[-s|--snapshot] VolumeGroupName[Path] -V|--virtualsize VirtualSize}
[-c|--chunksize]
[-A|--autobackup {y|n}]
[--addtag Tag]
[--alloc AllocationPolicy]
[-C|--contiguous {y|n}]
[-d|--debug]
[-h|-?|--help]
[--ignoremonitoring]
[--monitor {y|n}]
[-i|--stripes Stripes [-I|--stripesize StripeSize]]
{-l|--extents LogicalExtentsNumber[%{VG|FREE|ORIGIN}] |
-L|--size LogicalVolumeSize[bBsSkKmMgGtTpPeE]}
[-M|--persistent {y|n}] [--major major] [--minor minor]
[-n|--name LogicalVolumeName]
[--noudevsync]
[-p|--permission {r|rw}]
[-r|--readahead ReadAheadSectors|auto|none]
[-t|--test]
[-v|--verbose]
[--version]
[PhysicalVolumePath...]


[root@dm01db01 ~]# lvdisplay
--- Logical volume ---
LV Name /dev/VGExaDb/LVDbSys1
VG Name VGExaDb
LV UUID ZR8ytQ-cp7g-4Zbs-c9XL-Tcuz-qNiw-yLFyiH
LV Write Access read/write
LV Status available
# open 1
LV Size 30.00 GB
Current LE 7680
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0

--- Logical volume ---
LV Name /dev/VGExaDb/LVDbSys2
VG Name VGExaDb
LV UUID io7gCa-icCA-0Dqq-EQOn-VpCB-eUZf-RqSiKy
LV Write Access read/write
LV Status available
# open 0
LV Size 30.00 GB
Current LE 7680
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1

--- Logical volume ---
LV Name /dev/VGExaDb/LVDbSwap1
VG Name VGExaDb
LV UUID 7GSX3V-Zf6m-XtCM-NFJl-gwfm-9P0G-3C8REu
LV Write Access read/write
LV Status available
# open 1
LV Size 24.00 GB
Current LE 6144
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2

--- Logical volume ---
LV Name /dev/VGExaDb/LVDbOra1
VG Name VGExaDb
LV UUID Tnt0Or-Nkxc-3f3m-9o0W-rkHm-iUid-tz7JMm
LV Write Access read/write
LV Status available
# open 1
LV Size 100.00 GB
Current LE 25600
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:3


[root@dm01db01 ~]# lvcreate -L 500g -n LVexpdp VGExaDb
Logical volume "LVexpdp" created
[root@dm01db01 ~]#
lvdisplay
--- Logical volume ---
LV Name /dev/VGExaDb/LVDbSys1
VG Name VGExaDb
LV UUID ZR8ytQ-cp7g-4Zbs-c9XL-Tcuz-qNiw-yLFyiH
LV Write Access read/write
LV Status available
# open 1
LV Size 30.00 GB
Current LE 7680
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0

--- Logical volume ---
LV Name /dev/VGExaDb/LVDbSys2
VG Name VGExaDb
LV UUID io7gCa-icCA-0Dqq-EQOn-VpCB-eUZf-RqSiKy
LV Write Access read/write
LV Status available
# open 0
LV Size 30.00 GB
Current LE 7680
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1

--- Logical volume ---
LV Name /dev/VGExaDb/LVDbSwap1
VG Name VGExaDb
LV UUID 7GSX3V-Zf6m-XtCM-NFJl-gwfm-9P0G-3C8REu
LV Write Access read/write
LV Status available
# open 1
LV Size 24.00 GB
Current LE 6144
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2

--- Logical volume ---
LV Name /dev/VGExaDb/LVDbOra1
VG Name VGExaDb
LV UUID Tnt0Or-Nkxc-3f3m-9o0W-rkHm-iUid-tz7JMm
LV Write Access read/write
LV Status available
# open 1
LV Size 100.00 GB
Current LE 25600
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:3

--- Logical volume ---
LV Name /dev/VGExaDb/LVexpdp
VG Name VGExaDb
LV UUID hO64De-asj5-tYP4-ufhl-tEPI-vuCt-521gIq
LV Write Access read/write
LV Status available
# open 0
LV Size 500.00 GB
Current LE 128000
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:4

[root@dm01db01 ~]# mkfs
Usage: mkfs [-V] [-t fstype] [fs-options] device [size]

[root@dm01db01 ~]# mkfs -t ext3 /dev/VGExaDb/LVexpdp
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
65536000 inodes, 131072000 blocks
6553600 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
4000 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per
group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:

done

This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@dm01db01 ~]#
[root@dm01db01 ~]#
[root@dm01db01 ~]# which lvcreate
/usr/sbin/lvcreate
[root@dm01db01 ~]# cd /usr/sbin
[root@dm01db01 sbin]# ls *lv*
lvchange lvcreate lvextend lvmchange lvmdump lvmsar lvremove lvresize lvscan
lvconvert lvdisplay lvm lvmdiskscan lvmsadc lvreduce lvrename lvs
[root@dm01db01 sbin]# lvresize
Please specify either size or extents but not both.
Run `lvresize --help' for more information.
[root@dm01db01 sbin]# lvresize --help
lvresize: Resize a logical volume

lvresize
[-A|--autobackup y|n]
[--alloc AllocationPolicy]
[-d|--debug]
[-f|--force]
[-h|--help]
[-i|--stripes Stripes [-I|--stripesize StripeSize]]
{-l|--extents [+|-]LogicalExtentsNumber[%{VG|LV|PVS|FREE|ORIGIN}] |
-L|--size [+|-]LogicalVolumeSize[bBsSkKmMgGtTpPeE]}
[-n|--nofsck]
[--noudevsync]
[-r|--resizefs]
[-t|--test]
[--type VolumeType]
[-v|--verbose]
[--version]
LogicalVolume[Path] [ PhysicalVolumePath... ]

[root@dm01db01 sbin]# lvresize -L 556G -r LVexpdp /dev/sda3
Path required for Logical Volume "LVexpdp"
Please provide a volume group name
Run `lvresize --help' for more information.
[root@dm01db01 sbin]# lvresize -L 556G -r /dev/VGExaDb/LVexpdp /dev/sda3
fsck 1.39 (29-May-2006)
/dev/mapper/VGExaDb-LVexpdp: clean, 11/65536000 files, 2107258/131072000 blocks
Extending logical volume LVexpdp to 556.00 GB
Logical volume LVexpdp successfully resized
resize2fs 1.39 (29-May-2006)
Resizing the filesystem on /dev/mapper/VGExaDb-LVexpdp to 145752064 (4k) blocks.
The filesystem on /dev/mapper/VGExaDb-LVexpdp is now 145752064 blocks long.

[root@dm01db01 sbin]# mkdir /u01/expdmp
[root@dm01db01 sbin]# mount -t ext3 /dev/VGExaDb/LVexpdp /u01/expdmp
[root@dm01db01 sbin]# df -h /u01/expdmp
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VGExaDb-LVexpdp
548G 198M 520G 1% /u01/expdmp
[root@dm01db01 sbin]# chown oracle:oinstall /u01/expdmp
[root@dm01db01 sbin]# vi /etc/fstab

LABEL=DBSYS / ext3 defaults 1 1
LABEL=BOOT /boot ext3 defaults,nodev 1 1
LABEL=DBORA /u01 ext3 defaults,nodev 1 1
tmpfs /dev/shm tmpfs defaults,size=21958
5m 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP swap swap defaults 0 0
~
~


~
~
[root@dm01db01 sbin]# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VGExaDb-LVDbSys1
30G 16G 13G 55% /
[root@dm01db01 sbin]# pwd
/usr/sbin
[root@dm01db01 sbin]# cd /etc
[root@dm01db01 etc]# ls fs*
fstab
[root@dm01db01 etc]# man fstab
FSTAB(5) Linux Programmer鈥檚 Manual FSTAB(5)

NAME
fstab - static information about the filesystems

SYNOPSIS
#include

DESCRIPTION
The file fstab contains descriptive information about the various file systems. fstab is only read by pro-
grams, and not written; It is the duty of the system administrator to properly create and maintain this file.
Each filesystem is described on a separate line; fields on each line are separated by tabs or spaces. Lines
starting with 鈥鈥are comments. The order of records in fstab is important because fsck(8), mount(8), and
umount(8) sequentially iterate through fstab doing their thing.

The first field, (fs_spec), describes the block special device or remote filesystem to be mounted.

For ordinary mounts it will hold (a link to) a block special device node (as created by mknod(8)) for the
device to be mounted, like 鈥dev/cdrom鈥or 鈥dev/sdb7鈥 For NFS mounts one will have :, e.g.,
鈥榢:/鈥 For procfs, use 鈥榩roc鈥
Instead of giving the device explicitly, one may indicate the (ext2 or xfs) filesystem that is to be mounted by
its UUID or volume label (cf. e2label(8) or xfs_admin(8)), writing LABEL=