Exploring the features of the XFS file system on Linux

One of the most interesting of file system alternatives for enterprise Linux environments is XFS. In this tip we’ll explore the features and advantages the XFS file system offers that differ from ext3 and ext4.

The XFS file system was developed as a journaling file system that uses a B-tree balanced tree algorithm to allocate data as fast as possible. One of the major design goals was support for large files and large file systems. The maximum file size currently supported is 2 Exabytes, and the maximum file system size is 8 Exabytes.

XFS support
If you're considering using XFS, you first need to be aware that it's not available on all Linux distributions.
Red Hat does not offer XFS support by default, but offers it in the Scalable File System add-on product. SUSE Linux Enterprise

Requires Free Membership to View

Server has support for XFS and you can use it with other distributions such as Debian, Gentoo, Mandriva or Fedora.

How does XFS differ from ext3 or ext4?
Before you consider XFS, you should know how it is different. Many tasks work differently on XFS, including setting quota, repairing the file system, or even just copying a file. These differences occur because of the features XFS offers.

An important feature is the allocation group, which makes XFS a highly scalable file system that allows you to store large numbers of files, and very large files. Each allocation group manages its own inodes and free space and by creating allocation groups, you can make sure that several processes and threads can service the file system simultaneously, which can increase performance.

To address files efficiently, XFS works with extents -- a technique that has been adopted by Ext4. An extent is a group of blocks that can be addressed as one single entity. The benefit is that instead of addressing all blocks in use by a file individually, XFS addresses a limited amount of extents, which makes it much more efficient when addressing large files.

Delayed allocation is another helpful feature of XFS. When a file is first created, its contents are normally written to the buffer cache, and then it normally is flushed to disk. XFS waits to do that as long as possible because a new file often will have several modifications just after being created. By delaying the flushing of the file to disk as much as possible, the file system optimizes the way the file is written and allocates as many contiguous blocks or extents as possible, preventing file system fragmentation later.

XFS has some options for times when delayed allocation is not optimal. The direct I/O option guarantees that a file is not buffered in buffer cache, but written to disk immediately after it has been committed. XFS exclusively offers a guaranteed rate I/O, which guarantees that certain file systems have a minimum I/O-bandwidth. This feature makes XFS an excellent file system for streaming media.

XFS has some unique features that make it an excellent file system for environments that need to support either large amounts of files, or large files. But if you consider using XFS, you need to make a plan to implement it with the optimal performance settings for your Linux server environment.

This was first published in February 2011

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.