# vgscan
# pvcreate /dev/hda8 pvcreate -- physical volume "/dev/hda5" successfully created # pvcreate /dev/hda9 pvcreate -- physical volume "/dev/hda8" successfully created
# vgcreate lvm /dev/hda8 /dev/hda9 vgcreate -- INFO: using default physical extent size 4 MB vgcreate -- INFO: maximum logical volume size is 255.99 Gigabyte vgcreate -- doing automatic backup of volume group "lvm" vgcreate -- volume group "lvm" successfully created and activated
# vgdisplay -v lvm --- Volume group --- VG Name lvm VG Access read/write VG Status available/resizable VG # 0 MAX LV 256 Cur LV 0 Open LV 0 MAX LV Size 255.99 GB Max PV 256 Cur PV 2 Act PV 2 VG Size 1.66 GB PE Size 4 MB Total PE 424 Alloc PE / Size 0 / 0 Free PE / Size 424 / 1.66 GB VG UUID RBimFr-2W6o-O6Wr-E4Ox-egs1-z87V-cha1DA --- No logical volumes defined in "lvm" --- --- Physical volumes --- PV Name (#) /dev/hda8 (1) PV Status available / allocatable Total PE / Free PE 212 / 212 PV Name (#) /dev/hda9 (2) PV Status available / allocatable Total PE / Free PE 212 / 212
# lvcreate -L 1000M -n data lvm lvcreate -- doing automatic backup of "data" lvcreate -- logical volume "/dev/lvm/data" successfully created
# lvscan lvscan -- ACTIVE "/dev/lvm/data" [1000 MB] lvscan -- 1 logical volumes with 1000 MB total in 1 volume group lvscan -- 1 active logical volumes
# vgdisplay -v lvm --- Volume group --- VG Name lvm VG Access read/write VG Status available/resizable VG # 0 MAX LV 256 Cur LV 1 Open LV 0 MAX LV Size 255.99 GB Max PV 256 Cur PV 2 Act PV 2 VG Size 1.66 GB PE Size 4 MB Total PE 424 Alloc PE / Size 250 / 1000 MB Free PE / Size 174 / 696 MB VG UUID RBimFr-2W6o-O6Wr-E4Ox-egs1-z87V-cha1DA --- Logical volume --- LV Name /dev/lvm/data VG Name data LV Write Access read/write LV Status available LV # 1 # open 0 LV Size 1000 MB Current LE 250 Allocated LE 250 Allocation next free Read ahead sectors 1024 Block device 58:0 --- Physical volumes --- PV Name (#) /dev/hda8 (1) PV Status available / allocatable Total PE / Free PE 212 / 0 PV Name (#) /dev/hda9 (2) PV Status available / allocatable Total PE / Free PE 212 / 174
# mkfs -t ext3 /dev/lvm/data
# mount -t ext3 /dev/lvm/data /data
# cat /etc/fstab ... /dev/lvm/data /data ext3 defaults 0 0 ...
debian:~# pvscan PV /dev/sdb1 VG lvm lvm2 [372.61 GB / 0 free] PV /dev/sdc1 VG lvm lvm2 [372.61 GB / 0 free] Total: 2 [745.21 GB] / in use: 2 [745.21 GB] / in no VG: 0 [0 ] debian:~# lvscan inactive '/dev/lvm/pds' [745.21 GB] inherit debian:~# vgscan Reading all physical volumes. This may take a while... Found volume group "lvm" using metadata type lvm2 debian:~# vgchange -a y lvm 1 logical volume(s) in volume group "lvm" now active debian:/home/starlits# lvscan ACTIVE '/dev/lvm/pds' [745.21 GB] inherit