XFS

From TechPubs Wiki

Revision as of 04:48, 7 May 2025 by Raion (talk | contribs) (Created page with "XFS is the journaling filesystem used starting with IRIX 6.0 and 5.3 XFS releases. It continued to be used through IRIX 6.5.30 with incremental improvements to the performance, stability and features of the codebase. == Basic Information == XFS improved on EFS in several areas, including higher I/O performance. A properly engineered journaled filesystem can perform writes asynchronously without serious risk of data loss or metadata corruption, unlike a synchronous file...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

XFS is the journaling filesystem used starting with IRIX 6.0 and 5.3 XFS releases. It continued to be used through IRIX 6.5.30 with incremental improvements to the performance, stability and features of the codebase.

Basic Information

XFS improved on EFS in several areas, including higher I/O performance. A properly engineered journaled filesystem can perform writes asynchronously without serious risk of data loss or metadata corruption, unlike a synchronous filesystem. By performing writes out of order, it avoids having to roll back writes that were unnecessary, and can ensure filesystem integrity by replaying the log, rather than running a traditional fsck.

XFS allows larger volumes and file sizes due to being a true 64-bit filesystem. It also promised higher system performance, lower latency and greater stabilty. Clustering was introduced as a commercial option (CXFS/Cell).

Overview of Specifications

Maximum Volume Size 16 Eibytes (16 x 1024 x 1024 TiB)
Maximum File Size 8 Eibytes
Filename Length 255 bytes
Filesystem Data Structures B+trees
Introduced IRIX 6.0

Mounting XFS on GNU/Linux

It is possible to mount an IRIX XFS image on GNU/Linux, though some care must be taken. Directory structure V1, used by IRIX through early 6.5 releases, was removed from the Linux kernel in the late 2.6.x and early 3.x releases. Full directory structure V2 support in IRIX was removed around 3.16 and replaced with later releases which are incompatible.

Modern GNU/Linux as of 2025 detects an IRIX 6.5.x filesystem using v2 structures as a v3/v4 system. This is problematic as the B+ tree data structures used are 100% incompatible. Any writes to the filesystem will cause a mix of inode types, which will cause data loss.

V3 uses a different block header format with CRC support. This structure is fundamentally incompatible. From the source code, other changes exist:

	 * A single byte containing the file type field follows the inode
	 * number for version 3 directory entries.

As it goes on:

/*
 * Active entry in a data block.
 *
 * Aligned to 8 bytes.  After the variable length name field there is a
 * 2 byte tag field, which can be accessed using xfs_dir3_data_entry_tag_p.
 *
 * For dir3 structures, there is file type field between the name and the tag.
 * This can only be manipulated by helper functions. It is packed hard against
 * the end of the name so any padding for rounding is between the file type and
 * the tag.
 */

The primary issue here is that modern Linux will assume it's a V3 or V4 structure and proceed to write a header with a type, which will be interpreted as the start offset tag for a V2 system. It's easy to understand, even for a layperson, why this is not possible to reconcile.

Additionally, with this in mind, do not attempt to fsck an XFS system from IRIX on a modern GNU/Linux system. A safe alternative is to use an older GNU/Linux distro using a 3.14 kernel or older.

Citations

Much of the Mounting XFS on GNU/Linux section was contributed by: https://github.com/rozjin