Posts

Showing posts with the label LVM

[ Level 2 ] Fix duplicate vg/lv name.

1. scan vgs: $ vgscan 2. get vg information: $ vgdisplay --- Volume group --- VG Name vg00 ... VG UUID FUoK9F-9mgs-jO4M-vub1-Y7zs-6wpQ-uM2S11 --- Volume group --- VG Name vg00 ... VG UUID FUoK9F-9mgs-jO4M-vub1-Y7zs-6wpQ-uM2S12 3. export vg $ vgexport 4. rename vg name $ vgrename FUoK9F-9mgs-jO4M-vub1-Y7zs-6wpQ-uM2S12 vg01 5. import vg $ vgimport vg01 6. get vg information: $ vgdisplay --- Volume group --- VG Name vg00 ... VG UUID FUoK9F-9mgs-jO4M-vub1-Y7zs-6wpQ-uM2S11 --- Volume group --- VG Name vg01 ... VG UUID FUoK9F-9mgs-jO4M-vub1-Y7zs-6wpQ-uM2S12 7. get lv information $ lvscan ACTIVE '/dev/vg00/lv00' [13.99 GiB] inherit inactive '/dev/vg01/lv00' [13.99 GiB] inherit 8. active vg01 $ vgchange --ignorelockingfailure --noudevsync --sysinit -ay vg01 >/dev/null 2>&1 && 9. rename lv name(optio...

[Level 3] Create LVM in Ubuntu.

Install LVM (Logical Volume Management) in Ubuntu. 1. Install LVM with apt-get # apt-get -y install lvm2 [Ref: http://www.debuntu.org/how-to-install-ubuntu-over-lvm-filesystem ] $ sudo mke2fs -j /dev/sda2 $ sudo pvcreate /dev/sda3 #create a physical volume on /dev/sda3 Physical volume "/dev/sda3" successfully created $ sudo vgcreate lvmvolume /dev/sda3 #create a volume group named lvmvolume using /dev/sda3 physical volume Volume group "lvmvolume" successfully created $ sudo lvcreate -n root -L 5G lvmvolume #create a logical volume of 5G named "root" in lvmvolume Logical volume "root" created $ sudo lvcreate -n home -L 10G lvmvolume #create a logical volume of 10G named "home" in lvmvolume Logical volume "home" created $ sudo lvcreate -n swap -L 2G lvmvolume #create a logical volume of 2G named "swap" in lvmvolume Logical volume "swap" created $ sudo mkfs -j /dev/lvmvolume/root -L r...