Linux: Determine filesystem of unmounted partition

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

Linux: Determine filesystem of unmounted partition

Post 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)
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply