Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
share|improve this question

migrated from stackoverflow.com Oct 3 '10 at 23:09

This question came from our site for professional and enthusiast programmers.

    
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 Oct 3 '10 at 23:09

2 Answers 2

up vote 5 down vote accepted

has_journal means it is ext3.

share|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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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