2

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
Sathyajith Bhat
  • 61,504
  • 38
  • 179
  • 264
ChrisGuest
  • 167
  • 4
  • 15
  • 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 03 '10 at 06:25
  • ... the upshot of which is that you can safely mount an ext2 filesystem as ext3. –  Oct 03 '10 at 07: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 03 '10 at 23:09

2 Answers2

5

has_journal means it is ext3.

wallyk
  • 1,348
  • 10
  • 18
1

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

Daniel Beck
  • 109,300
  • 14
  • 287
  • 334
bubby
  • 11
  • 1