Bootstrap FreeKB - Linux Commands - file command (determine file system type)
Linux Commands - file command (determine file system type)

Updated:   |  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 Buy Me A Coffee



Comments


Add a Comment


Please enter 3a87d1 in the box below so that we can be sure you are a human.