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 |
![](https://www.unixforte.com/wp-content/uploads/2023/05/lsblk_raw_partition.png)
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 |
![](https://www.unixforte.com/wp-content/uploads/2023/05/gdisk_cloud-utils.png)
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 |
![](https://www.unixforte.com/wp-content/uploads/2023/05/growpart_sda_5.png)
5. Extend the XFS file system with below command,
$ xfs_growfs /dev/sda5 |
![](https://www.unixforte.com/wp-content/uploads/2023/05/xfs_growfs_partition.png)
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 |
![](https://www.unixforte.com/wp-content/uploads/2023/05/df-h_file_extend_validation.png)
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.