How to Check the Filesystem Type (ext4, xfs, btrfs) in Linux using the df Command

Identifying the Filesystem Architecture

Unlike Windows, which almost exclusively relies on the NTFS filesystem, a single Linux server can simultaneously utilize a vast array of different filesystem architectures. The root partition might be formatted as ext4, a massive data storage drive might utilize xfs for faster large-file handling, and a specialized backup volume might use btrfs for snapshot capabilities.

If a system administrator is attempting to run a filesystem repair utility (like fsck) or attempting to resize a partition, they must know exactly what filesystem architecture the drive is using. Attempting to run an ext4 resize command on an xfs partition will result in catastrophic failure.

To quickly and reliably determine the filesystem type of every mounted drive, you can use the native df (Disk Free) command with a specific flag.

Using the df -T Command

The standard df command is typically used to check how much storage space is remaining on a hard drive. By appending the -T (Type) flag, you force the command to expose the underlying filesystem architecture of every mount point.

Open your terminal and run the command with the -h (human-readable sizes) flag appended for better readability:

df -Th

Reading the Output

The terminal will output a table that looks similar to this:

Filesystem     Type      Size  Used Avail Use% Mounted on
tmpfs          tmpfs     796M  1.2M  795M   1% /run
/dev/sda1      ext4       25G   12G   12G  51% /
/dev/sdb1      xfs       500G  100G  400G  20% /mnt/data
/dev/sdc1      vfat       32G  5.0G   27G  16% /mnt/usb

Look at the newly added Type column. You can instantly see the architectural breakdown of the server:

  • /dev/sda1 (the root OS drive) is using the standard ext4 filesystem.
  • /dev/sdb1 (the massive 500GB data drive) is utilizing the xfs filesystem, meaning it must be managed with xfs_growfs rather than standard ext4 tools.
  • /dev/sdc1 (a USB flash drive) is formatted as vfat (FAT32), explaining why it cannot store files larger than 4GB.
  • tmpfs is a virtual RAM disk created by the kernel, not a physical hard drive.

Filtering the Output

If your server utilizes Docker or snap packages, running df -Th will flood your screen with dozens of virtual loopback filesystems (like squashfs or overlay), burying the actual physical hard drives you are looking for.

You can use the -t flag to specifically query a single type of filesystem. For example, if you only want to see the ext4 drives, run:

df -Th -t ext4

Alternatively, if you want to filter out the noise and exclude all the virtual tmpfs and squashfs mounts, use the -x (exclude) flag:

df -Th -x tmpfs -x squashfs -x overlay

This will leave you with a clean, highly readable list of only the physical block devices attached to the Linux machine and their exact filesystem types.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.