Developer(s) | Mingming Cao, Andreas Dilger, Alex Zhuravlev (Tomas), Dave Kleikamp, Theodore Ts'o, Eric Sandeen, Sam Naghshineh, others |
---|---|
Full name | Fourth extended file system |
Introduced | 10 October 2006 with Linux 2.6.19 |
Preceded by | ext3 |
Partition IDs | 0x83: MBR / EBR. EBD0A0A2-B9E5-4433-87C0-68B6B72699C7: GPT Windows BDP. [1] Contents
|
Structures | |
Directory contents | Linked list, hashed B-tree |
File allocation | Extents / Bitmap |
Bad blocks | Table |
Limits | |
Max volume size | 1 EiB |
Max file size | 16-256 TiB (for 4-64 KiB block size) |
Max no. of files | 4 billion (specified at filesystem creation time) |
Max filename length | 255 bytes (fewer for multibyte character encodings such as Unicode) |
Allowed filename characters | All bytes except NULL ('\0') and '/' and the special file names "." and ".." which are not forbidden but are always used for a respective special purpose. |
Features | |
Dates recorded | modification (mtime), data or attribute modification (ctime), access (atime), delete (dtime), create (crtime) |
Date range | 14 December 1901 - 10 May 2446 [3] |
Date resolution | Nanosecond |
Forks | No |
Attributes | acl, bh, bsddf, commit=nrsec, data=journal, data=ordered, data=writeback, delalloc, extents, journal_dev, mballoc, minixdf, noacl, nobh, nodelalloc, noextents, nomballoc, nombcache, nouser_xattr, oldalloc, orlov, user_xattr |
File system permissions | Unix permissions, POSIX ACLs |
Transparent compression | No |
Transparent encryption | Yes |
Data deduplication | No |
Other | |
Supported operating systems |
ext4 (fourth extended filesystem) is a journaling file system for Linux, developed as the successor to ext3.
ext4 was initially a series of backward-compatible extensions to ext3, many of them originally developed by Cluster File Systems for the Lustre file system between 2003 and 2006, meant to extend storage limits and add other performance improvements. [4] However, other Linux kernel developers opposed accepting extensions to ext3 for stability reasons, [5] and proposed to fork the source code of ext3, rename it as ext4, and perform all the development there, without affecting existing ext3 users. This proposal was accepted, and on 28 June 2006, Theodore Ts'o, the ext3 maintainer, announced the new plan of development for ext4. [6]
A preliminary development version of ext4 was included in version 2.6.19 [7] of the Linux kernel. On 11 October 2008, the patches that mark ext4 as stable code were merged in the Linux 2.6.28 source code repositories, [8] denoting the end of the development phase and recommending ext4 adoption. Kernel 2.6.28, containing the ext4 filesystem, was finally released on 25 December 2008. [9] On 15 January 2010, Google announced that it would upgrade its storage infrastructure from ext2 to ext4. [10] On 14 December 2010, Google also announced it would use ext4, instead of YAFFS, on Android 2.3. [11]
ext4 is the default file system for many Linux distributions including Debian and Ubuntu. [12]
This section needs additional citations for verification .(May 2024) |
^extent
, ^flex_bg
, ^huge_file
, ^uninit_bg
, ^dir_nlink
, and ^extra_isize
. [16] fallocate()
, a new system call in the Linux kernel, can be used. The allocated space would be guaranteed and likely contiguous. This situation has applications for media streaming and databases.[ citation needed ]large_dir
feature enabled a 3-level HTree and directory sizes over 2 GB, allowing approximately 6 billion entries in a single directory.This section needs expansionwith: How metadata checksum is done? The explanation needs to be easily understandable by non-technical readers. You can help by adding to it. (May 2024) |
statx()
API. [23] In 2008, the principal developer of the ext3 and ext4 file systems, Theodore Ts'o, stated that although ext4 has improved features, it is not a major advance, it uses old technology, and is a stop-gap. Ts'o believes that Btrfs is the better direction because "it offers improvements in scalability, reliability, and ease of management". [29] Btrfs also has "a number of the same design ideas that reiser3/4 had". [30] However, ext4 has continued to gain new features such as file encryption and metadata checksums.
The ext4 file system does not honor the "secure deletion" file attribute, which is supposed to cause overwriting of files upon deletion. A patch to implement secure deletion was proposed in 2011, but did not solve the problem of sensitive data ending up in the file-system journal. [31]
Because delayed allocation changes the behavior that programmers have been relying on with ext3, the feature poses some additional risk of data loss in cases where the system crashes or loses power before all of the data has been written to disk. Due to this, ext4 in kernel versions 2.6.30 and later automatically handles these cases as ext3 does.
The typical scenario in which this might occur is a program replacing the contents of a file without forcing a write to the disk with fsync. There are two common ways of replacing the contents of a file on Unix systems: [32]
fd=open("file", O_TRUNC); write(fd, data); close(fd);
O_TRUNC
flag), then new data is written out. Since the write can take some time, there is an opportunity of losing contents even with ext3, but usually very small. However, because ext4 can delay writing file data for a long time, this opportunity is much greater.fd=open("file.new"); write(fd, data); close(fd); rename("file.new", "file");
rename()
call is guaranteed to be atomic by POSIX standards – i.e. either the old file remains, or it's overwritten with the new one. Because the ext3 default "ordered" journaling mode guarantees file data is written out on disk before metadata, this technique guarantees that either the old or the new file contents will persist on disk. ext4's delayed allocation breaks this expectation, because the file write can be delayed for a long time, and the rename is usually carried out before new file contents reach the disk.Using fsync()
more often to reduce the risk for ext4 could lead to performance penalties on ext3 filesystems mounted with the data=ordered
flag (the default on most Linux distributions). Given that both file systems will be in use for some time, this complicates matters for end-user application developers. In response, ext4 in Linux kernels 2.6.30 and newer detect the occurrence of these common cases and force the files to be allocated immediately. For a small cost in performance, this provides semantics similar to ext3 ordered mode and increases the chance that either version of the file will survive the crash. This new behavior is enabled by default, but can be disabled with the "noauto_da_alloc" mount option. [32]
The new patches have become part of the mainline kernel 2.6.30, but various distributions chose to backport them to 2.6.28 or 2.6.29. [33]
These patches don't completely prevent potential data loss or help at all with new files. The only way to be safe is to write and use software that does fsync()
when it needs to. Performance problems can be minimized by limiting crucial disk writes that need fsync()
to occur less frequently. [34]
Linux kernel Virtual File System is a subsystem or layer inside of the Linux kernel. It is the result of an attempt to integrate multiple file systems into an orderly single structure. The key idea, which dates back to the pioneering work done by Sun Microsystems employees in 1986, [35] is to abstract out that part of the file system that is common to all file systems and put that code in a separate layer that calls the underlying concrete file systems to actually manage the data.
All system calls related to files (or pseudo files) are directed to the Linux kernel Virtual File System for initial processing. These calls, coming from user processes, are the standard POSIX calls, such as open
, read
, write
, lseek
, etc.
Although designed for and primarily used with Linux, an ext4 file system can be accessed via other operating systems via interoperability tools.
Windows provides access via its Windows Subsystem for Linux (WSL) technology. Specifically, the second major version, WSL 2, is the first version with ext4 support. It was first released in Windows 10 Insider Preview Build 20211. [36] [37] [38] [39] WSL 2 requires Windows 10 version 1903 or higher, with build 18362 or higher, for x64 systems, and version 2004 or higher, with build 19041 or higher, for ARM64 systems. [40]
Paragon Software offers commercial products that provide full read/write access for ext2/3/4 –Linux File Systems for Windows [41] and extFS for Mac. [42]
The free software ext4fuse provides limited (read-only) support.
XFS is a high-performance 64-bit journaling file system created by Silicon Graphics, Inc (SGI) in 1993. It was the default file system in SGI's IRIX operating system starting with its version 5.3. XFS was ported to the Linux kernel in 2001; as of June 2014, XFS is supported by most Linux distributions; Red Hat Enterprise Linux uses it as its default file system.
ReiserFS is a general-purpose, journaling file system initially designed and implemented by a team at Namesys led by Hans Reiser and licensed under GPLv2. Introduced in version 2.4.1 of the Linux kernel, it was the first journaling file system to be included in the standard kernel. ReiserFS was the default file system in Novell's SUSE Linux Enterprise until Novell decided to move to ext3 for future releases on October 12, 2006.
ext2, or second extended file system, is a file system for the Linux kernel. It was initially designed by French software developer Rémy Card as a replacement for the extended file system (ext). Having been designed according to the same principles as the Berkeley Fast File System from BSD, it was the first commercial-grade filesystem for Linux.
ext3, or third extended filesystem, is a journaled file system that is commonly used with the Linux kernel. It used to be the default file system for many popular Linux distributions but generally has been supplanted by its successor version ext4. The main advantage of ext3 over its predecessor, ext2, is journaling, which improves reliability and eliminates the need to check the file system after an improper, a.k.a. unclean, shutdown.
Journaled File System (JFS) is a 64-bit journaling file system created by IBM. There are versions for AIX, OS/2, eComStation, ArcaOS and Linux operating systems. The latter is available as free software under the terms of the GNU General Public License (GPL). HP-UX has another, different filesystem named JFS that is actually an OEM version of Veritas Software's VxFS.
In the maintenance of file systems, defragmentation is a process that reduces the degree of fragmentation. It does this by physically organizing the contents of the mass storage device used to store files into the smallest number of contiguous regions. It also attempts to create larger regions of free space using compaction to impede the return of fragmentation. Some defragmentation utilities try to keep smaller files within a single directory together, as they are often accessed in sequence.
The inode is a data structure in a Unix-style file system that describes a file-system object such as a file or a directory. Each inode stores the attributes and disk block locations of the object's data. File-system object attributes may include metadata, as well as owner and permission data.
A disk quota is a limit set by a system administrator that restricts certain aspects of file system usage on modern operating systems. The function of using disk quotas is to allocate limited disk space in a reasonable way.
The extended file system, or ext, was implemented in April 1992 as the first file system created specifically for the Linux kernel. Although ext is not a specific file system name, it has been succeeded by ext2, ext3, and ext4. It has metadata structure inspired by traditional Unix filesystem principles, and was designed by Rémy Card to overcome certain limitations of the MINIX file system. It was the first implementation that used the virtual file system (VFS), for which support was added in the Linux kernel in version 0.96c, and it could handle file systems up to 2 gigabytes (GB) in size.
In computing, a file system or filesystem governs file organization and access. A local file system is a capability of an operating system that services the applications running on the same computer. A distributed file system is a protocol that provides file access between networked computers.
In computing, an extent is a contiguous area of storage reserved for a file in a file system, represented as a range of block numbers, or tracks on count key data devices. A file can consist of zero or more extents; one file fragment requires one extent. The direct benefit is in storing each range compactly as two numbers, instead of canonically storing every block number in the range. Also, extent allocation results in less file fragmentation.
Xiafs was a file system for the Linux kernel which was conceived and developed by Ge (Frank) Xia and was based on the MINIX file system. Today it is obsolete and not in use, except possibly in some historic installations.
The following tables compare general and technical information for a number of file systems.
Btrfs is a computer storage format that combines a file system based on the copy-on-write (COW) principle with a logical volume manager, developed together. It was created by Chris Mason in 2007 for use in Linux, and since November 2013, the file system's on-disk format has been declared stable in the Linux kernel.
In computer operating systems, mkfs
is a command used to format a block storage device with a specific file system. The command is part of Unix and Unix-like operating systems. In Unix, a block storage device must be formatted with a file system before it can be mounted and accessed through the operating system's filesystem hierarchy.
The Orlov block allocator is an algorithm to define where a particular file will reside on a given file system (blockwise), so as to speed up disk operations.
An HTree is a specialized tree data structure for directory indexing, similar to a B-tree. They are constant depth of either one or two levels, have a high fanout factor, use a hash of the filename, and do not require balancing. The HTree algorithm is distinguished from standard B-tree methods by its treatment of hash collisions, which may overflow across multiple leaf and index blocks. HTree indexes are used in the ext3 and ext4 Linux filesystems, and were incorporated into the Linux kernel around 2.5.40. HTree indexing improved the scalability of Linux ext2 based filesystems from a practical limit of a few thousand files, into the range of tens of millions of files per directory.
A journaling file system is a file system that keeps track of changes not yet committed to the file system's main part by recording the goal of such changes in a data structure known as a "journal", which is usually a circular log. In the event of a system crash or power failure, such file systems can be brought back online more quickly with a lower likelihood of becoming corrupted.
Next3 is a journaling file system for Linux based on ext3 which adds snapshots support, yet retains compatibility to the ext3 on-disk format. Next3 is implemented as open-source software, licensed under the GPL license.
Ext2Fsd is a free Installable File System driver written in C for the Microsoft Windows operating system family. It facilitates read and write access to the ext2, ext3 and ext4 file systems.