Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 1. Overview of available file systems
Choosing the file system that is appropriate for your application is an important decision due to the large number of options available and the choices to consider.
The following sections describe the file systems that Red Hat Enterprise Linux 10 includes by default, and recommendations on the most suitable file system for your application.
1.1. Types of file systems Copier lienLien copié sur presse-papiers!
Red Hat Enterprise Linux 10 supports a variety of file systems (FS). Different types of file systems solve different kinds of problems, and their usage is application specific.
At the most general level, available file systems can be grouped into the following major types:
| Type | File system | Attributes and use cases |
|---|---|---|
| Disk or local FS | XFS | XFS is the default file system in RHEL. Deploy XFS as your local file system unless there are specific reasons to do otherwise. For example, compatibility or corner cases around performance. |
| ext4 | ext4 has the benefit of familiarity in Linux, having evolved from the older ext2 and ext3 file systems. In many cases, it rivals XFS on performance. Support limits for ext4 file system and file sizes are lower than those on XFS. | |
| Network or client-and-server FS | Network File System (NFS) | Use NFS to share files between multiple systems on the same network. |
| Server Message Block (SMB) | Use SMB for file sharing with Microsoft Windows systems. | |
| Volume-managing FS | Stratis | Stratis is a volume manager built on a combination of XFS and Logical Volume Manager (LVM). The purpose of Stratis is to emulate capabilities offered by volume-managing file systems like Btrfs and ZFS. It is possible to build this stack manually, but Stratis reduces configuration complexity, implements best practices, and consolidates error information. |
1.2. Local file systems Copier lienLien copié sur presse-papiers!
Local file systems run on one server with directly attached storage. They are used for internal Serial Advanced Technology Attachment (SATA) or Serial Attached SCSI (SAS) disks, hardware RAID, and non-shared SAN devices.
All local file systems follow Portable Operating System Interface (POSIX) standards and provide support for a well-defined set of system calls. Examples include read(), write(), and seek().
- Available local file systems
- XFS
- ext4
1.3. The XFS file system Copier lienLien copié sur presse-papiers!
XFS is a highly scalable, high-performance, robust, and mature 64-bit journaling file system. It supports very large files and file systems on a single host. It is the default file system in Red Hat Enterprise Linux 10. XFS was originally developed in the early 1990s by SGI and has a long history of running on extremely large servers and storage arrays.
The features of XFS include:
- Reliability
- Metadata journaling ensures file system integrity after a system crash. It keeps a record of file system operations. These records can be replayed when the system restarts and the file system is remounted.
- Extensive run-time metadata consistency checking
- Scalable and fast repair utilities
- Quota journaling. This avoids the need for lengthy quota consistency checks after a crash.
- Scalability and performance
- Supported file system size up to 1024 TiB
- Ability to support a large number of concurrent operations
- B-tree indexing for scalability of free space management
- Sophisticated metadata read-ahead algorithms
- Optimizations for streaming video workloads
- Allocation schemes
- Extent-based allocation
- Stripe-aware allocation policies
- Delayed allocation
- Space pre-allocation
- Dynamically allocated inodes
- Other features
- Reflink-based file copies
- Tightly integrated backup and restore utilities
- Online defragmentation
- Online file system growing
- Comprehensive diagnostics capabilities
-
Extended attributes (
xattr). With this, the system can associate several additional name/value pairs per file. - Project or directory quotas for quota restrictions over a directory tree.
- Subsecond timestamps
- Performance characteristics
XFS has high performance on large systems with enterprise workloads. A large system is one with a relatively high number of CPUs, multiple HBAs, and connections to external disk arrays. XFS also performs well on smaller systems that have a multi-threaded, parallel I/O workload.
XFS performs comparably well on smaller systems, but is more focused on scalability and large data sets.
1.4. The ext4 file system Copier lienLien copié sur presse-papiers!
The ext4 file system is the fourth generation of the ext file system family. The ext4 driver can read and write to ext2 and ext3 file systems. However, the ext4 file system format is not compatible with ext2 and ext3 drivers.
ext4 adds several new and improved features, such as:
- Supported file system size up to 50 TiB
- Extent-based metadata
- Delayed allocation
- Journal checksumming
- Large storage support
The extent-based metadata and the delayed allocation features help to track utilized space in a file system. These features improve file system performance and reduce the space consumed by metadata. The file system postpones selecting the permanent location for newly written user data because of delayed allocation.
The location is chosen only when the data is flushed to disk. This causes higher performance since it can allow for larger, more contiguous allocations. The file system can make decisions with much better information.
File system repair time by using the fsck utility in ext4 is much faster than in ext2 and ext3. Some file system repairs have demonstrated up to a six-fold increase in performance.
1.5. Comparison of XFS and ext4 Copier lienLien copié sur presse-papiers!
XFS is the default file system in RHEL. This section compares the usage and features of XFS and ext4.
- Metadata error behavior
-
In ext4, you can configure the behavior when the file system encounters metadata errors. The default behavior is to continue the operation. When XFS encounters an unrecoverable metadata error, it shuts down the file system and returns the
EFSCORRUPTEDerror. XFS also supports configurable error handling. - Quotas
In ext4, you can enable quotas when creating the file system or later on an existing file system. You can then configure the quota enforcement by using a mount option.
XFS quotas are not a remountable option. You must activate quotas on the initial mount.
Running the
quotacheckcommand on an XFS file system has no effect. The first time you turn on quota accounting, XFS checks quotas automatically.- File system resize
- XFS has no utility to reduce the size of a file system. You can only increase the size of an XFS file system. In comparison, ext4 supports both extending and reducing the size of a file system. However, shrinking is only an offline operation.
- Inode numbers
The ext4 file system does not support more than 232 inodes.
XFS supports dynamic inode allocation. The amount of space inodes can consume on an XFS filesystem is calculated as a percentage of the total filesystem space. To prevent the system from running out of inodes, an administrator can tune this percentage after the filesystem has been created. To prevent the system from running out of inodes, an administrator can tune this percentage after the file system has been created. This is possible when there is free space available on the file system.
Certain applications cannot properly handle inode numbers larger than 232 on an XFS file system. These applications might cause the failure of 32-bit stat calls with the
EOVERFLOWreturn value. Inode number exceed 232 under the following conditions:- The file system is larger than 1 TiB with 256-byte inodes.
- The file system is larger than 2 TiB with 512-byte inodes.
If your application fails with large inode numbers, mount the XFS file system with the
-o inode32option to enforce inode numbers below 232. Usinginode32does not affect inodes that are already allocated with 64-bit numbers.ImportantDo not use the
inode32option unless a specific environment requires it. Theinode32option changes allocation behavior. As a consequence, theENOSPCerror might occur if no space is available to allocate inodes in the lower disk blocks.
1.6. Choosing a local file system Copier lienLien copié sur presse-papiers!
To choose a file system that meets your application requirements, you must understand the target system on which you deploy the file system. In general, use XFS unless you have a specific use case for ext4.
- XFS
- For large-scale deployments, use XFS, particularly when handling large files (hundreds of megabytes) and high I/O concurrency. XFS performs optimally in environments with high bandwidth (greater than 200MB/s) and more than 1000 Input/Output Operations Per Second (IOPS). However, it consumes more CPU resources for metadata operations compared to ext4 and does not support file system shrinking.
- ext4
- For smaller systems or environments with limited I/O bandwidth, ext4 might be a better fit. It performs better in single-threaded, lower I/O workloads and environments with lower throughput requirements. ext4 also supports offline shrinking, which can be beneficial if resizing the file system is a requirement.
Benchmark your application’s performance on your target server and storage system to ensure the selected file system meets your performance and scalability requirements.
| Scenario | Recommended file system |
|---|---|
| No special use case | XFS |
| Large server | XFS |
| Large storage devices | XFS |
| Large files | XFS |
| Multi-threaded I/O | XFS |
| Single-threaded I/O | XFS, ext4 |
| Limited I/O capability (under 1000 IOPS) | XFS, ext4 |
| Limited bandwidth (under 200MB/s) | XFS, ext4 |
| CPU-bound workload | XFS, ext4 |
| Support for offline shrinking | XFS, ext4 |
1.7. Network file systems Copier lienLien copié sur presse-papiers!
Network file systems, also referred to as client/server file systems, provide client systems with access to files that are stored on a shared server. This makes it possible for multiple users on multiple systems to share files and storage resources.
Such file systems are built from one or more servers that export a set of file systems to one or more clients. The client nodes do not have access to the underlying block storage. Instead, they interact with the storage by using a protocol that allows for better access control.
- Available network file systems
- The most common client/server file system for RHEL customers is the Network File Systems (NFS). RHEL provides both an NFS server component to export a local file system over the network and an NFS client to import these file systems.
- RHEL also includes a Common Internet File System (CIFS) client. This supports the popular Microsoft Server Message Block (SMB) file servers for Windows interoperability. The userspace Samba server provides Windows clients with a Microsoft SMB service from a RHEL server.
1.10. Volume-managing file systems Copier lienLien copié sur presse-papiers!
Volume-managing file systems integrate the entire storage stack for the purposes of simplicity and improvements within the storage layers.
- Available volume-managing file systems
- Red Hat Enterprise Linux 10 provides the Stratis volume manager. Stratis uses XFS for the file system layer and integrates it with Logical Volume Manager (LVM), Device Mapper, and other components.
Stratis was first released in Red Hat Enterprise Linux 8.0. It is conceived to fill the gap created when Red Hat deprecated Btrfs. Stratis 1.0 is an intuitive, command line-based volume manager. It can perform significant storage management operations while hiding the complexity from the user:
- Volume management
- Pool creation
- Thin storage pools
- Snapshots
- Automated read cache
Stratis offers powerful features, but currently lacks certain capabilities of other offerings that it might be compared to, such as Btrfs or ZFS. Most notably, it does not support checksums that can automatically fix errors.