Pcornel
Storage · Filesystems

ext4

Cheat sheet · https://pcornel.dk/topic.php?topic=3950

Back to the Topic

Answer

ext4 stores files using inode metadata and extent/block mappings. Journaling protects filesystem metadata consistency across crashes according to the selected data mode, but underlying storage errors or silent corruption remain separate concerns.

Remember

  • Journal replay ≠ full data-integrity verification.
  • ext4 inode availability ≠ free byte capacity.
  • Mounted read-write ≠ media healthy.
  • fsck ≠ routine online repair for a mounted production filesystem.

First checks

  • tune2fs -l /dev/<dev> | grep -E 'state|count|Last checked' — state and mounts
  • e2fsck -n /dev/<dev> — read-only check (unmounted)
  • df -i — inode usage

Verify in this order

file → inode → extents → blocks

Where it usually breaks

First mismatch in media/provider → controller/pool → logical object → path/protocol → filesystem/share/object namespace → consumer workload; preserve identity/pre-state before mutation.

Filesystems → ext4 filesystem map

Filesystem boundaryWhat to verifyProof limit
Identity / attachmentFilesystem type, source/backing object, mount/attachment target and effective optionsPresence or mount state alone does not prove consistency or lower-layer health
Capacity / metadataData space, metadata/inodes, quotas/reservations and filesystem stateFree bytes at one layer do not prove allocation can succeed end to end
Failure boundaryA mounted ext4 filesystem proves current access but does not prove every inode/data block or underlying device is error-free.Correlate filesystem evidence with the backing volume/path/backend before repair
AcceptanceHealthy evidence: intended ext4 device is mounted with expected options, bytes and inodes are available, representative I/O works and kernel logs contain no correlated filesystem/device faults.Close only after the original path/workload and read-back check succeeds

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3950

Confirmation

Confirm action

Continue?