How do I determine if a partition is ext2 or ext3 if I no longer have a copy of /etc/fstab ?

Here is what I get out of dumpe2fs. I suspect that there is some info here that is relevant. I am guessing that the has_journal feature may mean that this is ext3, but I'd love some confirmation of this.

dumpe2fs /dev/sdb1 | head -15
dumpe2fs 1.41.11 (14-Mar-2010)
Filesystem volume name:   HOME
Last mounted on:          <not available>
Filesystem UUID:          56d1b36b-8bba-4ba3-8133-0007a7536fc0
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal resize_inode dir_index filetype sparse_super large_file
Filesystem flags:         signed_directory_hash 
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              1970848
Block count:              3939933
Reserved block count:     196996
Free blocks:              347103
  • All ext filesystem can be thought of as a single filesystem format, and the extN denotes the filesystem's driver version, instead of the filesystem format. The fact that later version of the ext filesystem driver have features that previous versions cannot use is due to the extensible nature of the ext format. – Lie Ryan Oct 3 '10 at 6:25
  • ... the upshot of which is that you can safely mount an ext2 filesystem as ext3. – caf Oct 3 '10 at 7:55
  • There is also a certain amount of "find out something the OS manages without asking the OS" to this. But if you must you might look at how mount manages to automatically guess the type of filesystems. 'Course, it may ask the kernel for help, which would mean looking at how the kernel drivers do it... – dmckee --- ex-moderator kitten Oct 3 '10 at 23:09

has_journal means it is ext3.

| improve this answer | |
  • And how do I know it's an ext4 fs? – polemon Oct 3 '10 at 6:10
  • @polemon: Maybe extents. – Lie Ryan Oct 3 '10 at 6:21

For ext4 filesystems, use dumpe4fs; it should show extents.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.