How To See Characteristics of File Systems on Linux or Unix

How do I display the characteristics of file systems such as inodes, blocks, block size, file system name, state, lifetime writes, fsck status and more on Linux or Unix-like operating system?

Tutorial details
Difficulty Easy (rss)
Root privileges Yes
Requirements Linux and Unix OS
Time 2m
You can use any one of the following command as per your Linux or Unix variant:
  • tune2fs command
  • lsfs command
  • fstyp command
  • df command

Linux command to show file system characteristics

Pass the -l option to list the contents of the filesystem superblock, including the current values of the parameters that can be set via tune2fs command. Type the following command:
# tune2fs -l /path/to/device | more
# tune2fs -l /dev/sda2 | grep
# tune2fs -l /dev/cciss/c1d1p1
# tune2fs -l /dev/mapper/data

Sample outputs:

Fig.01: tune2fs command in action

You can use grep command to filter out information. For example, to see lifetime writes on ext4 filesystem, enter:
# tune2fs -l /dev/md0 | grep 'writes'
Sample outputs:
Lifetime writes:          90 GB

Please note that above commands works on on ext2/ext3/ext4 filesystems under Linux only. Hence for xfs, we need to use the following commands.

Linux displaing XFS filesystem geometry information

The xfs_info command shows geometry information about an existing XFS filesystem. The mount-point argument is the pathname of a directory where the filesystem is mounted. For instance if /dev/xdvf mounted as follows on AWS EC2 VM, we run:
$ sudo xfs_info /backup/
Here is what we see:

meta-data=/dev/xvdf              isize=512    agcount=4, agsize=26214400 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=0
data     =                       bsize=4096   blocks=104857600, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=51200, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

The block-device or file-image contain a raw XFS filesystem as follows (unmounted XFS file systems):
$ sudo xfs_info /dev/xvdf

HP-UX Unix specific command to see characteristics of file systems

The fstyp command allows the user to determine the file system type of a mounted or unmounted file system. You need to pass special a device special file such as /dev/dsk/c1t6d0 and -v option to see information about the file system’s superblock.
# fstyp -v /dev/vg02/lvol2
# fstyp -v /dev/dsk/c1t6d0 | more
# df -g /dev/vg02/lvol2

The ‘df -g‘ command the entire structure of the file system.

Displaying the characteristics of file systems on Solaris Unix

Type the following command:
# fstyp -v /dev/md/dsk/d200
# fstyp -v /dev/md/dsk/d200 | more
# df -g /dev/md/dsk/d200

AIX unix specific command

The lsfs command displays characteristics of file systems, such as mount points, automatic mounts, permissions, and file system size. The FileSystem parameter reports on a specific file system:
# lsfs -q /dev/hd10admin
# lsfs -q / | more

Summing up

We explained various Linux and Unix command show your servers file system characteristics.


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 3 comments so far... add one

CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
3 comments… add one
  • aL Oct 28, 2015 @ 7:28

    a description of what all those characteristics means would be neat :)

  • Miguel Nov 20, 2015 @ 8:12

    And for XFS?

  • Andrina Westerdale Dec 11, 2020 @ 3:33

    This article’s info about tune2fs

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Problem posting comment? Email me @ webmaster@cyberciti.biz