John Heil writes:
> >All changes made to ext2 (even journalling) will work with the 
> >same filesystem.
> 
> I can't figure out what this says.  Can you elaborate or reword?

OK...  The actual ext2 on-disk format has stayed at version 0.5b (1995).
At that time, it was a revision "0" filesystem.  Sometime later (maybe
1997 or so), the revision "1" ext2 filesystem was introduced but it is
fundamentally the same as revision "0" except that some "feature flags"
were added to the superblock.  There are three kinds of ext2 features:

COMPAT - the feature is 100% backwards compatible with old kernels, and
         they don't need to do anything to keep the filesystem consistent
         (e.g. ext3 has_journal).
RO_COMPAT - an old kernel can read the filesystem (no visible structure
         changes), but it wouldn't know enough to change the filesystem
         and keep it consistent (e.g. sparse_super, large_file).
INCOMPAT - the filesystem has been changed in some fundamental way that
         would make it impossible (or dangerous) to read the filesystem
         with an old kernel (e.g. ext3 needs_recovery, compression).

If no features are set, rev 0 and rev 1 filesystems are pretty much
identical.  Linux 1.2 kernels will refuse to mount a rev 1 filesystem,
I believe, for safety reasons.  Also, e2fsck will refuse to run on a
filesystem with any kind of feature it doesn't understand.

> I was dismayed just last week to find that Linux 2.0.36 (from a
> rescue disk) could not mount an ext2 filesystem created recently.
> The error message complained that the filesystem had a feature
> than Linux didn't understand.  So apparently all is not strictly
> backward and forward compatible in ext2.

With a 2.0.36 kernel, it can understand a rev 1 ext2 filesystem, but
until you go to 2.0.39, it can't understand some of the "newer" features
in the filesystem.  For the last two years or so, e2fsprogs will create
a filesystem with RO_COMPAT "filetype" and "sparse superblock" features
enabled by default, and these are unknown to 2.0.36.  Similarly, the
ext3 journal is only a COMPAT flag "has journal" feature in the ext2
filesystem, because it doesn't really change the layout (the journal is
simply a regular file in the filesystem).  However, if an ext3 filesystem
isn't unmounted cleanly (e.g. crash), the INCOMPAT "needs recovery" flag
is set which will prevent it from being mounted as an ext2 filesystem.

If you want to create an ext2 filesystem with newer mke2fs, but for
use on an older kernel, you should use "mke2fs -O none" per the "Warning"
in the man page (use "mke2fs -r 0" for 1.2 kernels).  This will turn
off the optional features of ext2.  If you have an existing filesystem
that you want to use on an older kernel, you can use tune2fs to clear
the features, and then run e2fsck to clean up the filesystem.  The only
time you would have any issues is with the "large_file" feature.  The
sparse_super and filetype features are only optimizations, not real data.

Cheers, Andreas

PS: your original question was whether it was safe to run a newer e2fsck
    on a system which was running e2fsck 1.04, and the answer is still yes,
    because the layout of the filesystem itself hasn't really changed.
    Note that you should build mke2fs on this older system, and it will turn
    off the defaults for creating new filesystems with features enabled.
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]

Reply via email to