Linux Commands

How to Extend XFS Filesystem in Linux Without LVM

This tutorial will walk you through how to extend your XFS Filesystem without LVM.

NOTE: I tested the concepts in this tutorial on a CentOS 8 system. However, the approaches discussed will work on any System using the XFS File system.

Step 1: Show partition scheme information

The first step is to get information about the available partitions. You can do this by using the lsblk command as:

sudo lsblk

Step 2: Extend disk space

The next space is to extend the disk space. You can do this by creating a new partition—or add a new drive.

Confirm disk changes using the lsblk command as above.

sudo lsblk

Step 3: Grow the partition

The next step is to grow the partition. For this, we need to install the growpart package.

On CentOS:

sudo yum install cloud-utils-growpart gdisk

On Debian:

sudo apt-get install gdisk cloud-guest-utils

On Arch:

sudo pacman -S gdisk cloud-guest-utils

Step 4: Extend & resize partition

The next step is to use growpart to extend the partition. The command for that is:

sudo growpart /dev/sda 3

The command above will resize the third partition on /dev/sda as shown in the lsblk command.

Finally, resize the root partition to fill the space using the resize2fs command. For example:

sudo xfs_growfs /

Conclusion

This tutorial covered the basic steps of extending the XFS filesystem without using LVM.

About the author

John Otieno

My name is John and am a fellow geek like you. I am passionate about all things computers from Hardware, Operating systems to Programming. My dream is to share my knowledge with the world and help out fellow geeks. Follow my content by subscribing to LinuxHint mailing list