Categories
SysOps

How to determine mountpoint filesystem type

Determine mountpoint filesystem type using core stat utility which is expected to exist on every operating system.

Determine / mountpoint filesystem type.

$ stat -c %T -f /
ext2/ext3

Determine /mnt/userdata mountpoint filesystem type.

$ stat -c %T -f /mnt/userdata
btrfs

Determine /proc mountpoint filesystem type.

$ stat -c %T -f /proc
proc

Determine /run mountpoint filesystem type.

$ stat -c %T -f /run
tmpfs

This utility provides an easy way to determine which utility to use when you want to perform an online filesystem resize.