[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How does the superblock/mount -t auto work? (was: Synching volumes on logout -- tune2fs)



On Fri, 26 Dec 2003 at 21:15 GMT, Paul Morgan penned:
> On Fri, 26 Dec 2003 12:23:23 -0700, Monique Y. Herman wrote:
>> 
>> Ooh, here *I* have a question.  Just noticed that I have my ext3 root
>> partition mounting as 'auto' in my fstab.  My other ext3 partitions
>> are mounting as 'ext3,ext2' (in case the kernel isn't ext3-aware, I
>> can still mount them as ext2).  What is 'auto's behavior in this
>> situation?  Will it choose ext3 or ext2?
> 
> With "auto", mount will probe the superblock to get the filesystem
> type.  cf. "man mount"
> 

I'm not sure how to take a peek at the superblock myself, but the
relevant output of tune2fs -l is:

Filesystem magic number:  0xEF53
Filesystem features:      has_journal filetype needs_recovery
sparse_super

Now, here's what I wonder about.  As I understand it, ext3 is really
just ext2 with some added features.  So then, is the magic number for
both the same, and is the fact that I have has_journal under "filesystem
features" the same as saying that it's actually *using* the journal?

Or in other words, is the superblock actually going to look any
different between ext2 and ext3?  My naive guess is that the superblock
would be the same, and therefore that 'auto' would mount an ext3
partition as ext2, but I just don't know.

I've been trying to come up with a good google search that would
demistify this stuff for me, but so far most searches just come up with
superblock/magic number *errors*, not explanations.

`man mount` does say this:

The auto type may be useful for user-mounted floppies.  Creating
a file /etc/filesystems can be useful to change the probe  order
(e.g.,  to  try vfat before msdos) or if you use a kernel module
autoloader.  Warning: the probing uses a heuristic (the presence
of  appropriate `magic'), and could recognize the wrong filesys-
tem type, possibly with catastrophic consequences. If your  data
is valuable, don't ask mount to guess.

So it appears that, if I knew for sure that a filesystem could be seen
as more than one type, I could give mount hints.  More importantly, I
should really explicitly set it to 'ext3,ext2' for the root partition
(and will, when I get home).  But I'd really like to understand how all
of this filesystem stuff works.

-- 
monique



Reply to: