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:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/Extend-XFS-Filesystem-Linux-Without-LVM-01.png" data-lazy- height="160" src="data:image/svg xml,” width=”831″>

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.

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:

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:

Conclusion

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

About the author

<img alt="" data-del="avatar" data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/john-150×150.png60f2fc9fe81bd.jpg" height="112" src="data:image/svg xml,” width=”112″>

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