LVM is a tool for logical volume management which includes allocating disks, striping, mirroring and resizing logical volumes. With LVM, a hard drive or set of hard drives is allocated to one or more physical volumes. LVM physical volumes can be placed on other block devices which might span two or more disks.
This tutotial explains the steps to combine two logical volumes that reside on a single physical volume in LVM.
Step1: Unmount the logical volume
Step2: Disable the logical volume
#lvchange -an /dev/myvg/homevol
Step3: Remove logical volume
lvremove -- do you really want to remove "/dev/myvg/homevol"? [y/n]: y
lvremove -- doing automatic backup of volume group "myvg"
lvremove -- logical volume "/dev/myvg/homevol" successfully
Step4: Extend the logical volume
For example add 12G to existing volume.
#lvextend -L12G /dev/myvg/homevol
lvextend -- extending logical volume "/dev/myvg/homevol" to 12 GB
lvextend -- doing automatic backup of volume group "myvg"
lvextend -- logical volume "/dev/myvg/homevol" successfully extended
Step5: Unmount the file system
Step6: Resize the file system and mount it.
#mount /dev/myvg/homevol /home
#mount -treiserfs /dev/myvg/homevol /home
Note that XFS file systems must be mounted to be resized and the mount-point is specified rather than the device name.
Note that Just like XFS the JFS file system must be mounted to be resized and the mount-point is specified rather than the device name.
#mount -o remount,resize /home