Posted on Leave a comment

Extend xfs disk with parted command line – grow xfs partition

This article describes how to extend a physical disk which is formatted as XFS if LVM is not an option.

As shown below the /dev/sdb device is formatted as xfs and mounted under /test. Currently its capacity is 7GB.

locate the existing disk.

Lets extend the physical volume device by adding 2GB more on it.

extend disk on hypervisor

However capacity will not be extended on Linux because the physical disk need to be extended also with parted. As you can see the partition number is 1 and it is needed for the next commands.

parted /dev/sdb

Execute the below command:

parted -s -a opt /dev/sdb "resizepart 1 100%"

If not unmounted you will get the below warning. Proceed with the umount

umount /dev/sdb

Execute again the command for resizing. You should now have a successful result.

Verify the new capacity:

physical disk extended

Mount disk and grow its size

Verify the new capacity on the operating system

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.