RFC: file magic for ext4

2008-01-30 Thread Eric Sandeen
This seems to work fine; any comments, either about
the logic, or the text descriptions, or the various
options I've shown/not shown?

To test, copy your magic file somewhere local, 
replace the ext2/3 section with the following,
and do something like:

# file -C -m magic; file -m ./magic -s /dev/sda1

-Eric

# ext2/ext3 filesystems - Andreas Dilger [EMAIL PROTECTED]
0x438   leshort 0xEF53  Linux
0x44c  lelong  x   rev %d
0x43e  leshort x   \b.%d
# No journal?  ext2
0x45c  lelong  ^0x004  ext2 filesystem data
0x43a leshort ^0x001  (mounted or unclean)
# Has a journal?  ext3 or ext4
0x45c  lelong  0x004
#  and small INCOMPAT?
0x460 lelong  0x040
#   and small RO_COMPAT?
0x464 lelong 0x008  ext3 filesystem data
#   else large RO_COMPAT?
0x464 lelong 0x007  ext4 filesystem data
#  else large INCOMPAT?
0x460 lelong  0x03f  ext4 filesystem data
# General flags for any ext* fs
0x460  lelong  0x004  (needs journal recovery)
0x43a  leshort 0x002  (errors)
# INCOMPAT flags
0x460  lelong  0x001  (compressed)
#0x460 lelong  0x002  (filetype)
#0x460 lelong  0x010  (meta bg)
0x460  lelong  0x040  (extents)
0x460  lelong  0x080  (64bit)
#0x460 lelong  0x100  (mmp)
#0x460 lelong  0x200  (flex bg)
# RO_INCOMPAT flags
#0x464 lelong  0x001  (sparse super)
0x464  lelong  0x002  (large files)
0x464  lelong  0x008  (huge files)
#0x464 lelong  0x010  (gdt checksum)
#0x464 lelong  0x020  (many subdirs)
#0x463 lelong  0x040  (extra isize)


-
To unsubscribe from this list: send the line unsubscribe linux-ext4 in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: RFC: file magic for ext4

2008-01-30 Thread Andreas Dilger
On Jan 30, 2008  11:19 -0600, Eric Sandeen wrote:
 This seems to work fine; any comments, either about
 the logic, or the text descriptions, or the various
 options I've shown/not shown?
 
 To test, copy your magic file somewhere local, 
 replace the ext2/3 section with the following,
 and do something like:
 
 # file -C -m magic; file -m ./magic -s /dev/sda1
 
 -Eric
 
 # ext2/ext3 filesystems - Andreas Dilger [EMAIL PROTECTED]

Lol, you may as well fix up the email  [EMAIL PROTECTED] will
probably be the least transient.

 0x438   leshort 0xEF53  Linux
 0x44c  lelong  x   rev %d
 0x43e  leshort x   \b.%d
 # No journal?  ext2
 0x45c  lelong  ^0x004  ext2 filesystem data
 0x43a leshort ^0x001  (mounted or unclean)
 # Has a journal?  ext3 or ext4
 0x45c  lelong  0x004
 #  and small INCOMPAT?
 0x460 lelong  0x040
 #   and small RO_COMPAT?
 0x464 lelong 0x008  ext3 filesystem data
 #   else large RO_COMPAT?
 0x464 lelong 0x007  ext4 filesystem data
 #  else large INCOMPAT?
 0x460 lelong  0x03f  ext4 filesystem data
 # General flags for any ext* fs
 0x460  lelong  0x004  (needs journal recovery)
 0x43a  leshort 0x002  (errors)
 # INCOMPAT flags
 0x460  lelong  0x001  (compressed)
 #0x460 lelong  0x002  (filetype)
 #0x460 lelong  0x010  (meta bg)
 0x460  lelong  0x040  (extents)
 0x460  lelong  0x080  (64bit)
 #0x460 lelong  0x100  (mmp)
 #0x460 lelong  0x200  (flex bg)
 # RO_INCOMPAT flags
 #0x464 lelong  0x001  (sparse super)
 0x464  lelong  0x002  (large files)
 0x464  lelong  0x008  (huge files)
 #0x464 lelong  0x010  (gdt checksum)
 #0x464 lelong  0x020  (many subdirs)
 #0x463 lelong  0x040  (extra isize)

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

-
To unsubscribe from this list: send the line unsubscribe linux-ext4 in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html