ext4
Developer(s) | Mingming Cao, Dave Kleikamp, Alex Tomas, Andrew Morton, others |
---|---|
Full name | Fourth extended file system |
Introduced | October 10 2006 with Linux 2.6.19 |
Partition IDs | 0x83 (MBR) EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (GPT) |
Structures | |
Directory contents | Table, H-Tree |
File allocation | bitmap (free space), table (metadata) |
Bad blocks | Table |
Limits | |
Max volume size | 1024 PiB = 1 EiB |
Max file size | 16 TiB |
Allowed filename characters | All bytes except NUL and '/' |
Features | |
Dates recorded | modification (mtime), attribute modification (ctime), access (atime) |
Date range | December 14, 1901 - January 18, 2038 |
Date resolution | nanosecond |
Forks | Yes |
Attributes | extents, data=journal, data=ordered, data=writeback, commit=nrsec, orlov, oldalloc, user_xattr, nouser_xattr, acl, noacl, bsddf, minixdf, bh, nobh |
File system permissions | POSIX |
Transparent compression | see ext2 |
Transparent encryption | see ext2 |
Other | |
Supported operating systems | GNU/Linux |
The ext4, or fourth extended filesystem is a journalled file system that was announced on October 10, 2006 by Andrew Morton as a compatible improvement to the ext3 filesystem.
History
Ext4 was included in version 2.6.19 of the Linux kernel which was released on November 29, 2006.
The filesystem is currently marked as developmental and is titled "ext4dev"[1].
Features
Large filesystem
The ext4 filesystem can support volumes with sizes up to 1 exbibyte (1024 pebibytes).
Extents
Extents are introduced to map a range of contiguous physical blocks into a single descriptor. A single extent can map up to 128MB of contiguous space with a 4KB block size. "Ext4 overview" (PDF). Retrieved 2008-01-15.
Backward compatibility
The ext4 filesystem is backward compatible with ext3, making it possible to mount an ext3 filesystem as ext4 (using the “ext4dev” filesystem type).
Forward compatibility
The ext4 filesystem is forward compatible with ext3, that is, it can be mounted as an ext3 partition (using “ext3” as the filesystem type when mounting). However, if the ext4 partition uses extents (one of the major new features of ext4), forward compatibility and therefore the ability to mount the filesystem as ext3 is lost. Extents were enabled by default in the 2.6.23 kernel. Previously, the “extents” option was explicitly required (e.g. mount /dev/sda1 /mnt/point -t ext4dev -o extents
).
Persistent Pre-Allocation
The ext4 filesystem allows for pre-allocation of on disk space for a file. The current methodology for this on most file systems is to write the file full of 0's to reserve the space when the file is created (although XFS has an ioctl to allow for true pre-allocation as well). This method would no longer be required for ext4. The space allocated for files such as these would be guaranteed and would likely be contiguous. This has applications for media streaming and databases.
Delayed allocation
In ext4, on-disk allocation of space is delayed until a page flush instead of actually occurring in the write call. This has several advantages, first being that it reduces fragmentation as the old system passed block write requests through the VFS layer one at a time so the underlying system could never detect when clustering of the blocks was possible on the disk. With delayed allocation, more planning is possible to avoid fragmentation of files across the disk. The second advantage is that some short lived temporary files may never actually be written to the disk at all. A disadvantage is files that are still in memory that haven't been written to disk are lost when a power outage happens similar to XFS.
Break 32000 Subdirectory Limit
In ext3 the number of subdirectories that a directory could contain was limited to 32000. This limit is lifted in ext4. To allow for continued performance given the possibility of much larger directories, Htree indexes (a specialized version of a Btree) is turned on by default in ext4. This feature is implemented in 2.6.23. Htree is also available in ext3 with dir_index enabled.
Online Defragmentation
Ext4 will also have an online defragmenter. Even with the various techniques used to avoid it, a long lived file system does tend to become fragmented over time. Ext4 has a tool which can defragment individual files or entire file systems.
Faster File System Checking
In ext4, unallocated block groups and sections of the inode table are marked as such. This enables e2fsck to skip them entirely on a check and greatly reduce the time it takes to check a file system of the size ext4 is built to support.
Nanosecond timestamps
As computers become faster in general and specifically Linux becomes used more for mission critical applications, the granularity of second-based timestamps becomes insufficient. To solve this, ext4 will have timestamps measured in nanoseconds. This feature is currently implemented in 2.6.23.
See also
External links
- Theodore Ts'o's discussion on ext4
- Andrew Morton's announcement of ext4 support
- First benchmarks of ext4
- Ext4 Development Wiki
- "The new ext4 filesystem: current status and future plans" (materials from Ottawa Linux Symposium 2007)
- "ext4 online defragmentation" (materials from Ottawa Linux Symposium 2007)
- “Ext4: The Next Generation of Ext2/3 Filesystem”
Notes and references
- ^ "OLS 2007: Ext4 Paper" (PDF). Retrieved 2007-08-10.