Linux Commands - file command (determine file system type)
by
Jeremy Canfield |
Updated: January 26 2022
| Linux Commands articles
The file command with the -s or --special-files flag can be used to determine a partitions file system type.
file /dev/sda1 --special-files
Which should return something like this, which shows that /dev/sda1 is using the EXT4 file system type.
/dev/sda1: SGI EXT4 filesystem data (blksz 4096, inosz 256, v2 dirs)
This also will work with LVM logical volumes.
file /dev/volumegroup001/home --special-files
However, you may get output like this with LVM logical volumes.
/dev/volumegroup001/home: symbolic link to `../dm-2'
In this scenario, the -L or --dereference flag can be included.
file /dev/volumegroup001/home --special-files --dereference
Which should then return something like this.
/dev/volumegroup001/home: SGI XFS filesystem data (blksz 4096, inosz 256, v2 dirs)
Did you find this article helpful?
If so, consider buying me a coffee over at