Mastering XFS: Features, Installation, and Migration on Linux
This article explains the XFS file system’s key features such as data integrity, performance, scalability and bandwidth, and provides step‑by‑step instructions for downloading kernel patches, enabling XFS support, compiling the kernel, creating and mounting XFS partitions, and migrating existing Linux systems to XFS.
XFS Filesystem Overview
XFS is a high‑performance, scalable, and robust journaling file system originally developed by SGI and later ported to Linux. The latest usable version (1.2) works well with the 2.4 kernel.
Key Features
Data integrity : Journaling ensures rapid recovery after unexpected crashes.
Performance : Optimized algorithms keep logging overhead low; XFS shows superior speed compared with JFS, Ext3, and ReiserFS.
Scalability : Fully 64‑bit, supporting up to 9 exabytes per file and 18 exabytes per file system, with fast B+‑tree searches.
Bandwidth : Near‑raw device I/O performance, up to 7 GB/s overall and 4 GB/s for single‑file reads/writes.
Using XFS on Linux
Downloading and patching the kernel
# cd /usr/src/linux
# patch -p1 < /path/to/xfs-1.1-2.4.18-all.patchAfter patching, enable XFS support in the kernel configuration and compile:
# make menuconfig
# make bzImage
# make modules
# make modules_install
# make installCreating an XFS filesystem
Install the XFS utilities (xfsprogs) and format a partition:
# tar -xvf xfsprogs-2.0.3.src.tar.gz
# cd xfsprogs-2.0.3src
# ./configure
# make
# make install
# /sbin/mkfs.xfs /dev/sda6If the partition was previously formatted with another file system, force formatting with -f:
# /sbin/mkfs.xfs -f /dev/sda6Mounting and auto‑loading
# mount -t xfs /dev/sda6 /xfsAdd an entry to /etc/fstab so the XFS partition mounts automatically at boot.
Filesystem Migration
Before converting other partitions to XFS, back up all data. To achieve a pure XFS system, create an intermediate ext2 partition, copy the entire root file system to it, update /etc/fstab and bootloader configuration (e.g., /etc/lilo.conf), then reboot. After confirming the new root works, format the original root partition as XFS and repeat the copy‑back process.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
