The efficiency of virtual machines (VMs) is often constrained by the underlying storage system’s ability to handle high volumes of read and write operations. For Fedora users setting up a VM that will experience intense I/O activities, formatting a disk with the XFS filesystem is a (more) than valid option. Let’s look at the process of preparing a disk with XFS on Fedora, especially tailored for VM storage that anticipates a high number of reads and writes.
XFS, known for its high performance and scalability, is a 64-bit journaling filesystem. Originally from Silicon Graphics, Inc (SGI) in 1993, it was engineered to support voluminous filesystems and deliver exceptional performance, particularly in environments that require managing large files and facilitating high scalability, all characteristics of VM storage.
XFS’s architecture is optimised for high throughput, making it suitable for handling numerous simultaneous read and write operations. This is very important for VM environments where disk I/O operations are constant and performance is a known bottleneck.
The ability to efficiently manage large files and filesystems ensures that VM storage can be scaled dynamically in response to the needs of the system, without compromising on performance.
The journaling mechanism of XFS guarantees the integrity of the filesystem in the event of unexpected shutdowns or system crashes, protecting against data corruption during high I/O periods.
XFS includes features such as allocation groups for enhanced disk access, online defragmentation to maintain optimal performance, and online resizing to adjust resources dynamically — all of which are beneficial under heavy I/O load.
Before jumping in on formatting, make sure you back up any existing data on the disk to avoid loss. The following steps will guide you through preparing a disk with XFS for your VM on Fedora.
Begin by installing the XFS utilities on Fedora (if you don’t have them already):
sudo dnf install xfsprogs
Use the lsblk
command to list all disks and identify the one intended for formatting:
lsblk
Look for the disk through its size or identifier, like /dev/sdX
.
After locating your disk, format it to XFS:
sudo mkfs.xfs /dev/sdX
Replace /dev/sdX
with the actual disk path.
Create a mount point and mount the formatted disk:
sudo mkdir /mnt/vm_storage
sudo mount /dev/sdX /mnt/vm_storage
To mount the disk automatically upon boot, modify the /etc/fstab
file:
blkid
./etc/fstab
, substituting your-disk-uuid
with the actual UUID:UUID=your-disk-uuid /mnt/vm_storage xfs defaults 0 0
You can also read this in the Linux admin guide.