LinuxCommandLibrary

fsstat

Display filesystem statistical information

SYNOPSIS

fsstat [ options ] filesystem...

PARAMETERS

-b
    Display block group information. Shows details for each block group, including free blocks, free inodes, and directory count.

-d
    Display directory entry information. Provides details about the content of directory blocks.

-f
    Display superblock information. Shows global filesystem statistics like block and inode counts, free space, and various timestamps. This is the default output if no other options are specified.

-i
    Display inode table information. Provides details about inode usage and allocation.

-s
    Display summary statistics. Presents a high-level overview of the filesystem's state, including total blocks, free blocks, total inodes, and free inodes.

-v
    Be verbose. Increases the verbosity of the output, providing more detailed information.

-q
    Be quiet. Suppresses some output or warnings.

-r
    Display raw output. Shows some information in raw (hexadecimal) format, useful for debugging.

-h
    Display help message and exit.

filesystem
    The device file (e.g., /dev/sda1) or mount point (e.g., /mnt/data) of the filesystem to analyze.

DESCRIPTION

fsstat is a command-line utility used to report various statistics about an ext2, ext3, or ext4 filesystem. Unlike the stat command which provides information about individual files or directories, fsstat focuses on the overall filesystem structure and health. It can display details such as block and inode usage, last access, modification, and change times for the superblock, and information about individual block groups.

This tool is particularly useful for system administrators and developers to diagnose filesystem issues, monitor usage patterns, and verify the integrity of filesystem metadata. It provides a deeper insight into how space is allocated and how inodes are utilized, aiding in troubleshooting and performance tuning of ext-family filesystems. It's part of the e2fsprogs suite, a collection of utilities for maintaining ext filesystems.

CAVEATS

fsstat is primarily designed for ext2, ext3, and ext4 filesystems. Its functionality and output may be limited or incompatible with other filesystem types like XFS, Btrfs, or ZFS.

To access raw device files (e.g., /dev/sda1), fsstat often requires root privileges.

Interpreting the detailed output, especially with options like -b or -d, requires a good understanding of ext filesystem internals.

COMMON USE CASES

fsstat is invaluable for monitoring filesystem health, diagnosing issues like inode exhaustion, or understanding disk space allocation at a granular level. For instance, fsstat -s /dev/sda1 quickly shows overall usage, while fsstat -b /dev/sda1 helps pinpoint specific block groups that might be full or fragmented.

OUTPUT DETAILS

The output can be quite rich, providing timestamps for last mount, last write, and last check for the filesystem superblock. It also details the number of free blocks, free inodes, and information about the various block groups, including their block and inode bitmaps and inode table locations.

HISTORY

fsstat is an integral part of the e2fsprogs package, a comprehensive suite of utilities for maintaining ext2, ext3, and ext4 filesystems on Linux. The e2fsprogs project, primarily maintained by Theodore Ts'o, has been a cornerstone of Linux filesystem management since the early days of ext2. fsstat has evolved alongside these filesystem versions, providing consistent and detailed diagnostic capabilities. Its presence reflects the deep understanding and robust tooling provided for the default Linux filesystems.

SEE ALSO

stat(1), df(1), du(1), tune2fs(8), dumpe2fs(8), e2fsck(8)

Copied to clipboard