Increasing the size of a Logical Volume in LVM

Increasing the size of a Logical Volume on *nix

The first thing that you will need to do will be to create a new partition on your newly added drive (in this guide my newly added drive is sde). This guide assumes that /dev/sde is already visible in fdisk (fdisk -l)

We will need to now create a ‘Phyiscal Volume’ for our new partition:

pvcreate /dev/sde1

Once we have created the Phyiscal Volume we will need to extend our existing Volume Group to include this new Physical Volume.

vgextend vol_volumegroup /dev/sde1/

Once we have done this, we will need to extend the Logical Volume itself to accommodate the additional disk being added (Obviously adjust the below as appropriate for your setup). This command will increase the Logical Volume to be 100% of the Volume Group size:

lvextend -l 100%VG /dev/vol_volumegroup/lv_logicalvolume

Finally we will need to resize the filesystem on the Logical Volume to make the additional storage capacity available to your Operating System. The below will run while the device is mounted and live, however you may notice decreased performance while the operation is ongoing. Once the command completes there are no further steps required:

resize2fs/dev/vol_volumegroup/lv_logicalvolume

Any comments or questions? Get in touch here or Email me at [email protected]