Page 1 of 1

Linux: Determine filesystem of unmounted partition

Posted: Sun Aug 12, 2012 1:01 am
by ^rooker
[PROBLEM]
I wanted to check and mark badblocks on a system disk, but I was not 100% sure that if I formatted it as ext3 or ext4. Fdisk only shows that the partition is marked to contain a "Linux" filesystem.

I could have just mounted the disk, but it was fragile and I didn't want to move any bit more than necessary ;)

[SOLUTION]
Use "file -s" on the partition's device file:

Code: Select all

file -s /dev/sda1
The output is exactly what I needed:
/dev/sda1: Linux rev 1.0 ext4 filesystem data, UUID=25acfe31-bcf5-40cd-9184-f560bfed55b3 (extents) (large files) (huge files)