Sortix main manual
This manual documents Sortix main. You can instead view this document in the latest official manual.
EXT4(5) | File Formats Manual | EXT4(5) |
NAME
ext2 - the second extended file systemDESCRIPTION
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
-
- bigalloc
-
- 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
-
- dir_index
-
- dir_nlink
-
- ea_inode
-
- encrypt
-
- 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
-
- extent
-
- extra_isize
-
- filetype
-
- flex_bg
-
- has_journal
-
- huge_file
-
- inline_data
- Allow data to be stored in the inode and extended attribute area.
- journal_dev
-
- 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
-
- large_file
-
- metadata_csum
-
- metadata_csum_seed
-
- meta_bg
-
- mmp
-
- project
-
- quota
-
- 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 feature requires that the sparse_super or sparse_super2 feature be enabled.
- sparse_super
-
- sparse_super2
-
- stable_inodes
-
- uninit_bg
-
- verity
-
- 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).- acl|noacl
- Support POSIX Access Control Lists (or not). See the acl(5) manual page.
- bsddf|minixdf
-
Set the behavior for the statfs system call. The minixdf behavior is to return in the f_blocks field the total number of blocks of the file system, while the bsddf behavior (which is the default) is to subtract the overhead blocks used by the ext2 file system and not available for file storage. Thus
File System 1024-blocks Used Available Capacity Mounted on /dev/sda6 2630655 86954 2412169 3% /k File System 1024-blocks Used Available Capacity Mounted on /dev/sda6 2543714 13 2412169 0% /k
- check=none or nocheck
- No checking is done at mount time. This is the default. This is fast. It is wise to invoke e2fsck(8) every now and then, e.g. at boot time. The non-default behavior is unsupported (check=normal and check=strict options have been removed). Note that these mount options don't have to be supported if ext4 kernel driver is used for ext2 and ext3 file systems.
- debug
- Print debugging info upon each (re)mount.
- errors={continue|remount-ro|panic}
- Define the behavior when an error is encountered. (Either ignore errors and just mark the file system erroneous and continue, or remount the file system read-only, or panic and halt the system.) The default is set in the file system superblock, and can be changed using tune2fs(8).
- grpid|bsdgroups and nogrpid|sysvgroups
- These options define what group id a newly created file gets. When grpid is set, it takes the group id of the directory in which it is created; otherwise (the default) it takes the fsgid of the current process, unless the directory has the setgid bit set, in which case it takes the gid from the parent directory, and also gets the setgid bit set if it is a directory itself.
- grpquota|noquota|quota|usrquota
- The usrquota (same as quota) mount option enables user quota support on the file system. grpquota enables group quotas support. You need the quota utilities to actually enable and manage the quota system.
- nouid32
- Disables 32-bit UIDs and GIDs. This is for interoperability with older kernels which only store and expect 16-bit values.
- oldalloc or orlov
- Use old allocator or Orlov allocator for new inodes. Orlov is default.
- resgid=,n and resuid=,n
- The ext2 file system reserves a certain percentage of the available space (by default 5%, see mke2fs(8) and tune2fs(8)). These options determine who can use the reserved blocks. (Roughly: whoever has the specified uid, or belongs to the specified group.)
- sb=n
- Instead of using the normal superblock, use an alternative superblock specified by n. This option is normally used when the primary superblock has been corrupted. The location of backup superblocks is dependent on the file system's blocksize, the number of blocks per group, and features such as sparse_super.
- 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.).
- The block number here uses 1 k units. Thus, if you want to use logical block 32768 on a file system with 4 k blocks, use "sb=131072".
- user_xattr|nouser_xattr
-
Support "user." extended attributes (or not).
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:- journal_dev=devnum/journal_path=path
- When the external journal device's major/minor numbers have changed, these options allow the user to specify the new journal location. The journal device is identified either through its new major/minor numbers encoded in devnum, or via a path to the device.
- norecovery/noload
- Don't load the journal on mounting. Note that if the file system was not unmounted cleanly, skipping the journal replay will lead to the file system containing inconsistencies that can lead to any number of problems.
- data={journal|ordered|writeback}
- Specifies the journaling mode for file data. Metadata is always journaled. To use modes other than ordered on the root file system, pass the mode to the kernel as boot parameter, e.g. rootflags=data=journal.
- journal
- All data is committed into the journal prior to being written into the main file system.
- ordered
- This is the default mode. All data is forced directly out to the main file system prior to its metadata being committed to the journal.
- writeback
- Data ordering is not preserved – data may be written into the main file system after its metadata has been committed to the journal. This is rumoured to be the highest-throughput option. It guarantees internal file system integrity, however it can allow old data to appear in files after a crash and journal recovery.
- data_err=ignore
- Just print an error message if an error occurs in a file data buffer in ordered mode.
- data_err=abort
- Abort the journal if an error occurs in a file data buffer in ordered mode.
-
barrier=0 / barrier=1
- This disables / enables the use of write barriers in the jbd code. barrier=0 disables, barrier=1 enables (default). This also requires an IO stack which can support barriers, and if jbd gets an error on a barrier write, it will disable barriers again with a warning. Write barriers enforce proper on-disk ordering of journal commits, making volatile disk write caches safe to use, at some performance penalty. If your disks are battery-backed in one way or another, disabling barriers may safely improve performance.
- commit=nrsec
- Start a journal commit every nrsec seconds. The default value is 5 seconds. Zero means default.
- user_xattr
- Enable Extended User Attributes. See the attr(5) manual page.
- jqfmt={vfsold|vfsv0|vfsv1}
- Apart from the old quota system (as in ext2, jqfmt=vfsold aka version 1 quota) ext3 also supports journaled quotas (version 2 quota). jqfmt=vfsv0 or jqfmt=vfsv1 enables journaled quotas. Journaled quotas have the advantage that even after a crash no quota check is required. When the quota file system feature is enabled, journaled quotas are used automatically, and this mount option is ignored.
- usrjquota=aquota.user|grpjquota=aquota.group
-
For journaled quotas (jqfmt=vfsv0 or jqfmt=vfsv1), the mount options usrjquota=aquota.user and grpjquota=aquota.group are required to tell the quota system which quota database files to use. When the quota file system feature is enabled, journaled quotas are used automatically, and this mount option is ignored.
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.- journal_checksum | nojournal_checksum
- The journal_checksum option enables checksumming of the journal transactions. This will allow the recovery code in e2fsck and the kernel to detect corruption in the kernel. It is a compatible change and will be ignored by older kernels.
- journal_async_commit
- Commit block can be written to disk without waiting for descriptor blocks. If enabled older kernels cannot mount the device. This will enable 'journal_checksum' internally.
- barrier=0 / barrier=1 / barrier / nobarrier
-
These mount options have the same effect as in ext3. The mount options "barrier" and "nobarrier" are added for consistency with other ext4 mount options.
- inode_readahead_blks=n
- This tuning parameter controls the maximum number of inode table blocks that ext4's inode table readahead algorithm will pre-read into the buffer cache. The value must be a power of 2. The default value is 32 blocks.
- stripe=n
- Number of file system blocks that mballoc will try to use for allocation size and alignment. For RAID5/6 systems this should be the number of data disks * RAID chunk size in file system blocks.
- delalloc
- Deferring block allocation until write-out time.
- nodelalloc
- Disable delayed allocation. Blocks are allocated when data is copied from user to page cache.
- max_batch_time=usec
- Maximum amount of time ext4 should wait for additional file system operations to be batch together with a synchronous write operation. Since a synchronous write operation is going to force a commit and then a wait for the I/O complete, it doesn't cost much, and can be a huge throughput win, we wait for a small amount of time to see if any other transactions can piggyback on the synchronous write. The algorithm used is designed to automatically tune for the speed of the disk, by measuring the amount of time (on average) that it takes to finish committing a transaction. Call this time the "commit time". If the time that the transaction has been running is less than the commit time, ext4 will try sleeping for the commit time to see if other operations will join the transaction. The commit time is capped by the max_batch_time, which defaults to 15000 µs (15 ms). This optimization can be turned off entirely by setting max_batch_time to 0.
- min_batch_time=usec
- This parameter sets the commit time (as described above) to be at least min_batch_time. It defaults to zero microseconds. Increasing this parameter may improve the throughput of multi-threaded, synchronous workloads on very fast disks, at the cost of increasing latency.
- journal_ioprio=prio
- The I/O priority (from 0 to 7, where 0 is the highest priority) which should be used for I/O operations submitted by kjournald2 during a commit operation. This defaults to 3, which is a slightly higher priority than the default I/O priority.
- abort
- Simulate the effects of calling ext4_abort() for debugging purposes. This is normally used while remounting a file system which is already mounted.
- auto_da_alloc|noauto_da_alloc
-
Many broken applications don't use fsync() when replacing existing files via patterns such as
- noinit_itable
- Do not initialize any uninitialized inode table blocks in the background. This feature may be used by installation CD's so that the install process can complete as quickly as possible; the inode table initialization process would then be deferred until the next time the file system is mounted.
- init_itable=n
- The lazy itable init code will wait n times the number of milliseconds it took to zero out the previous block group's inode table. This minimizes the impact on system performance while the file system's inode table is being initialized.
- discard/nodiscard
- Controls whether ext4 should issue discard/TRIM commands to the underlying block device when blocks are freed. This is useful for SSD devices and sparse/thinly-provisioned LUNs, but it is off by default until sufficient testing has been done.
- block_validity/noblock_validity
- This option enables/disables the in-kernel facility for tracking file system metadata blocks within internal data structures. This allows multi-block allocator and other routines to quickly locate extents which might overlap with file system metadata blocks. This option is intended for debugging purposes and since it negatively affects the performance, it is off by default.
- dioread_lock/dioread_nolock
- Controls whether or not ext4 should use the DIO read locking. If the dioread_nolock option is specified ext4 will allocate uninitialized extent before buffer write and convert the extent to initialized after IO completes. This approach allows ext4 code to avoid using inode mutex, which improves scalability on high speed storages. However this does not work with data journaling and dioread_nolock option will be ignored with kernel warning. Note that dioread_nolock code path is only used for extent-based files. Because of the restrictions this options comprises it is off by default (e.g. dioread_lock).
- max_dir_size_kb=n
- This limits the size of the directories so that any attempt to expand them beyond the specified limit in kilobytes will cause an ENOSPC error. This is useful in memory-constrained environments, where a very large directory can cause severe performance problems or even provoke the Out Of Memory killer. (For example, if there is only 512 MB memory available, a 176 MB directory may seriously cramp the system's style.)
- i_version
- Enable 64-bit inode version support. This option is off by default.
- nombcache
- This option disables use of mbcache for extended attribute deduplication. On systems where extended attributes are rarely or never shared between files, use of mbcache for deduplication adds unnecessary computational overhead.
- prjquota
-
The prjquota mount option enables project quota support on the file system. You need the quota utilities to actually enable and manage the quota system. This mount option requires the project file system feature.
FILE ATTRIBUTES
The ext2, ext3, and ext4 file systems support setting the following file attributes on Linux systems using the chattr(1) utility: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.- filetype
- ext2, 2.2.0
- sparse_super
- ext2, 2.2.0
- large_file
- ext2, 2.2.0
- has_journal
- ext3, 2.4.15
- ext_attr
- ext2/ext3, 2.6.0
- dir_index
- ext3, 2.6.0
- resize_inode
- ext3, 2.6.10 (online resizing)
- 64bit
- ext4, 2.6.28
- dir_nlink
- ext4, 2.6.28
- extent
- ext4, 2.6.28
- extra_isize
- ext4, 2.6.28
- flex_bg
- ext4, 2.6.28
- huge_file
- ext4, 2.6.28
- meta_bg
- ext4, 2.6.28
- uninit_bg
- ext4, 2.6.28
- mmp
- ext4, 3.0
- bigalloc
- ext4, 3.2
- quota
- ext4, 3.6
- inline_data
- ext4, 3.8
- sparse_super2
- ext4, 3.16
- metadata_csum
- ext4, 3.18
- encrypt
- ext4, 4.1
- metadata_csum_seed
- ext4, 4.4
- project
- ext4, 4.5
- ea_inode
- ext4, 4.13
- large_dir
- ext4, 4.13
- casefold
- ext4, 5.2
- verity
- ext4, 5.4
- stable_inodes
- ext4, 5.5
SEE ALSO
mke2fs(8), mke2fs.conf(5), e2fsck(8), dumpe2fs(8), tune2fs(8), debugfs(8), mount(8), chattr(1)December 2021 | E2fsprogs version 1.46.5 |