dumpe2fs — quick reference
Superblock summary
Read-only views of the primary superblock — safe on a live ext4 mount, though values can shift while the filesystem is busy.
| When to use | Command |
|---|---|
| Print superblock fields only (UUID, block size, inode counts) | sudo dumpe2fs -h /dev/sdXN |
| Full superblock plus all block group descriptors | sudo dumpe2fs /dev/sdXN |
| Read an alternate superblock by block number | sudo dumpe2fs -o superblock=32768 /dev/sdXN |
| Force block size when probing a backup superblock | sudo dumpe2fs -o superblock=32768 -o blocksize=4096 /dev/sdXN |
Filtered fields (grep)
Pull one fact from a large dump without reading every block group line.
| When to use | Command |
|---|---|
| Show filesystem UUID | sudo dumpe2fs -h /dev/sdXN | grep UUID |
| List backup superblock locations | sudo dumpe2fs /dev/sdXN | grep -i 'Backup superblock' |
| Show inode and block capacity lines | sudo dumpe2fs -h /dev/sdXN | grep -E 'Inode count|Block count|Block size' |
| Show enabled ext features | sudo dumpe2fs -h /dev/sdXN | grep -i features |
| Show mount count and last mount/write times | sudo dumpe2fs -h /dev/sdXN | grep -E 'Mount count|Last mount|Last write' |
Block groups, bad blocks, and extended views
| When to use | Command |
|---|---|
| List blocks marked bad in the filesystem metadata | sudo dumpe2fs -b /dev/sdXN |
| Print group descriptor summary lines | sudo dumpe2fs -g /dev/sdXN |
| Include extended superblock information | sudo dumpe2fs -x /dev/sdXN |
| Show inode bitmap and table block locations per group | sudo dumpe2fs -i /dev/sdXN |
Help and version
| When to use | Command |
|---|---|
Show brief usage (note: -h on a device means superblock-only dump) |
dumpe2fs |
| Show dumpe2fs and ext2fs library version | dumpe2fs -V |
dumpe2fs — command syntax
Synopsis from dumpe2fs usage on Ubuntu 25.04 (e2fsprogs 1.47.2):
dumpe2fs [-bfghimxV] [-o superblock=<num>] [-o blocksize=<num>] devicedevice is a block device (/dev/sdXN, /dev/mapper/vg-lv, or an unmounted loop device). dumpe2fs is read-only — it does not modify the filesystem. On a mounted ext4 volume the command usually succeeds, but counters and timestamps may lag active writes; unmount for forensic accuracy or before recovery planning.
Confirm the type first with lsblk -f or sudo blkid /dev/sdXN — dumpe2fs only works on ext2, ext3, and ext4.
dumpe2fs — command examples
Essential Superblock summary with -h
-h prints superblock information only — no per-block-group listing. This is the usual starting point for UUID, block size, and feature checks.
Run the command on the root ext4 device (read-only while / is mounted):
sudo dumpe2fs -h /dev/mapper/ubuntu--vg-ubuntu--lvSample output (trimmed):
dumpe2fs 1.47.2 (1-Jan-2025)
Filesystem volume name: <none>
Last mounted on: /
Filesystem UUID: 72457fae-1731-4c94-b5c1-ac4564f4311c
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index orphan_file filetype needs_recovery extent 64bit flex_bg metadata_csum_seed sparse_super large_file huge_file dir_nlink extra_isize metadata_csum orphan_present
Filesystem state: clean
Inode count: 3833856
Block count: 15312896
Block size: 4096
Mount count: 15
Maximum mount count: -1Compare UUID here with /etc/fstab and lsblk -f when a volume fails to mount.
Essential Extract the filesystem UUID
Scripts and fstab entries often need the UUID line without the full dump.
Run the command:
sudo dumpe2fs -h /dev/mapper/ubuntu--vg-ubuntu--lv | grep UUIDSample output:
Filesystem UUID: 72457fae-1731-4c94-b5c1-ac4564f4311cCross-check with sudo blkid /dev/mapper/ubuntu--vg-ubuntu--lv — both should agree when the superblock is healthy.
Essential List backup superblock locations
ext4 keeps spare superblocks for recovery. The full dump lists each backup by block number — save these before running fsck -b.
Run the command:
sudo dumpe2fs /dev/mapper/ubuntu--vg-ubuntu--lv | grep -i 'Backup superblock' | head -5Sample output:
Backup superblock at 32768, Group descriptors at 32769-32776
Backup superblock at 98304, Group descriptors at 98305-98312
Backup superblock at 163840, Group descriptors at 163841-163848
Backup superblock at 229376, Group descriptors at 229377-229384
Backup superblock at 294912, Group descriptors at 294913-294920If the primary superblock is corrupt, fsck.ext4 -b 32768 /dev/sdXN tries a backup — only on an unmounted filesystem and after backups exist.
Common Inode and block capacity at a glance
Capacity planning and inode exhaustion checks start with these three fields.
Run the command:
sudo dumpe2fs -h /dev/mapper/ubuntu--vg-ubuntu--lv | grep -E 'Inode count|Block count|Block size|Free blocks|Free inodes'Inode exhaustion can fill a disk before blocks do; the df and du explains df -i and when IUse% hits 100%.
Sample output:
Inode count: 3833856
Block count: 15312896
Free blocks: 9990711
Free inodes: 3525529
Block size: 4096Pair with df -h and df -i on the mount point for live usage; dumpe2fs shows filesystem-level totals from the superblock.
Common Mount count and last write time
Useful when tuning automatic fsck thresholds with tune2fs or explaining why a check ran at boot.
Run the command:
sudo dumpe2fs -h /dev/mapper/ubuntu--vg-ubuntu--lv | grep -E 'Mount count|Maximum mount count|Last mount time|Last write time|Last checked'Sample output:
Last mount time: Wed Jul 1 17:34:26 2026
Last write time: Wed Jul 1 17:23:54 2026
Mount count: 15
Maximum mount count: -1
Last checked: Mon Oct 6 10:35:36 2025-1 for maximum mount count means no forced check based on mount count alone.
Common Enabled ext4 features
The features line shows which ext4 capabilities were enabled at format time — journal, extents, metadata checksums, and similar flags.
Run the command:
sudo dumpe2fs -h /dev/mapper/ubuntu--vg-ubuntu--lv | grep -i featuresSample output:
Filesystem features: has_journal ext_attr resize_inode dir_index orphan_file filetype needs_recovery extent 64bit flex_bg metadata_csum_seed sparse_super large_file huge_file dir_nlink extra_isize metadata_csum orphan_present
Journal features: journal_incompat_revokeIf migration or downgrade is on the table, compare this list with target kernel and e2fsprogs support before attempting changes.
Common List bad blocks recorded in metadata
-b prints blocks the filesystem has marked bad. No output usually means none are recorded.
Run the command on a small lab image (safe to create and destroy in /tmp):
IMG=/tmp/dumpe2fs-lab.img
dd if=/dev/zero of="$IMG" bs=1M count=32 status=none
mkfs.ext4 -F "$IMG" >/dev/null
dumpe2fs -b "$IMG"
rm -f "$IMG"Sample output when no bad blocks exist:
dumpe2fs 1.47.2 (1-Jan-2025)Only the version line appears — no bad block list follows.
Advanced Read a backup superblock by block number
When the primary superblock is damaged, -o superblock= reads a copy at a known block — use a number from the Backup superblock lines.
Run the command (read-only on live ext4):
sudo dumpe2fs -o superblock=32768 /dev/mapper/ubuntu--vg-ubuntu--lv | head -10Sample output:
dumpe2fs 1.47.2 (1-Jan-2025)
Filesystem volume name: <none>
Last mounted on: /
Filesystem UUID: 72457fae-1731-4c94-b5c1-ac4564f4311c
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index orphan_file filetype needs_recovery extent 64bit flex_bg metadata_csum_seed sparse_super large_file huge_file dir_nlink extra_isize metadata_csum orphan_present
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: cleanMatching UUID across primary and backup superblocks confirms you found a valid copy before pointing fsck.ext4 -b at it.
Advanced Bad magic number on a non-ext partition
dumpe2fs only understands ext2/ext3/ext4. Pointing it at EFI, swap, or XFS returns a superblock error.
Run the command on an EFI partition (replace device if yours differs):
sudo dumpe2fs /dev/sda1 2>&1 | head -3
sudo blkid /dev/sda1Sample output:
dumpe2fs 1.47.2 (1-Jan-2025)
dumpe2fs: Bad magic number in super-block while trying to open /dev/sda1
Couldn't find valid filesystem superblock.
/dev/sda1: PARTUUID="5218f62f-744d-4128-95f6-97ddea625886"Use lsblk -f to pick the correct ext partition before calling dumpe2fs.
dumpe2fs — when to use / when not
| Use dumpe2fs when | Use something else when |
|---|---|
|
|
dumpe2fs vs tune2fs
| dumpe2fs | tune2fs | |
|---|---|---|
| Purpose | Display superblock and block group metadata | Change tunable filesystem parameters |
| Modifies disk? | No (read-only) | Yes |
| Typical output | UUID, features, backup superblocks, group tables | Same fields via -l; writes with -c, -L, etc. |
| Safe on mounted ext4? | Usually yes for read-only inspection | Often requires unmounted filesystem for changes |
Use dumpe2fs to inspect; use tune2fs when you intentionally change settings after understanding current values.
Related commands
| Command | One line |
|---|---|
| dumpe2fs | Read ext superblock and block groups (this page) |
fsck.ext4 |
Check and repair ext filesystems |
mkfs.ext4 |
Create a new ext4 filesystem |
lsblk |
List block devices and filesystem types |
Browse the full index in our Linux commands reference.
dumpe2fs — interview corner
What does dumpe2fs do?
dumpe2fs (from e2fsprogs) prints superblock and block group metadata for ext2, ext3, and ext4. It is read-only — it does not repair or tune anything.
Typical fields include UUID, block and inode counts, filesystem features, mount count, and locations of backup superblocks. Admins run it before recovery when fsck reports a bad primary superblock.
A strong answer is:
"dumpe2fs is a read-only inspector for ext filesystems — superblock info, block groups, and backup superblock locations. I use it before fsck recovery or to verify UUID and features."
Is it safe to run dumpe2fs on a mounted filesystem?
dumpe2fs does not write to the device, so it is commonly run on live ext4 mounts for a quick UUID or feature check.
Caveat: while the filesystem is active, counters and timestamps in the dump may not be perfectly stable. For forensic work or recovery planning, unmount first so metadata is quiescent.
A strong answer is:
"It's read-only so it's usually fine mounted for a quick look, but I unmount for accurate forensic snapshots or right before recovery."
How do backup superblocks help recovery?
ext4 stores copies of the superblock at fixed block offsets. If the primary superblock is corrupt, fsck.ext4 -b BLOCK can use a backup.
Find block numbers:
sudo dumpe2fs /dev/sdXN | grep -i 'Backup superblock'Then (filesystem unmounted):
sudo fsck.ext4 -b 32768 /dev/sdXNUse a block number from your dump — 32768 is an example, not universal.
A strong answer is:
"I list backup superblocks with dumpe2fs, then run fsck.ext4 -b with one of those block numbers on an unmounted volume."
What is the difference between dumpe2fs and tune2fs?
Both read superblock fields, but roles differ:
| dumpe2fs | tune2fs | |
|---|---|---|
| Writes | Never | Can change tunables |
| Output depth | Full block group dump optional | -l for listing; flags to modify |
| Use case | Inspection, recovery prep | Adjust mount counts, labels, check intervals |
A strong answer is:
"dumpe2fs is display-only metadata dump; tune2fs can change filesystem parameters. I inspect with dumpe2fs, then tune deliberately with tune2fs."
What causes 'Bad magic number in super-block'?
The superblock begins with magic 0xEF53 on ext filesystems. Bad magic means dumpe2fs did not find that signature — common causes:
- Wrong partition (EFI, swap, LVM PV, XFS, …)
- Severely corrupted superblock
- Offset/device typo
Confirm type with lsblk -f or blkid before assuming corruption.
A strong answer is:
"Bad magic usually means wrong filesystem type or a dead superblock — I verify with blkid first, then look at backup superblocks if it's ext."
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Bad magic number in super-block |
Not ext2/3/4 or corrupt superblock | lsblk -f, blkid; try backup superblock dump with -o superblock= |
Couldn't find valid filesystem superblock |
Wrong device or all superblock copies damaged | List backups; fsck.ext4 -b BLOCK on unmounted FS |
Permission denied |
Non-root user on block device | Prefix with sudo |
| Values look stale on a busy mount | Live writes while dumping | Accept for quick checks; unmount for stable metadata |
| Huge output hard to read | Full dump includes every block group | Use -h for superblock only; grep for UUID, Backup, Inode |
| dumpe2fs on XFS/Btrfs fails | Wrong tool for filesystem type | Use xfs_info, btrfs filesystem df, etc. |
