Linux: Determine filesystem of unmounted partition
Posted: Sun Aug 12, 2012 1:01 am
[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:
The output is exactly what I needed:
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
/dev/sda1: Linux rev 1.0 ext4 filesystem data, UUID=25acfe31-bcf5-40cd-9184-f560bfed55b3 (extents) (large files) (huge files)