Prettymad.net

How to Extend an LVM Parition in the XFS file system

Create a new Linux partition, ie. Partition type 83 on your newly installed disk, in this case hdb:

cfdisk /dev/hdb

Now create a new LVM member with the new partition:

pvcreate /dev/hdb1

Extend the volume group to include your new partition (my volume group is called vg_data, you can find out what yours is by doing a 'vgscan')

vgextend vg_data /dev/hdb1

List the details about your volume group:

vgdisplay --verbose

Do some maths, towards the end of the display you will see something like:

...snip...
Total PE / Free PE    X / 0
...snip...
Total PE / Free PE    Y / Y
...snip...

So now you have to add X and Y which will give you the total amount to extend your logical volume by.. When you extend it, you say *what* you want to extend it too, rather than how much.

So. In my cas X+Y was 99682, so I do (my logical volume is called lv_data):

lvextend -l 21629 /dev/vg_data/lv_data

Ok, so it should be allocated now, if you do a 'vgdisplay --verbose' you should see there are no free PE's anymore..

Find out where your mount point is for your logical volume (in my case lv_data), mines /data and run:

xfs_growfs /data

Thats it, 'df -h' to see your results!