Loading...
 

XFS

XFS is the filesystem that is the default of IRIX since the early 6.0 days. It was the first high-performance, journaling filesystem available and was developed in house by SGI to replace the older, synchronous EFS developed in the early 1990s to replace AT&T's UFS. It may be familiar to GNU/Linux users as it's become a mainstay of Linux as well, and has continued to be developed for that platform even with IRIX development being halted.

Specifications

XFS is a 64-bit journaling filesystem supporting up to 9 exabytes in size for files and filesystems. This is however limited to host block limits.

The journaling of XFS preserves file metadata transactions, which serves as a recovery device if the filesystem crashes. This allows for asynchronous filesystem operations to be performed and still maintain filesystem integrity.

XFS is optimized for parallel and multiprocessor operations thanks to its use of allocation groups for filesystem allocation - these are equally sized portions of a filesystem which have their own free space and inodes managed separately, allowing multithreaded scheduling of filesystem operations.

Space in files stored on XFS filesystems is managed in variable length extents, as opposed to the fixed size blocks used by many other file systems. Many file systems manage space allocation with block oriented bitmaps — in XFS these structures are replaced with an extent oriented structure consisting of a pair of B+ trees for each filesystem allocation group (AG). One of the B+ trees is indexed by the length of the free extents, while the other is indexed by the starting block of the free extents. This dual indexing scheme allows for highly efficient searching for appropriate free extents for file system operations.

The file system block size represents the minimum allocation unit. XFS allows file systems to be created with block sizes ranging between 512 bytes and 64 Kilobytes, allowing the file system to be tuned for the expected use. Where a large amount of small files is to be expected, a small block size would typically be used, but for a system dealing mainly with large files, a larger block size can provide a performance advantage.

XFS makes use of lazy evaluation techniques for file allocation. When a file is written to the buffer cache, rather than allocating extents for the data, XFS simply reserves the appropriate number of file system blocks for the data held in memory. The actual block allocation occurs only when the data is finally flushed to disk. This improves the chance that the file will be written in a contiguous group of blocks, reducing fragmentation problems and increasing performance.

XFS provides a 64-bit sparse address space for each file, which allows both for very large file sizes, and for holes within files for which no disk space is allocated. As the file system used an extent map for each file, the file allocation map size is kept small. Where the size of the allocation map is too large for it to be stored within the inode, the map is moved into a B+ tree which allows for rapid access to data anywhere in the 64-bit address space provided for the file.

XFS provides multiple data streams for files through its implementation of extended attributes. These allow the storage of a number of name/value pairs attached to a file. Names are null terminated printable character strings of up to 256 bytes in length, while their associated values can contain up to 64Kb of binary data. They are further subdivided into two namespaces, root and user. Extended attributes stored in the root namespace can be modified only by the superuser, while attributes in the user namespace can be modified by any user with permission to write to the file. Extended attributes can be attached to any kind of XFS inode, including symbolic links, device nodes, directories, etc. The attr program can be used to manipulate extended attributes from the command line, and the xfsdump and xfsrestore utilities are aware of them and will back up and restore their contents. Most other backup systems are not extended attribute aware.

For applications requiring high throughput to disk, XFS provides a direct I/O implementation that allows non-cached I/O directly to userspace. Data is transferred between the application's buffer and the disk using DMA, which allows access to the full I/O bandwidth of the underlying disk devices.

XFS provides the xfs_growfs utility to perform online resizing of XFS file systems. XFS filesystems can only be grown, not shrunk, and growing the filesystem requires there to be remaining unallocated space on the device holding the filesystem. This feature is typically used in conjunction with volume management, as otherwise the partition holding the filesystem will need enlarging separately.

Compatibility with GNU/Linux XFS

The two versions of XFS used by IRIX and GNU/Linux respectively are not in any way the same, especially as more than a decade of development has gone on between IRIX's demise and the present day. This has resulted in incompatibilities that users in the forums have said can prevent accessing IRIX volumes from a modern GNU/Linux distribution because directory structure v2 (the highest IRIX's XFS supports) is no longer supported on the most recent GNU/Linux versions. This has not been confirmed, but should be kept in mind when trying to use a GNU/Linux installation to modify on-disk contents of IRIX, as doing so could potentially cause data loss.

Notations

This is copied in large part from the Higher Intellect Wiki (wiki.preterhuman.net's) excellent article. There are eventual plans to rewrite and expand this, as well as backport those changes to the Higher Intellect Wiki.