Earlier this week I needed to find out how a given partition was formatted in Linux. Normally I’d use the mount
command, but in this case the filesystem wasn’t already mounted. Fortunately Linux also comes with the useful file
command, which will give you lots of useful information about a file. Since partitions are a special type of file, you need to also provide the -s
option, like so:
$ sudo file -s /dev/sda* /dev/sda: ; partition 1 : ID=0xee, start-CHS (0x0,0,1), end-CHS (0x3ff,254,63), startsector 1, 625142447 sectors, extended partition table (last)\011 /dev/sda1: , mkdosfs boot message display "This is not a bootable disk. Please insert a bootable floppy a" /dev/sda2: Linux rev 1.0 ext2 filesystem data (mounted or unclean), UUID=50f912b3-7277-4e25-bb30-f73e86908dba /dev/sda3: LUKS encrypted file, ver 1 [aes, xts-plain64, sha1] UUID: bdf4efbb-175a-466b-97de-824ada2998c1
The above listing is from my netbook, which uses an encrypted filesystem in case anyone steals it.