# man > ext4(5)

---
type: CommandReference
command: ext4
mode: man
section: 5
source: man-pages
---

## Quick Reference

- `mke2fs -t ext4 /dev/sda1` — create an ext4 filesystem
- `mount -t ext4 -o data=ordered /dev/sda1 /mnt` — mount with ordered journaling mode
- `tune2fs -j /dev/sda1` — enable journal on an ext2 filesystem
- `tune2fs -O ext_attr /dev/sda1` — enable extended attributes
- `mount -t ext4 -o noatime /dev/sda1 /mnt` — mount with noatime
- `e2fsck /dev/sda1` — check filesystem consistency
- `resize2fs /dev/sda1 10G` — resize filesystem to 10 GB
- `chattr +i file` — make a file immutable

## Name

ext2, ext3, ext4 — the second, third, and fourth extended file systems for Linux.

## Synopsis

The ext4 filesystem driver is used by the `mount` command and managed by utilities like `mke2fs`, `tune2fs`, `e2fsck`, `resize2fs`, and `chattr`.  
Mount syntax: `mount -t ext4 [options] device mountpoint`  
Create syntax: `mke2fs -t ext4 [options] device`

## Options

### File System Features

Features are enabled via `mke2fs -O` or `tune2fs -O`. Kernel version indicates first stable support.

- `64bit` — allow filesystem > 2^32 blocks (ext4, 2.6.28)
- `bigalloc` — clustered block allocation (ext4, 3.2; experimental, requires `extent`)
- `casefold` — case-insensitive directory lookups (ext4, 5.2)
- `dir_index` — hashed b-tree directories for fast lookups (ext3, 2.6.0; ignored by ext2)
- `dir_nlink` — unlimited hard links for directories (ext4, 2.6.28)
- `ea_inode` — store extended attributes in separate inodes (ext4, 4.13)
- `encrypt` — per-file encryption of data and names (ext4, 4.1; metadata not encrypted)
- `ext_attr` — extended attributes (ext2/ext3, 2.6.0)
- `extent` — extent tree for efficient block mapping (ext4, 2.6.28)
- `extra_isize` — reserve space in inodes for extended metadata (ext4, 2.6.28; requires inode size >= 256)
- `filetype` — store file type in directory entries (ext2, 2.2.0)
- `flex_bg` — flexible block group placement (ext4, 2.6.28)
- `has_journal` — create a journal (ext3, 2.4.15)
- `huge_file` — allow files > 2 TB (ext4, 2.6.28)
- `inline_data` — store small data in inode (ext4, 3.8)
- `journal_dev` — external journal device (requires matching block size)
- `large_dir` — increase max files per directory (ext4, 4.13)
- `large_file` — automatically set for files > 2 GB (ext2, 2.2.0)
- `metadata_csum` — checksums for all metadata (ext4, 3.18; incompatible with `uninit_bg`)
- `metadata_csum_seed` — store checksum seed in superblock (ext4, 4.4)
- `meta_bg` — online resize without reserved space (ext4, 2.6.28; slows mount)
- `mmp` — multiple mount protection (ext4, 3.0)
- `project` — project quota support (ext4, 4.5)
- `quota` — create quota inodes (ext4, 3.6)
- `resize_inode` — reserve space for online resize (ext3, 2.6.10; requires `sparse_super` or `sparse_super2`)
- `sparse_super` — backup superblocks only in some block groups (ext2, 2.2.0)
- `sparse_super2` — only two backup superblocks (ext4, 3.16)
- `stable_inodes` — inode numbers and UUID are stable (ext4, 5.5)
- `uninit_bg` — lazy initialization of block groups, protected by checksums (ext4, 2.6.28)
- `verity` — transparent integrity verification via Merkle tree (ext4, 5.4)

### Mount Options for ext2

- `acl` / `noacl` — POSIX ACL support
- `bsddf` / `minixdf` — statfs reporting style (default bsddf)
- `check=none` / `nocheck` — no fsck at mount (default)
- `debug` — print debugging info on remount
- `errors=continue|remount-ro|panic` — behavior on error (default set in superblock)
- `grpid` / `bsdgroups` and `nogrpid` / `sysvgroups` — group ID assignment for new files
- `grpquota` / `noquota` / `quota` / `usrquota` — enable quota support
- `nouid32` — disable 32-bit UIDs/GIDs
- `oldalloc` / `orlov` — inode allocation strategy (orlov is default)
- `resgid=n` / `resuid=n` — allow reserved blocks to specific user/group
- `sb=n` — use alternative superblock (e.g., after corruption)
- `user_xattr` / `nouser_xattr` — extended user attributes

### Mount Options for ext3

In addition to ext2 options:

- `journal_dev=devnum` / `journal_path=path` — specify external journal device
- `norecovery` / `noload` — skip journal replay (dangerous)
- `data=journal|ordered|writeback` — journaling mode (default ordered)
- `data_err=ignore|abort` — action on data buffer error in ordered mode
- `barrier=0` / `barrier=1` — write barriers (default on)
- `commit=nrsec` — journal commit interval (default 5 seconds)
- `jqfmt=vfsold|vfsv0|vfsv1` — quota format (journaled quotas with vfsv0/vfsv1)
- `usrjquota=file` / `grpjquota=file` — quota database files (ignored if `quota` feature enabled)

### Mount Options for ext4

In addition to ext3 options:

- `journal_checksum` / `nojournal_checksum` — checksum journal transactions
- `journal_async_commit` — commit block without waiting for descriptors (implies journal_checksum)
- `barrier` / `nobarrier` — same as ext3 barrier options (default on)
- `inode_readahead_blks=n` — inode table readahead (power of 2, default 32)
- `stripe=n` — RAID stripe size in filesystem blocks
- `delalloc` — defer block allocation until write-out (default on)
- `nodelalloc` — disable delayed allocation
- `max_batch_time=usec` — max time to batch sync writes (default 15000 µs)
- `min_batch_time=usec` — commit time minimum (default 0)
- `journal_ioprio=prio` — I/O priority for kjournald2 (0-7, default 3)
- `abort` — simulate ext4_abort() for debugging
- `auto_da_alloc` / `noauto_da_alloc` — detect replace-via-rename patterns and force allocation before commit
- `noinit_itable` — skip background inode table initialization
- `init_itable=n` — wait multiplier for lazy inode init (n times previous zeroing time)
- `discard` / `nodiscard` — issue TRIM on free (default off)
- `block_validity` / `noblock_validity` — track metadata blocks for debugging (default off)
- `dioread_lock` / `dioread_nolock` — DIO read locking (dioread_lock default)
- `max_dir_size_kb=n` — limit directory size (prevents ENOSPC on large dirs)
- `i_version` — enable 64-bit inode version (default off)
- `nombcache` — disable extended attribute deduplication cache
- `prjquota` — enable project quota (requires `project` feature)

### File Attributes

Set via `chattr`:

- `a` — append only
- `A` — no atime updates
- `d` — no dump
- `D` — synchronous directory updates
- `i` — immutable
- `S` — synchronous updates
- `u` — undeletable
- `j` — data journaling (ext3/ext4 only)
- `e` — extents format (ext4 only)

## Examples

**bsddf vs minixdf (statfs behavior):**

shell
# With minixdf (includes overhead blocks)
mount /k -o minixdf
df /k
# Output: Filesystem  1024-blocks   Used  Available  Capacity  Mounted on
#         /dev/sda6      2630655    86954   2412169      3%     /k

# With bsddf (subtracts overhead, default)
mount /k -o bsddf
df /k
# Output: Filesystem  1024-blocks   Used  Available  Capacity  Mounted on
#         /dev/sda6      2543714      13   2412169      0%     /k
**Mount with data=ordered and noatime:**

shell
mount -t ext4 -o data=ordered,noatime /dev/sda1 /mnt
**Enable journal on an existing ext2 filesystem:**

shell
tune2fs -j /dev/sda1
## See Also

- [mke2fs(8)](http://localhost/phpMan.php/man/mke2fs/8/markdown)
- [mke2fs.conf(5)](http://localhost/phpMan.php/man/mke2fs.conf/5/markdown)
- [e2fsck(8)](http://localhost/phpMan.php/man/e2fsck/8/markdown)
- [dumpe2fs(8)](http://localhost/phpMan.php/man/dumpe2fs/8/markdown)
- [tune2fs(8)](http://localhost/phpMan.php/man/tune2fs/8/markdown)
- [debugfs(8)](http://localhost/phpMan.php/man/debugfs/8/markdown)
- [mount(8)](http://localhost/phpMan.php/man/mount/8/markdown)
- [chattr(1)](http://localhost/phpMan.php/man/chattr/1/markdown)
- [acl(5)](http://localhost/phpMan.php/man/acl/5/markdown)
- [resize2fs(8)](http://localhost/phpMan.php/man/resize2fs/8/markdown)