Documente Academic
Documente Profesional
Documente Cultură
To initialize partitions rather than whole disks: run the pvcreate command on the partition. The following example
initializes the partition /dev/hdb1 as an LVM physical volume for later use as part of an LVM logical volume.
# pvcreate /dev/hdb1
/dev/sda1
/dev/sdd1
/dev/sdc1
# pvdisplay
--- Physical volume --PV Name
/dev/sdc1
VG Name
new_vg
PV Size
Allocatable
yes
PE Size (KByte)
4096
Total PE
4388
Free PE
4375
Allocated PE
13
PV UUID
Joqlch-yWSj-kuEn-IdwM-01S9-XO8M-mcpsVe
# pvscan
PV /dev/sdb2
VG vg0
lvm2 [964.00 MB / 0
PV /dev/sdc1
VG vg0
PV /dev/sdc2
free]
# pvchange -x n /dev/sdk1
You can also use the -xy arguments of the pvchange command to allow allocation where it had previously been
disallowed.
LVM volume groups and underlying logical volumes are included in the device special file directory tree in
the /dev directory with the following layout:
NOTE:
You may need to run the vgscan command manually when you change your hardware configuration and add or delete
a device from a node, causing new devices to be visible to the system that were not present at system bootup. This
may be necessary, for example, when you add new disks to the system on a SAN or hotplug a new disk that has been
labeled as a physical volume. LVM runs the vgscan command automatically at system startup and at other times
during LVM operation
# vgscan
The following command changes the maximum number of logical volumes of volume group vg00 to 128.
Deactivating VG
# vgchange -a n my_volume_group
By default, the metadata backup is stored in the /etc/lvm/backup file . You can manually back up the metadata to
the /etc/lvm/backup file with the vgcfgbackup command.
The following command creates a logical volume 10 gigabytes in size in the volume group vg1.
creating striped lv
# lvcreate -L 50G -i2 -I64 -n gfslv vg0
The following command creates a mirrored logical volume with a single mirror. The volume is 50 gigabytes in size, is
named mirrorlv, and is carved out of volume group vg0: