2002-11-06 05:29:14

by Keith Owens

[permalink] [raw]
Subject: 2.4.20-rc1 dirty ext2 mount error

The root partition was originally ext3. fstab now contains

/dev/sda1 / ext2 defaults 1 1

Booting 2.4.20-rc1 (ext3 as a module, not loaded yet) with a dirty / gets

EXT2-fs: sd(8,1): couldn't mount because of unsupported optional features (4).
Drop back to 2.4.18 and it works, automatically running fsck.ext2 -a /dev/sda1.


2002-11-06 05:39:53

by Andrew Morton

[permalink] [raw]
Subject: Re: 2.4.20-rc1 dirty ext2 mount error

Keith Owens wrote:
>
> The root partition was originally ext3. fstab now contains
>
> /dev/sda1 / ext2 defaults 1 1
>
> Booting 2.4.20-rc1 (ext3 as a module, not loaded yet) with a dirty / gets
>
> EXT2-fs: sd(8,1): couldn't mount because of unsupported optional features (4).
> Drop back to 2.4.18 and it works, automatically running fsck.ext2 -a /dev/sda1.
>

You sure? That would be a bug in 2.4.18...

ext2 does not know how to mount a needs-recovery ext3 filesystem. It
is flagged as an incompatible feature (4 -> EXT3_FEATURE_INCOMPAT_RECOVER).

If you run journal replay by mounting it with ext3 or running fsck across
it, then ext2 can mount it.

2002-11-06 06:20:31

by Keith Owens

[permalink] [raw]
Subject: Re: 2.4.20-rc1 dirty ext2 mount error

On Tue, 05 Nov 2002 21:46:19 -0800,
Andrew Morton <[email protected]> wrote:
>Keith Owens wrote:
>>
>> The root partition was originally ext3. fstab now contains
>>
>> /dev/sda1 / ext2 defaults 1 1
>>
>> Booting 2.4.20-rc1 (ext3 as a module, not loaded yet) with a dirty / gets
>>
>> EXT2-fs: sd(8,1): couldn't mount because of unsupported optional features (4).
>> Drop back to 2.4.18 and it works, automatically running fsck.ext2 -a /dev/sda1.
>>
>
>You sure? That would be a bug in 2.4.18...
>
>ext2 does not know how to mount a needs-recovery ext3 filesystem. It
>is flagged as an incompatible feature (4 -> EXT3_FEATURE_INCOMPAT_RECOVER).

Unclean shutdown, reboot.

LILO boot: 2.4.20-rc1
Loading 2.4.20-rc1........................
Linux version 2.4.20-rc1 (kaos@sherman) (gcc version 3.2 20020822 (Red Hat Linux Rawhide 3.2-4)) #10 SMP Wed Nov 6 16:10:31 EST 2002
Kernel command line: auto BOOT_IMAGE=2.4.20-rc1 ro root=801 BOOT_FILE=/lib/modules/2.4.20-rc1/bzImage console=tty0 console=ttyS0,38400 mem=127M
EXT2-fs: sd(8,1): couldn't mount because of unsupported optional features (4).
Kernel panic: VFS: Unable to mount root fs on 08:01

Entering kdb (current=0xc11f4000, pid 1) on processor 1 due to KDB_ENTER()
[1]kdb> reboot

Come up on 2.4.18-14 from RH. It detects ext3 and cleans the journal,
even though fstab says ext2. Then ext2 does fsck.ext2 -a /dev/sda1. I
guess the question is why ext3 is being used when fstab says ext2?
Especially when that stuffs up booting into other kernels that do not
have ext3 support at all.

LILO boot:
Loading linux............................
Linux version 2.4.18-14smp ([email protected]) (gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)) #1 SMP Wed Sep 4 12:34:47 EDT 2002
Freeing initrd memory: 258k freed
VFS: Mounted root (ext2 filesystem).
Red Hat nash version 3.4.28 starting
Loading scsi_mod module
SCSI subsystem driver Revision: 1.00
Loading sd_mod module
Loading jbd module
Journalled Block Device driver loaded
Loading ext3 module
Mounting /proc filesysteEXT3-fs: INFO: recovery required on readonly filesystem.
m
Creating blocEXT3-fs: write access will be enabled during recovery.
k devices
Creating root device
Mounting root filesystem
kjournald starting. Commit interval 5 seconds
EXT3-fs: sd(8,1): orphan cleanup on readonly fs
EXT3-fs: sd(8,1): 1 orphan inode deleted
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
Freeing unused kernel memory: 240k freed
INIT: version 2.84 booting
Welcome to Red Hat Linux
Press 'I' to enter interactive startup.
Mounting proc filesystem: [ OK ]
Unmounting initrd: [ OK ]
Configuring kernel parameters: [ OK ]
Setting clock (utc): Wed Nov 6 16:25:57 EST 2002 [ OK ]
Setting hostname snowy: [ OK ]
Initializing USB controller (usb-uhci): [ OK ]
Mounting USB filesystem: [ OK ]
Initializing USB HID interface: [ OK ]
Initializing USB keyboard: [ OK ]
Initializing USB mouse: [ OK ]
Your system appears to have shut down uncleanly
Press Y within 1 seconds to force file system integrity check...
Checking root filesystem
/12: clean, 23509/66264 files, 130447/265041 blocks
[/sbin/fsck.ext2 (1) -- /] fsck.ext2 -a /dev/sda1

2002-11-06 08:21:57

by Matt Bernstein

[permalink] [raw]
Subject: Re: 2.4.20-rc1 dirty ext2 mount error

At 17:26 +1100 Keith Owens wrote:

>>> The root partition was originally ext3. fstab now contains
>>>
>>> /dev/sda1 / ext2 defaults 1 1
>>>
>>> Booting 2.4.20-rc1 (ext3 as a module, not loaded yet) with a dirty / gets
>>>
>>> EXT2-fs: sd(8,1): couldn't mount because of unsupported optional features (4).
>>> Drop back to 2.4.18 and it works, automatically running fsck.ext2 -a /dev/sda1.

>Come up on 2.4.18-14 from RH. It detects ext3 and cleans the journal,
>even though fstab says ext2. Then ext2 does fsck.ext2 -a /dev/sda1. I
>guess the question is why ext3 is being used when fstab says ext2?

My guess answer is that /etc/fstab lives on / and can't be read till it's
mounted. 2.4.18-14 has the ext3 modules loaded from initrd so the kernel
can have 2 guesses at how to mount /

>Especially when that stuffs up booting into other kernels that do not
>have ext3 support at all.

Maybe you need to tune2fs -O ^has_journal /dev/sda1, or build an initrd
which doesn't load the ext3 modules.

Matt

2002-11-06 08:38:03

by Andreas Dilger

[permalink] [raw]
Subject: Re: 2.4.20-rc1 dirty ext2 mount error

On Nov 06, 2002 17:26 +1100, Keith Owens wrote:
> Unclean shutdown, reboot.
>
> LILO boot: 2.4.20-rc1
> Loading 2.4.20-rc1........................
> Linux version 2.4.20-rc1 (kaos@sherman) (gcc version 3.2 20020822 (Red Hat Linux Rawhide 3.2-4)) #10 SMP Wed Nov 6 16:10:31 EST 2002
> Kernel command line: auto BOOT_IMAGE=2.4.20-rc1 ro root=801 BOOT_FILE=/lib/modules/2.4.20-rc1/bzImage console=tty0 console=ttyS0,38400 mem=127M
> EXT2-fs: sd(8,1): couldn't mount because of unsupported optional features (4).
> Kernel panic: VFS: Unable to mount root fs on 08:01
>
> Entering kdb (current=0xc11f4000, pid 1) on processor 1 due to KDB_ENTER()
> [1]kdb> reboot
>
> Come up on 2.4.18-14 from RH. It detects ext3 and cleans the journal,
> even though fstab says ext2. Then ext2 does fsck.ext2 -a /dev/sda1. I
> guess the question is why ext3 is being used when fstab says ext2?
> Especially when that stuffs up booting into other kernels that do not
> have ext3 support at all.

/etc/fstab is not available until after the kernel mounts the root
filesystem, so what is in /etc/fstab is totally irrelevant here.

If you don't simultaneously crash your system running ext3, and then reboot
into a kernel which does not support ext3 you will be fine. A clean
shutdown will clear the "needs_recovery" flag (and any ext2-only kernel
can blissfully use that filesystem), any ext3-aware kernel can also
mount it again and do a journal flush, or any modern (last year or two)
e2fsck will clean it up too (from a rescue disk if desparate).

Cheers, Andreas
--
Andreas Dilger
http://www-mddsp.enel.ucalgary.ca/People/adilger/
http://sourceforge.net/projects/ext2resize/

2002-11-06 09:56:45

by James Cloos

[permalink] [raw]
Subject: Re: 2.4.20-rc1 dirty ext2 mount error

>>>>> "Keith" == Keith Owens <[email protected]> writes:

Keith> The root partition was originally ext3. fstab now contains
Keith> /dev/sda1 / ext2 defaults 1 1

Keith> EXT2-fs: sd(8,1): couldn't mount because of unsupported
Keith> optional features (4). Drop back to 2.4.18 and it works,
Keith> automatically running fsck.ext2 -a /dev/sda1.

Do you perhaps have ext3 compiled into the kernel in your 2.4.18 and
as a module in your 2.4.20-rc1? That difference would do it, IIRC.

-JimC

2002-11-06 10:37:27

by Keith Owens

[permalink] [raw]
Subject: Re: 2.4.20-rc1 dirty ext2 mount error

On Wed, 6 Nov 2002 01:41:43 -0700,
Andreas Dilger <[email protected]> wrote:
>If you don't simultaneously crash your system running ext3, and then reboot
>into a kernel which does not support ext3 you will be fine. A clean
>shutdown will clear the "needs_recovery" flag (and any ext2-only kernel
>can blissfully use that filesystem), any ext3-aware kernel can also
>mount it again and do a journal flush, or any modern (last year or two)
>e2fsck will clean it up too (from a rescue disk if

You are right, but the 2.4.18 kernel is lying to me.

Linux version 2.4.18-14smp ([email protected]) (gcc
version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)) #1 SMP Wed Sep 4
12:34:47 EDT 2002
has ext2 built in but it boots with initrd containing ext3 as a module.
VFS: Mounted root (ext2 filesystem)
...
Loading jbd module
Journalled Block Device driver loaded
Loading ext3 module
Mounting root filsystem
EXT3-fs: mounted filesystem with ordered data mode
init starts ...
[/sbin/fsck.ext2 (1) -- /] fsck.ext2 -a /dev/sda1 [PASSED]
Remounting root filesystem in read-write mode: [ OK ]
...
# mount
/dev/sda1 on / type ext2 (rw)

VFS said that / was ext2, init ran fsck.ext2 against /, fstab says /
whoudl be ext2 and mount claims that it is ext2. Lies! It is still
ext3, the only indication is that lsmod shows a use count of 1 against
ext3. Crashing out of this kernel and into 2.4.20-rc1 which has no
initrd gets the error. And I thought I had got rid of ext3 ...

2002-11-06 11:15:13

by Willy Tarreau

[permalink] [raw]
Subject: Re: 2.4.20-rc1 dirty ext2 mount error

On Wed, Nov 06, 2002 at 09:43:49PM +1100, Keith Owens wrote:

> VFS said that / was ext2, init ran fsck.ext2 against /, fstab says /
> whoudl be ext2 and mount claims that it is ext2. Lies! It is still
> ext3, the only indication is that lsmod shows a use count of 1 against
> ext3. Crashing out of this kernel and into 2.4.20-rc1 which has no
> initrd gets the error. And I thought I had got rid of ext3 ...

I think that /proc/mounts should have correctly reported ext3. I used to have
"mount" report misinformation to mtab, which is one of the reasons why I got
rid of it.

Cheers,
Willy

2002-11-06 16:33:39

by Theodore Ts'o

[permalink] [raw]
Subject: Re: 2.4.20-rc1 dirty ext2 mount error

On Wed, Nov 06, 2002 at 09:43:49PM +1100, Keith Owens wrote:
> VFS said that / was ext2, init ran fsck.ext2 against /, fstab says /
> whoudl be ext2 and mount claims that it is ext2. Lies! It is still
> ext3, the only indication is that lsmod shows a use count of 1 against
> ext3. Crashing out of this kernel and into 2.4.20-rc1 which has no
> initrd gets the error. And I thought I had got rid of ext3 ...

Not a kernel bug. Let's break this down....

(BTW this is why I'm not all that fond of initrd at all. In fact, I
have a very strong distatse for initrd....)

> Linux version 2.4.18-14smp ([email protected]) (gcc
> version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)) #1 SMP Wed Sep 4
> 12:34:47 EDT 2002
> has ext2 built in but it boots with initrd containing ext3 as a module.
> VFS: Mounted root (ext2 filesystem)

The kernel mounted the initrd filesystem here, which was ext2 based.

> ...
> Loading jbd module
> Journalled Block Device driver loaded
> Loading ext3 module
> Mounting root filsystem
> EXT3-fs: mounted filesystem with ordered data mode

This is where the initrd system mounted the (real) root filesystem as
ext3, and then did the pivotroot to switch the root filesystem from
the initrd ramdisk to the real root filesystem.

> init starts ...
> [/sbin/fsck.ext2 (1) -- /] fsck.ext2 -a /dev/sda1 [PASSED]

init doesn't actually run fsck.ext2. Instead, init runs /etc/rc, and
that in turn runs fsck, and fsck consults /etc/fstab to determine
which fsck to run. (So does mount when it creates /etc/mtab file
after the root filesystem is remount read-write.)

The reason why I haven't had fsck consult /proc/mounts is that it
would be a special-case thing that only makes sense for the root
filesystem, since that's the only filesystem which should be mounted
at the time fsck runs. Since fsck.ext2 and fsck.ext3 are identical,
changing fsck so that it uses /proc/mounts is a rather moot change,
aside from the cosmetic details of what fsck prints out.

- Ted