man > ext2(5)

๐Ÿ“„ NAME

ext2 - the second extended file system
ext3 - the third extended file system
ext4 - the fourth extended file system

๐Ÿš€ Quick Reference

Use CaseCommandDescription
๐Ÿ“ Create ext4 filesystemmkfs.ext4 /dev/sdXFormat a partition with ext4
๐Ÿ” Check filesysteme2fsck /dev/sdXCheck and repair ext2/3/4 filesystem
๐Ÿ”— Mount with journalingmount -t ext4 -o data=ordered /dev/sdX /mntMount with ordered data journaling (default)
๐Ÿ”’ Set file attributeschattr +i fileMake a file immutable
๐Ÿ“ˆ Resize filesystemresize2fs /dev/sdXGrow or shrink an ext4 filesystem
โš™๏ธ Tune filesystem parameterstune2fs -O quota /dev/sdXEnable quota support
๐Ÿ” Debug filesystemdebugfs /dev/sdXInteractive filesystem debugger
๐Ÿ“‹ List file attributeslsattr fileDisplay file attributes on ext2/3/4
๐Ÿ›ก๏ธ Enable encryptiontune2fs -O encrypt /dev/sdXEnable file-level encryption (ext4)
๐Ÿ“ฆ Enable extended attributestune2fs -O ext_attr /dev/sdXEnable extended attributes support

๐Ÿ“˜ DESCRIPTION

The second, third, and fourth extended file systems, or ext2, ext3, and ext4 as they are commonly known, are Linux file systems that have historically been the default file system for many Linux distributions. They are general purpose file systems that have been designed for extensibility and backwards compatibility. In particular, file systems previously intended for use with the ext2 and ext3 file systems can be mounted using the ext4 file system driver, and indeed in many modern Linux distributions, the ext4 file system driver has been configured to handle mount requests for ext2 and ext3 file systems.

โš™๏ธ FILE SYSTEM FEATURES

A file system formatted for ext2, ext3, or ext4 can have some collection of the following file system feature flags enabled. Some of these features are not supported by all implementations of the ext2, ext3, and ext4 file system drivers, depending on Linux kernel version in use. On other operating systems, such as the GNU/HURD or FreeBSD, only a very restrictive set of file system features may be supported in their implementations of ext2.

๐Ÿ—‚๏ธ 64bit

Enables the file system to be larger than 2^32 blocks. This feature is set automatically, as needed, but it can be useful to specify this feature explicitly if the file system might need to be resized larger than 2^32 blocks, even if it was smaller than that threshold when it was originally created. Note that some older kernels and older versions of e2fsprogs will not support file systems with this ext4 feature enabled.

๐Ÿ—‚๏ธ bigalloc

This ext4 feature enables clustered block allocation, so that the unit of allocation is a power of two number of blocks. That is, each bit in the what had traditionally been known as the block allocation bitmap now indicates whether a cluster is in use or not, where a cluster is by default composed of 16 blocks. This feature can decrease the time spent on doing block allocation and brings smaller fragmentation, especially for large files. The size can be specified using the mke2fs -C option.

โš ๏ธ Warning: The bigalloc feature is still under development, and may not be fully supported with your kernel or may have various bugs. Please see the web page http://ext4.wiki.kernel.org/index.php/Bigalloc for details. May clash with delayed allocation (see nodelalloc mount option).

This feature requires that the extent feature be enabled.

๐Ÿ—‚๏ธ casefold

This ext4 feature provides file system level character encoding support for directories with the casefold (+F) flag enabled. This feature is name-preserving on the disk, but it allows applications to lookup for a file in the file system using an encoding equivalent version of the file name.

๐Ÿ—‚๏ธ dir_index

Use hashed b-trees to speed up name lookups in large directories. This feature is supported by ext3 and ext4 file systems, and is ignored by ext2 file systems.

๐Ÿ—‚๏ธ dir_nlink

Normally, ext4 allows an inode to have no more than 65,000 hard links. This applies to regular files as well as directories, which means that there can be no more than 64,998 subdirectories in a directory (because each of the '.' and '..' entries, as well as the directory entry for the directory in its parent directory counts as a hard link). This feature lifts this limit by causing ext4 to use a link count of 1 to indicate that the number of hard links to a directory is not known when the link count might exceed the maximum count limit.

๐Ÿ—‚๏ธ ea_inode

Normally, a file's extended attributes and associated metadata must fit within the inode or the inode's associated extended attribute block. This feature allows the value of each extended attribute to be placed in the data blocks of a separate inode if necessary, increasing the limit on the size and number of extended attributes per file.

๐Ÿ—‚๏ธ encrypt

Enables support for file-system level encryption of data blocks and file names. The inode metadata (timestamps, file size, user/group ownership, etc.) is not encrypted.

This feature is most useful on file systems with multiple users, or where not all files should be encrypted. In many use cases, especially on single-user systems, encryption at the block device layer using dm-crypt may provide much better security.

๐Ÿ—‚๏ธ ext_attr

This feature enables the use of extended attributes. This feature is supported by ext2, ext3, and ext4.

๐Ÿ—‚๏ธ extent

This ext4 feature allows the mapping of logical block numbers for a particular inode to physical blocks on the storage device to be stored using an extent tree, which is a more efficient data structure than the traditional indirect block scheme used by the ext2 and ext3 file systems. The use of the extent tree decreases metadata block overhead, improves file system performance, and decreases the needed to run e2fsck(8) on the file system. (Note: both extent and extents are accepted as valid names for this feature for historical/backwards compatibility reasons.)

๐Ÿ—‚๏ธ extra_isize

This ext4 feature reserves a specific amount of space in each inode for extended metadata such as nanosecond timestamps and file creation time, even if the current kernel does not currently need to reserve this much space. Without this feature, the kernel will reserve the amount of space for features it currently needs, and the rest may be consumed by extended attributes.

For this feature to be useful the inode size must be 256 bytes in size or larger.

๐Ÿ—‚๏ธ filetype

This feature enables the storage of file type information in directory entries. This feature is supported by ext2, ext3, and ext4.

๐Ÿ—‚๏ธ flex_bg

This ext4 feature allows the per-block group metadata (allocation bitmaps and inode tables) to be placed anywhere on the storage media. In addition, mke2fs will place the per-block group metadata together starting at the first block group of each "flex_bg group". The size of the flex_bg group can be specified using the -G option.

๐Ÿ—‚๏ธ has_journal

Create a journal to ensure file system consistency even across unclean shutdowns. Setting the file system feature is equivalent to using the -j option with mke2fs or tune2fs. This feature is supported by ext3 and ext4, and ignored by the ext2 file system driver.

๐Ÿ—‚๏ธ huge_file

This ext4 feature allows files to be larger than 2 terabytes in size.

๐Ÿ—‚๏ธ inline_data

Allow data to be stored in the inode and extended attribute area.

๐Ÿ—‚๏ธ journal_dev

This feature is enabled on the superblock found on an external journal device. The block size for the external journal must be the same as the file system which uses it.

The external journal device can be used by a file system by specifying the -J device=<external-device> option to mke2fs(8) or tune2fs(8).

๐Ÿ—‚๏ธ large_dir

This feature increases the limit on the number of files per directory by raising the maximum size of directories and, for hashed b-tree directories (see dir_index), the maximum height of the hashed b-tree used to store the directory entries.

๐Ÿ—‚๏ธ large_file

This feature flag is set automatically by modern kernels when a file larger than 2 gigabytes is created. Very old kernels could not handle large files, so this feature flag was used to prohibit those kernels from mounting file systems that they could not understand.

๐Ÿ—‚๏ธ metadata_csum

This ext4 feature enables metadata checksumming. This feature stores checksums for all of the file system metadata (superblock, group descriptor blocks, inode and block bitmaps, directories, and extent tree blocks). The checksum algorithm used for the metadata blocks is different than the one used for group descriptors with the uninit_bg feature. These two features are incompatible and metadata_csum will be used preferentially instead of uninit_bg.

๐Ÿ—‚๏ธ metadata_csum_seed

This feature allows the file system to store the metadata checksum seed in the superblock, which allows the administrator to change the UUID of a file system using the metadata_csum feature while it is mounted.

๐Ÿ—‚๏ธ meta_bg

This ext4 feature allows file systems to be resized on-line without explicitly needing to reserve space for growth in the size of the block group descriptors. This scheme is also used to resize file systems which are larger than 2^32 blocks. It is not recommended that this feature be set when a file system is created, since this alternate method of storing the block group descriptors will slow down the time needed to mount the file system, and newer kernels can automatically set this feature as necessary when doing an online resize and no more reserved space is available in the resize inode.

๐Ÿ—‚๏ธ mmp

This ext4 feature provides multiple mount protection (MMP). MMP helps to protect the file system from being multiply mounted and is useful in shared storage environments.

๐Ÿ—‚๏ธ project

This ext4 feature provides project quota support. With this feature, the project ID of inode will be managed when the file system is mounted.

๐Ÿ—‚๏ธ quota

Create quota inodes (inode #3 for userquota and inode #4 for group quota) and set them in the superblock. With this feature, the quotas will be enabled automatically when the file system is mounted.

Causes the quota files (i.e., user.quota and group.quota which existed in the older quota design) to be hidden inodes.

๐Ÿ—‚๏ธ resize_inode

This file system feature indicates that space has been reserved so that the block group descriptor table can be extended while resizing a mounted file system. The on-line resize operation is carried out by the kernel, triggered by resize2fs(8). By default mke2fs will attempt to reserve enough space so that the file system may grow to 1024 times its initial size. This can be changed using the resize extended option.

This feature requires that the sparse_super or sparse_super2 feature be enabled.

๐Ÿ—‚๏ธ sparse_super

This file system feature is set on all modern ext2, ext3, and ext4 file systems. It indicates that backup copies of the superblock and block group descriptors are present only in a few block groups, not all of them.

๐Ÿ—‚๏ธ sparse_super2

This feature indicates that there will only be at most two backup superblocks and block group descriptors. The block groups used to store the backup superblock(s) and blockgroup descriptor(s) are stored in the superblock, but typically, one will be located at the beginning of block group #1, and one in the last block group in the file system. This feature is essentially a more extreme version of sparse_super and is designed to allow a much larger percentage of the disk to have contiguous blocks available for data files.

๐Ÿ—‚๏ธ stable_inodes

Marks the file system's inode numbers and UUID as stable. resize2fs(8) will not allow shrinking a file system with this feature, nor will tune2fs(8) allow changing its UUID. This feature allows the use of specialized encryption settings that make use of the inode numbers and UUID. Note that the encrypt feature still needs to be enabled separately. stable_inodes is a "compat" feature, so old kernels will allow it.

๐Ÿ—‚๏ธ uninit_bg

This ext4 file system feature indicates that the block group descriptors will be protected using checksums, making it safe for mke2fs(8) to create a file system without initializing all of the block groups. The kernel will keep a high watermark of unused inodes, and initialize inode tables and blocks lazily. This feature speeds up the time to check the file system using e2fsck(8), and it also speeds up the time required for mke2fs(8) to create the file system.

๐Ÿ—‚๏ธ verity

Enables support for verity protected files. Verity files are readonly, and their data is transparently verified against a Merkle tree hidden past the end of the file. Using the Merkle tree's root hash, a verity file can be efficiently authenticated, independent of the file's size.

This feature is most useful for authenticating important read-only files on read-write file systems. If the file system itself is read-only, then using dm-verity to authenticate the entire block device may provide much better security.

๐Ÿ”ง MOUNT OPTIONS

This section describes mount options which are specific to ext2, ext3, and ext4. Other generic mount options may be used as well; see mount(8) for details.

๐Ÿ“ฆ Mount options for ext2

The `ext2' file system is the standard Linux file system. Since Linux 2.5.46, for most mount options the default is determined by the file system superblock. Set them with tune2fs(8).

% mount /k -o minixdf; df /k; umount /k

File System  1024-blocks   Used  Available  Capacity  Mounted on
/dev/sda6      2630655    86954   2412169      3%     /k

% mount /k -o bsddf; df /k; umount /k

File System  1024-blocks  Used  Available  Capacity  Mounted on
/dev/sda6      2543714      13   2412169      0%     /k

(Note that this example shows that one can add command line options to the options given in /etc/fstab.)

Additional backup superblocks can be determined by using the mke2fs program using the -n option to print out where the superblocks exist, supposing mke2fs is supplied with arguments that are consistent with the file system's layout (e.g. blocksize, blocks per group, sparse_super, etc.).

๐Ÿ“ฆ Mount options for ext3

The ext3 file system is a version of the ext2 file system which has been enhanced with journaling. It supports the same options as ext2 as well as the following additions:

๐Ÿ“ฆ Mount options for ext4

The ext4 file system is an advanced level of the ext3 file system which incorporates scalability and reliability enhancements for supporting large file system.

The options journal_dev, journal_path, norecovery, noload, data, commit, orlov, oldalloc, [no]user_xattr, [no]acl, bsddf, minixdf, debug, errors, data_err, grpid, bsdgroups, nogrpid, sysvgroups, resgid, resuid, sb, quota, noquota, nouid32, grpquota, usrquota, usrjquota, grpjquota, and jqfmt are backwardly compatible with ext3 or ext2.

fd = open("foo.new")/write(fd,...)/close(fd)/ rename("foo.new", "foo")

or worse yet

fd = open("foo", O_TRUNC)/write(fd,...)/close(fd).

If auto_da_alloc is enabled, ext4 will detect the replace-via-rename and replace-via-truncate patterns and force that any delayed allocation blocks are allocated such that at the next journal commit, in the default data=ordered mode, the data blocks of the new file are forced to disk before the rename() operation is committed. This provides roughly the same level of guarantees as ext3, and avoids the "zero-length" problem that can happen when a system crashes before the delayed allocation blocks are forced to disk.

๐Ÿท๏ธ FILE ATTRIBUTES

The ext2, ext3, and ext4 file systems support setting the following file attributes on Linux systems using the chattr(1) utility:

In addition, the ext3 and ext4 file systems support the following flag:

Finally, the ext4 file system also supports the following flag:

For descriptions of these attribute flags, please refer to the chattr(1) man page.

๐Ÿง KERNEL SUPPORT

This section lists the file system driver (e.g., ext2, ext3, ext4) and upstream kernel version where a particular file system feature was supported. Note that in some cases the feature was present in earlier kernel versions, but there were known, serious bugs. In other cases the feature may still be considered in an experimental state. Finally, note that some distributions may have backported features into older kernels; in particular the kernel versions in certain "enterprise distributions" can be extremely misleading.

๐Ÿ“š SEE ALSO

mke2fs(8), mke2fs.conf(5), e2fsck(8), dumpe2fs(8), tune2fs(8), debugfs(8), mount(8), chattr(1)

ext2(5)
๐Ÿ“„ NAME ๐Ÿš€ Quick Reference ๐Ÿ“˜ DESCRIPTION โš™๏ธ FILE SYSTEM FEATURES
๐Ÿ—‚๏ธ 64bit ๐Ÿ—‚๏ธ bigalloc ๐Ÿ—‚๏ธ casefold ๐Ÿ—‚๏ธ dir_index ๐Ÿ—‚๏ธ dir_nlink ๐Ÿ—‚๏ธ ea_inode ๐Ÿ—‚๏ธ encrypt ๐Ÿ—‚๏ธ ext_attr ๐Ÿ—‚๏ธ extent ๐Ÿ—‚๏ธ extra_isize ๐Ÿ—‚๏ธ filetype ๐Ÿ—‚๏ธ flex_bg ๐Ÿ—‚๏ธ has_journal ๐Ÿ—‚๏ธ huge_file ๐Ÿ—‚๏ธ inline_data ๐Ÿ—‚๏ธ journal_dev ๐Ÿ—‚๏ธ large_dir ๐Ÿ—‚๏ธ large_file ๐Ÿ—‚๏ธ metadata_csum ๐Ÿ—‚๏ธ metadata_csum_seed ๐Ÿ—‚๏ธ meta_bg ๐Ÿ—‚๏ธ mmp ๐Ÿ—‚๏ธ project ๐Ÿ—‚๏ธ quota ๐Ÿ—‚๏ธ resize_inode ๐Ÿ—‚๏ธ sparse_super ๐Ÿ—‚๏ธ sparse_super2 ๐Ÿ—‚๏ธ stable_inodes ๐Ÿ—‚๏ธ uninit_bg ๐Ÿ—‚๏ธ verity
๐Ÿ”ง MOUNT OPTIONS
๐Ÿ“ฆ Mount options for ext2 ๐Ÿ“ฆ Mount options for ext3 ๐Ÿ“ฆ Mount options for ext4
๐Ÿท๏ธ FILE ATTRIBUTES ๐Ÿง KERNEL SUPPORT ๐Ÿ“š SEE ALSO

Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-16 00:34 @216.73.216.115
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!

^_top_^