ext4 is the default file system for many Linux distributions including Debian and Ubuntu.9
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 advancement, 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".30 Btrfs also has "a number of the same design ideas that reiser3/4 had".31 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.32
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:33
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.34
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.35
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.36
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,37 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.38394041 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.42
Paragon Software offers commercial products that provide full read/write access for ext2/3/4 – Linux File Systems for Windows43 and extFS for Mac.44
The free software ext4fuse provides limited (read-only) support.
The ext4 filesystem divides the partition it resides into smaller chunks called blocks (a group of sectors, usually between 1KiB and 64 KiB). By default, the block size is the same as the page size (4 KiB), but it can be configured with mkfs during filesystem creation. Blocks are grouped into larger chunks called block groups.
Main article: Superblock (file system)
This is the heart of the filesystem; it resides in only one block of the disk.45 It is usually the first item in a block group, except for group 0, where the first few bytes are reserved for the boot sector. The Superblock is vital for the filesystem – as such, backup copies are written across partitions at filesystem creation time, so it can be recovered in case of corruption.
GDT comes in second after superblock. GDT stores block group descriptors of each block group on the filesystem. It resides on more than one block on disk. Each GDT is 64 bytes in size. This structure is also vital for the filesystem; as such, redundant backups are stored across the filesystem.
The Block bitmap tracks the block usage status of all blocks of a block group. Each bit in the bitmap represents a block. If a block is in use, its corresponding bit will be set, otherwise it will be unset. The location of the block bitmap is not fixed, so its position is stored in respective block group descriptors.
Similar to the Block bitmap, the Inode bitmap's location is also not fixed, therefore the group descriptor points to the location of the Inode bitmap. The Inode bitmap tracks usage of inodes. Each bit in the bitmap represents an inode. If an inode is in use then its corresponding bit in Inode bitmap will be set, otherwise it will be unset.
Each block group is represented by its block group descriptor. It has vital information for the block group like free inodes, free blocks and the location of inode bitmap, block bitmap and the inode table of that particular block group.
Ext4 introduced flexible block groups. In flex_bg, several block groups are grouped into one logical block group. Block bitmap and inode bitmap of first block group are expanded to include the bitmap and the inode table of other block groups.
Mathur, Avantika; Cao, MingMing; Bhattacharya, Suparna; Dilger, Andreas; Zhuravlev (Tomas), Alex; Vivier, Laurent (2007). "The new ext4 filesystem: current status and future plans" (PDF). Proceedings of the Linux Symposium. Ottawa, ON, CA: Red Hat. Archived from the original (PDF) on 6 July 2010. Retrieved 15 January 2008. /wiki/Suparna_Bhattacharya ↩
Torvalds, Linus (9 June 2006). "extents and 48bit ext3". Linux kernel mailing list. https://lkml.org/lkml/2006/6/9/183 ↩
Ts'o, Theodore (28 June 2006). "Proposal and plan for ext2/3 future development work". Linux kernel mailing list. https://lkml.org/lkml/2006/6/28/454 ↩
Leemhuis, Thorsten (23 December 2008). "Higher and further: The innovations of Linux 2.6.28 (page 2)". Heise Online. Archived from the original on 3 January 2009. Retrieved 9 January 2010. https://web.archive.org/web/20090103164710/http://www.heise-online.co.uk/open/Kernel-Log-Higher-and-Further-The-innovations-of-Linux-2-6-28--/features/112299 ↩
"ext4: Rename ext4dev to ext4". Linus' kernel tree. Archived from the original on 29 May 2012. Retrieved 20 October 2008. https://archive.today/20120529150649/http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=03010a3350301baac2154fa66de925ae2981b7e3 ↩
Leemhuis, Thorsten (23 December 2008). "Higher and further: The innovations of Linux 2.6.28". Heise Online. http://www.heise-online.co.uk/open/Kernel-Log-Higher-and-Further-The-innovations-of-Linux-2-6-28--/features/112299 ↩
Paul, Ryan (15 January 2010). "Google upgrading to Ext4, hires former Linux Foundation CTO". Ars Technica. https://arstechnica.com/open-source/news/2010/01/google-upgrading-to-ext4-hires-former-linux-foundation-cto.ars ↩
"Android 2.3 Gingerbread to use Ext4 file system". The H Open. 14 December 2010. http://www.h-online.com/open/news/item/Android-2-3-Gingerbread-to-use-Ext4-file-system-1152775.html ↩
"FileSystem in debian". 14 September 2019. https://wiki.debian.org/FileSystem ↩
"ext4 – High Level Design". kernel.org. Retrieved 8 December 2023. https://www.kernel.org/doc/html/v6.1/filesystems/ext4/overview.html#blocks ↩
Pomeranz, Hal (28 March 2011). "Understanding EXT4 (Part 3): Extent Trees". SANS Digital Forensics and Incident Response Blog. Archived from the original on 18 August 2019. https://web.archive.org/web/20190818050155/https://digital-forensics.sans.org/blog/2011/03/28/digital-forensics-understanding-ext4-part-3-extent-trees ↩
"Anatomy of ext4". IMB Developer. Retrieved 27 May 2024. https://developer.ibm.com/tutorials/l-anatomy-ext4 ↩
"Mount of ext4 (created without extents) as ext3 fails on RH6.2". www.linuxquestions.org. Archived from the original on 5 August 2023. Retrieved 8 December 2023. http://www.linuxquestions.org/questions/red-hat-31/mount-of-ext4-created-without-extents-as-ext3-fails-on-rh6-2-a-936813/ ↩
"2. High Level Design — The Linux Kernel documentation". docs.kernel.org. Retrieved 9 January 2025. https://docs.kernel.org/filesystems/ext4/overview.html#block-and-inode-allocation-policy ↩
"Ext4 – Linux Kernel Newbies". kernelnewbies.org. https://kernelnewbies.org/Ext4 ↩
"New ext4 features – Ext4". ext4.wiki.kernel.org. Archived from the original on 23 September 2023. Retrieved 8 December 2023. https://ext4.wiki.kernel.org/index.php/New_ext4_features#Metadata_Checksums ↩
Prabhakaran, Vijayan; Bairavasundaram, Lakshmi N.; Agrawal, Nitin; Gunawi, Haryadi S.; Arpaci-Dusseau, Andrea C.; Arpaci-Dusseau, Remzi H. (October 2005). IRON File Systems (PDF). Symposium on Operating Systems Principles (SOSP '05). Brighton, United Kingdom: CS Dept, University of Wisconsin. Section 6.1, Paragraph 5 "Transactional Checksums". Retrieved 8 December 2023. http://www.cs.wisc.edu/wind/Publications/iron-sosp05.pdf ↩
"Ext4 Metadata Checksums – Ext4". ext4.wiki.kernel.org. Archived from the original on 6 November 2023. Retrieved 8 December 2023. https://ext4.wiki.kernel.org/index.php/Ext4_Metadata_Checksums ↩
"Linux_3.5 – Linux Kernel Newbies". kernelnewbies.org. https://kernelnewbies.org/Linux_3.5?highlight=(Metadata)%7C(checksumming) ↩
"2. High Level Design". The Linux Kernel documentation. Retrieved 3 April 2025. https://docs.kernel.org/filesystems/ext4/overview.html#checksums ↩
"ext4: Fix handling of extended tv_sec". Linux-stable kernel tree. Retrieved 14 February 2017. https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=a4dad1ae24f850410c4e60f22823cba1289b8d52 ↩
Ts'o, Theodore (5 October 2006). "Re: creation time stamps for ext4 ?". https://www.redhat.com/archives/ext3-users/2006-October/msg00015.html ↩
Edge, Jake (31 March 2017). "Extending statx()". Archived from the original on 20 September 2023. Retrieved 8 December 2023. https://lwn.net/Articles/718222/ ↩
Li, Xi (12 January 2016). "ext4: add project quota support" (Mailing list). Archived from the original on 20 September 2023. Retrieved 8 December 2023. https://lwn.net/Articles/671627/ ↩
Ts'o, Theodore (8 April 2015). "Ext4 encryption". Archived from the original on 12 October 2023. Retrieved 8 December 2023. https://lwn.net/Articles/639427/ ↩
"Ext4 Filesystem". Thomas-Krenn-Wiki. Archived from the original on 14 February 2022. Retrieved 8 December 2023. https://www.thomas-krenn.com/en/wiki/Ext4_Filesystem ↩
"kernel/git/torvalds/linux.git – Linux kernel source tree". git.kernel.org. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bfff68738f1cb5c93dab1114634cea02aae9e7ba ↩
"Ext4 –". ArchWiki. https://wiki.archlinux.org/index.php/ext4#Turning_barriers_off ↩
Paul, Ryan (14 April 2009). "Panelists ponder the kernel at Linux Collaboration Summit". Ars Technica. Retrieved 22 August 2009. https://arstechnica.com/information-technology/2009/04/linux-collaboration-summit-the-kernel-panel/ ↩
Theodore Ts'o (1 August 2008). "Re: reiser4 for 2.6.27-rc1". linux-kernel (Mailing list). Retrieved 31 December 2010. https://lkml.org/lkml/2008/8/1/217 ↩
Corbet, Jonathan (11 October 2011). "Securely deleting files from ext4 filesystems". https://lwn.net/Articles/462437/ ↩
"ext4 documentation in Linux kernel source". 28 March 2009. https://www.kernel.org/doc/Documentation/filesystems/ext4.txt ↩
Ubuntu bug #317781 Long discussion between Ubuntu developers and Theodore Ts'o on potential data loss https://bugs.launchpad.net/ubuntu/+source/linux/+bug/317781?comments=all ↩
Thoughts by Ted blog entry, 12 March 2009 A blog posting of Theodore Ts'o on the subject http://thunk.org/tytso/blog/2009/03/12/delayed-allocation-and-the-zero-length-file-problem/ ↩
Kleiman ↩
Brandon LeBlanc (10 September 2020). "Announcing Windows 10 Insider Preview Build 20211". Windows Blogs. Retrieved 25 May 2021. https://blogs.windows.com/windows-insider/2020/09/10/announcing-windows-10-insider-preview-build-20211/ ↩
Pierre Boulay (10 September 2020). "Access Linux filesystems in Windows and WSL 2". Windows Command Line. Retrieved 25 May 2021. https://devblogs.microsoft.com/commandline/access-linux-filesystems-in-windows-and-wsl-2/ ↩
"Get started mounting a Linux disk in WSL 2". Microsoft Docs. Retrieved 25 May 2021. https://docs.microsoft.com/en-gb/windows/wsl/wsl2-mount-disk ↩
Craig Loewen (12 June 2019). "WSL 2 is now available in Windows Insiders". Windows Command Line. Retrieved 25 May 2021. https://devblogs.microsoft.com/commandline/wsl-2-is-now-available-in-windows-insiders/ ↩
"Windows Subsystem for Linux Installation Guide for Windows 10". Windows Docs. Retrieved 25 May 2021. https://docs.microsoft.com/en-gb/windows/wsl/install-win10 ↩
"Linux File Systems for Windows". Paragon Software. Retrieved 25 May 2021. https://www.paragon-software.com/home/linuxfs-windows/ ↩
"extFS for Mac". Paragon Software. Retrieved 25 May 2021. https://www.paragon-software.com/home/extfs-mac/ ↩
https://docs.kernel.org/filesystems/ext4/overview.html#layout https://docs.kernel.org/filesystems/ext4/overview.html#layout ↩