How to extend the XFS file system residing over raw disk

As we are aware how to Extend XFS filesystems with LVM and however we may face a situation where we need to extend the XFS file system residing over partition. Hence this article will cover the process of extending an XFS filesystem residing over raw partition (i.e. without LVM).

Always make sure you hae backup of your data, before making any changes over production environment.

1. First check the existing partitioning on the system as below,

$ fdisk /dev/sdX
$ lsblk

Note: Here “sdX” is the device which is supposted to be extended.

2. Now extend the disk from hypervisor/vmware/virtualbox.

3. Make sure the below packages are available or install them as shown here,

$ yum install gdisk cloud-utils-growpart

4. Now that you have a newly added disk space available for the mentioned disk, you can extend the partition with below command,

$ growpart /dev/sda 5

5. Extend the XFS file system with below command,

$ xfs_growfs /dev/sda5

Note: Here you can replace “sda5” with the appropriate device name and partition number for your XFS filesystem.

6. This command will automatically resize the XFS filesystem to occupy the newly added partition space.

Validate if the file system got extend or not by,

$ df -h

Summary:
By implementing these steps, you can simply extend an XFS filesystem in Linux without relying on LVM. These steps provides a straightforward alternative for managing your storage needs. Hence its now feasible to extend the XFS file system residing over partition without LVM.