CAUTION: Make a backup of your DATA before running these commands.

If you ever need to extend your running OS mounted root partition that is using LVM, run these commands after adding a new disk / partition to your system.

Use the following commands to check for existing LVM partitions:

pvdisplay -v
vgdisplay -v

First of all, check if the resize_inode option is active.

# tune2fs -l /dev/mapper/VolGroup-lv_root | grep resize_inode

If that option is present in the partition, you can continue, if not, you need to unmount the partition.

cfdisk /dev/sdb
pvcreate /dev/sdb1
vgextend VolGroup /dev/sdb1
lvresize --resizefs -l +100%FREE /dev/mapper/VolGroup-lv_root

Use df to check for the results, no need to reboot!

Advertisements