Ext4
Introduction
The ext4 or extended filesystem 4 is a journaling file system for Linux, developed as the successor to ext3. It is designed to address a variety of storage needs and to rectify the limitations of ext3, such as the inability to support large filesystems or files. Ext4 is the default file system for many Linux distributions, including Ubuntu and Debian file systems.
History
The development of ext4 was started by a group of software engineers in the Linux community to address the limitations of the ext3 filesystem. The first stable version was released in 2008, and it has been the default filesystem for several Linux distributions since 2010. The development of ext4 was led by Theodore Ts'o, a prominent Linux kernel developer.
Features
Ext4 includes several new features that improve upon those in ext3. These include:
- Extents: Ext4 uses a storage mechanism called extents, which improve the system's performance and reduce fragmentation. An extent is a contiguous area of storage reserved for a file in the filesystem, which can be up to 128MB in size with the standard 4KB block size.
- Backward Compatibility: Ext4 is backward compatible with ext3 and ext2, meaning it can mount ext3 and ext2 filesystems and use them as they are.
- Persistent Pre-allocation: Ext4 can reserve space for a file without actually writing any data to the disk. This feature is useful for applications such as video recording where a large file is expected to be written over time.
- Delayed Allocation: Ext4 uses a technique called delayed allocation to improve performance and reduce fragmentation by delaying the allocation of blocks as long as possible.
- Journal Checksumming: This feature improves reliability by adding a checksum to the journal, which can be used to verify the integrity of the journal during recovery.
- Large Filesystem/File Support: Ext4 supports filesystems up to 1 exabyte and files up to 16 terabytes in size.
- Inode Size: The default inode size in ext4 is 256 bytes, which allows for more inode attributes.
- Online Defragmentation: Ext4 includes an online defragmentation tool, which can defragment individual files or the entire filesystem without needing to unmount it.
Performance
Ext4 provides several performance improvements over ext3. The use of extents reduces fragmentation and improves performance for large files. Delayed allocation and journal checksumming also contribute to improved performance. However, the performance of ext4 can be affected by various factors, such as the size of the filesystem, the type of data being stored, and the specific hardware configuration.
Limitations
While ext4 has many advantages, it also has some limitations. For instance, although ext4 supports filesystems up to 1 exabyte in size, the maximum file size is 16 terabytes. Additionally, the ext4 filesystem is not suitable for flash-based storage devices, such as SSDs, due to its lack of a TRIM command. However, this limitation can be overcome by using the discard mount option or the fstrim utility.
Usage
Ext4 is widely used in various Linux distributions, including Ubuntu, Debian, Fedora, and others. It is also used in Android devices, as well as in several NAS devices and routers. The ext4 filesystem can be created and managed using the mkfs.ext4 and tune2fs utilities, respectively.