How to reduce and extend LVM size

How to reduce and extend LVM size

==========================================================================================
Reduce
check curent size of lv using command “#lvs”. If original size is 500MB and you want to reduce by 100MB. ie. new size = 400MB

________________________________________________________________________________________________________

1> unmount the partition
#umount /dev/vg0/lv0

2> check file system
#e2fsck -f /dev/vg0/lv0 ——-> f = forcefull check

3> resize to new value
-#resize2fs /dev/vg0/lv0 400M ———–> #resize2fs partition new_size
-#lvreduce -L -100M /dev/vg0/lv0 ——–> #lvreduce -L reduce_size partition
– accept message Y

Note => you can verify new size as “#lvdisplay” or “#lvs”

4> remount
#mount /dev/vg0/lv0

Note : recheck partion as “#df -hT”

==========================================================================================

Extend

check current size using “#lvs”. If original size is 400MB and you want new size 900MB. means extend by 500MB

1> # lvextend -L +500M /dev/vg0/lv0 —————> #lvextend -L +entend_size partition

2> # resize2fs /dev/vg0/lv0 ———–> this command will take some time to extend partion.

Note : revify new size using “lvs”

==============================================================================================

Posted in partitions

Leave a Reply