Andreas Dilger wrote:
Very interesting. Unfotunately, my results don't match yours.* Is there a tool to determine the type of file system on a partition without mounting it?Lots of them. "file -s /dev/foo" or if you have a newer e2fsprogs (1.33 and newer I think) you can use "blkid [dev ...]" to tell you a bunch of things about each device (LABEL, UUID, TYPE).
First, I had tried 'file' and found that it didn't work. I tried it again and found that it still didn't work.
root@notsomarlin:~# losetup /dev/loop/0 /tmp/fooDo you get other results? If not, it would seem that Debian's version of 'file' is broken, yet I checked the source code and there are magic numbers for reiserfs included.
root@notsomarlin:~# mke2fs /dev/loop/0
...
root@notsomarlin:~# file /tmp/foo
/tmp/foo: Linux rev 1.0 ext2 filesystem data
root@notsomarlin:~# mkreiserfs /dev/loop/0
...
ReiserFS is successfully created on /dev/loop/0.
root@notsomarlin:~# file /tmp/foo
/tmp/foo: data
Also, I check e2fsprogs and it is at version 1.35 in Debian unstable, but no tool called 'blkid' is included.
So I'm still searching for reliable methods to do this.