LinuxCommandLibrary

dumpe2fs

Display ext2/3/4 filesystem information

TLDR

Display ext2, ext3 and ext4 filesystem information

$ dumpe2fs [/dev/sdXN]
copy

Display the blocks which are reserved as bad in the filesystem
$ dumpe2fs -b [/dev/sdXN]
copy

Force display filesystem information even with unrecognizable feature flags
$ dumpe2fs -f [/dev/sdXN]
copy

Only display the superblock information and not any of the block group descriptor detail information
$ dumpe2fs -h [/dev/sdXN]
copy

Print the detailed group information block numbers in hexadecimal format
$ dumpe2fs -x [/dev/sdXN]
copy

SYNOPSIS

dumpe2fs [ options ] device

PARAMETERS

-b
    Print block group descriptors.

-f
    Display feature flags.

-g
    Display block group statistics for each group.

-h
    Display only the superblock information, omitting block group descriptors.

-i
    Display the inodes table. This option typically requires a specific inode number or range to be specified, often in conjunction with -o or -O.

-o superblock=num
    Use an alternative superblock located at block num for analysis.

-O feature[,...]
    Only display information about the specified filesystem feature (e.g., has_journal).

-r
    Display raw filesystem block numbers.

-V
    Print the version number of dumpe2fs.

DESCRIPTION

dumpe2fs is a utility for displaying detailed information about the superblock and block group descriptors of an ext2, ext3, or ext4 filesystem. It's an invaluable tool for filesystem diagnostics, understanding its layout, and verifying various parameters.
It provides insights into features like journaling status, inode count, block size, fragmentation, and timestamps. It can be used to examine a filesystem on a block device or a regular file containing a filesystem image. The output includes information about block groups, inode tables, free blocks, and free inodes, helping administrators troubleshoot filesystem issues or optimize its performance.

CAVEATS

dumpe2fs operates in a read-only mode and does not modify the filesystem. However, it often requires root privileges to read directly from block devices like /dev/sda1.
It is designed specifically for ext2, ext3, and ext4 filesystems and will not work with other filesystem types such as XFS, Btrfs, or NTFS. For consistent output, it's advisable to ensure the device is not actively being written to, although the operation is read-only.

OUTPUT INTERPRETATION

The output of dumpe2fs can be extensive and highly detailed. It provides information on various aspects of the filesystem, including its superblock (containing global parameters like inode count, block size, and last mounted time), and granular details for each block group (such as free blocks, free inodes, and the location of inode tables). Understanding this output is crucial for advanced filesystem debugging, performance analysis, and optimization.

USAGE WITH FILESYSTEM IMAGES

Beyond physical devices, dumpe2fs can effectively inspect filesystem images stored in regular files. This capability is particularly useful for forensic analysis, debugging filesystem corruption in non-live environments, or working with virtual machine disk images without needing to mount them, providing a safe and convenient way to analyze filesystem structures.

HISTORY

dumpe2fs is part of the e2fsprogs package, a collection of essential utilities for the ext2/ext3/ext4 filesystem. Developed and maintained by Theodore Ts'o since the early 1990s, e2fsprogs has been fundamental to Linux's filesystem management. dumpe2fs specifically provides diagnostic capabilities, evolving with the ext filesystem versions from ext2 to ext4, incorporating support for new features like journaling and extended attributes, making it a longstanding and reliable tool for filesystem analysis.

SEE ALSO

tune2fs(8), e2label(8), mke2fs(8), fsck.ext4(8), debugfs(8)

Copied to clipboard