Top Ad unit 728 × 90

Latest updates

recent

LVM PRACTICAL STEPS


##### TO IMPLEMMENT LVM ON PARTITIONS #####
'Step 1:-Create 3 Raw Partitions'
# fdisk -l (to check)
# fdisk /dev/sda (to create-see partition notes)
# partx -a /dev/sda (to update kernel)

'Step 2:-Create Physcial Volume'
# pvcreate <partition_no's>
# pvcreate /dev/sda{12..14} (for example)
# pvdisplay (to check)

'Step 3:-Create Volume Group'
# vgcreate <vg_name> <partition_no's>
# vgcreate zoom /dev/sda{12..14}
# vgdisplay (to check)

'Step 4:-Create Logical Volume'
# lvcreate -L <size> <vg_name> -n <lv_name>
# lvcreate -L +500M zoom -n linux
# lvdisplay (to check)

'Step 5:-Format LV & Mount to Use'
# mkfs.ext4 /dev/zoom/linux
# mkdir /lvm (create new dir for mount point)
# mount /dev/zoom/linux /lvm (to mount)
# mount (to check)
# cd /lvm (access mount point to use LV)
# mkdir zoom{1..100} (create some data)
# ls (to check)
# df -h (to check the free space of partition)

'Step 6:-To Resize the Partition'
# cp -rv /usr/* /lvm (to make partition size full)
# df -h (check the size)
# lvresize -L +500M /dev/zoom/linux (to resize)
# resize2fs /dev/zoom/linux (to resize filesystem)
# df -h (check the extended size)

'Step 7:-To Extend the Volume Group Size'
# vgdisplay (to check vg size)
# fdisk /dev/sda (create one partition)
# partx -a /dev/sda (to update)
# pvcreate /dev/sda15 (add in pv)
# vgextend zoom /dev/sda15 (to extend vg size)
# vgdisplay (to check extended vg size)

'Step 8:-To Remove LVM Concept from Partition'
# umount /lvm (un mount the lv)
# lvremove /dev/zoom/linux (1st remove lv)
# lvdisplay (to check)
# vgremove /dev/zoom (2nd remove vg)
# vgdisplay (to check)
# pvremove /dev/sda{12..15} (3rd remove pv's)
# pvdisplay (to check)
LVM PRACTICAL STEPS Reviewed by Unknown on 2:06 PM Rating: 5
© 2007 - 2016. All Rights Reserved by Babashaheer Blog

Contact Form

Name

Email *

Message *

Powered by Blogger.