Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 221245 - [patch] sys-kernel/genkernel: extM is incorrectly mounted as extN (e.g. ext3 mounted as ext2)
Summary: [patch] sys-kernel/genkernel: extM is incorrectly mounted as extN (e.g. ext3 ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: Inclusion, InVCS
: 213541 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-05-10 16:40 UTC by Marcin Kurek
Modified: 2011-06-07 22:34 UTC (History)
15 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.txt,5.46 KB, text/plain)
2008-05-10 16:41 UTC, Marcin Kurek
Details
A complicated fix for "stupid user uses rootfs as a module" (genkernel-fsmod_fix.patch,5.17 KB, patch)
2008-06-21 09:26 UTC, Marcin Kurek
Details | Diff
Add a real_rootfs option (rootfs.patch,974 bytes, patch)
2008-07-11 07:17 UTC, Marcin Kurek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Kurek 2008-05-10 16:40:57 UTC
Today I was hit by ugly crash when I insert my usb stick, but this is not real problem in this case. I noticed after that there is some errors on my root partition (Only on this one) and few minutes after that I noticed gentoo mounts it as ext2:

dmesg | grep ext2
EXT2-fs warning (device dm-0): ext2_fill_super: mounting ext3 filesystem as ext2

Same looking at mount command output:

mount | grep lv_root
/dev/hell/lv_root on / type ext2 (rw,relatime)

This partition is ext3 and it's marked as ext3 in /etc/fstab

cat /etc/fstab | grep lv_root
/dev/hell/lv_root	/		ext3		defaults,relatime	0 1

First I tired to pass rootfstype=ext3 option to grub, but this doesn't change anything. I guess this problem is related to fact I use genkernel initrd image as I have rootfs on LVM (Why genkernel initrd doesn't accept rootfstype ?)

I was able to fix this one by changing order of filesystems in genkernel scripts from:

MODULES_FS="ext2 ext3 reiserfs jfs nfs xfs"

to:

MODULES_FS="ext3 ext2 reiserfs jfs nfs xfs"

Now it seems my root partition is mounted as ext3 as it should be.

mount | grep lv_root
/dev/hell/lv_root on / type ext3 (rw,relatime,data=ordered)

No ideas from where it gets the data=ordered, but this is not a big problem I think.

IMHO this is quite serious one as lack of journal on root volume is nothing good and I am happy there was no more damage here.

Reproducible: Always
Comment 1 Marcin Kurek 2008-05-10 16:41:37 UTC
Created attachment 152751 [details]
emerge --info
Comment 2 Andrew Gaffney (RETIRED) gentoo-dev 2008-05-10 18:03:04 UTC
Afaict, the only way that would make a difference is if you have support for ext[23] compiled as modules in your kernel. Do you?
Comment 3 Marcin Kurek 2008-05-13 06:44:39 UTC
Yes, I have all filesystems compiles as modules and loaded by initrd. Anyway the fix is quite simple in this case and wont harm anyone.
Comment 4 Marcin Kurek 2008-05-18 17:03:49 UTC
Ping ?
Comment 5 Marcin Kurek 2008-06-04 19:13:00 UTC
Ping again ? IMHO this is quite serious one for anyone use filesystem as modules as single crash may lead to data lose and fix is dead simple :/
Comment 6 Andrew Gaffney (RETIRED) gentoo-dev 2008-06-04 19:22:31 UTC
So don't build the support for your root filesystem as a module. Most people will tell you that's a pretty dumb thing to do.
Comment 7 Marcin Kurek 2008-06-05 07:00:37 UTC
I need a filesystems in a modules for a reason and anyway dumb or not it's not for you to judge. It's a problem and some distributions use same method (As Fedora for simple example)

For god sake it's a metter of change a few lines in the scripts it doesn't require any complicated fix'es and patches :/ I must say I was always happy with gentoo support, but this one starts to be ...
Comment 8 Andrew Gaffney (RETIRED) gentoo-dev 2008-06-05 13:10:10 UTC
Yes, Fedora does it this way because they provide a pre-compiled kernel and have no idea what root filesystem type people will be using. You're building your own kernel and have the ability to easily build support for your filesystem as a module.
Comment 9 Marcin Kurek 2008-06-21 09:19:32 UTC
But I need a filesystems as a modules for a reason. First of all I have some dev work on filesystems and modules are much easier to use as I no need to reinstall kernel for each change I made and second thing sometimes I need to test Fedora kernel here (There is sometimes a problem with my ppc machine and fedora kernel and it's better to test it that way and I am definitly unhappy about the possible data lose in case when something goes wrong)

I can not understand your point to be honest :/ You think it's is stupid or not I doesn't care, but this is a problem and it can be easy fixed. Maybe I should attach a patch here or something like that ? Because I see no reason why someone do not want to fix a bug because in his opinion it's stupid :/ Maybe add a check to ebuild is someone use a root partition fs as a module and print a warning then ? But it would be 100 hundred times more compilacated than a few second 'sed blah, blah' usage.

What a braindead support strategy for a package.
Comment 10 Marcin Kurek 2008-06-21 09:26:40 UTC
Created attachment 157875 [details, diff]
A complicated fix for "stupid user uses rootfs as a module"

This is a few second sed usage and looking in genkernel safe fix for my problem as in all places where ext2 is required scripts requesting ext2 by using -t ext2.
Comment 11 Marcin Kurek 2008-07-11 07:14:40 UTC
This problem affects also ext4dev filesystem (compiled in kernel this time) I wanted to test the new ext4, but system fails to boot mormaly (all partitions formated with noextents to makes possible to mount them as ext3 too) when remounting root partition to R/W

The root entry in fstab:
/dev/hell/lv_root / ext4dev defaults,noextents,relatime 0 1

Looking in syslog system complains that noextents option is not valid for ext3. Partition is incorrectly mounted as ext3 by genkernel initrd and there is no way to change this as init script inside always use auto fs recognition. As there is no blkid in initram mount simply try all fs from /proc/filesystems which produce same problem as previous "ext3 incorrectly mounted as ext2"

Part of /proc/filesystems:

 ...
 reiserfs
 ext3
 ext4dev
 ext2
 ...

And as a result ext4dev partitions (propably only with noextents option as they are compatible with ext3) are mounted as ext3.

Change the modules load order would help, but all fs'es are compiled in to kernel this time. I guess there is no real chance for fix for my previous problem then maybe you can add a option to select the fstype for rootfs via kernel command line ?

I attach a simple patch I made as a proposition. Works fine.\
Comment 12 Marcin Kurek 2008-07-11 07:17:48 UTC
Created attachment 160107 [details, diff]
Add a real_rootfs option
Comment 13 Craig Andrews gentoo-dev 2009-01-01 18:44:02 UTC
I can confirm this bug is still valid.

I just installed 2.6.28 and compile ext2, ext3, and ext4 into the kernel. After a reboot, root is mounted using ext3 - it should be mounted using ext4. This would be a serious problem if I had enabled extents on root, as then I wouldn't be able to boot.

The "rootfstype=ext4" kernel command line option should force ext4, but that seems to be ignored (I presume because of the way genkernel works).
Comment 14 Craig Andrews gentoo-dev 2009-01-02 19:03:30 UTC
It looks like this issue is related to http://bugs.gentoo.org/show_bug.cgi?id=213541 - and they probably share the same solution.
Comment 15 Norman Back 2009-01-07 16:32:36 UTC
I'm also experiencing a similar issue but I have both ext3 & ext4 compliled into my kernel.
dmesg show a failed attempt to mount my ext4 root as etc3. However the boot then seems to continue normally.

EXT3-fs: dm-4: couldn't mount because of unsupported optional features (240).
EXT4-fs: barriers enabled
kjournald2 starting.  Commit interval 5 seconds
EXT4-fs: delayed allocation enabled
EXT4-fs: file extents enabled
EXT4-fs: mballoc enabled
EXT4-fs: mounted filesystem with ordered data mode.
Comment 16 whitehawk 2009-01-08 02:32:01 UTC
I have the same problem. I have ext2 and ext3 compiled into the kernel, and my rootfs is mounted as ext2 when it is ext3 and it is set also in fstab.

2.6.27 and .28
Comment 17 whitehawk 2009-01-08 17:00:24 UTC
(In reply to comment #16)
> I have the same problem. I have ext2 and ext3 compiled into the kernel, and my
> rootfs is mounted as ext2 when it is ext3 and it is set also in fstab.
> 
> 2.6.27 and .28
> 

I screwed up my kernel config some time ago as it seems, so it was my fault. Forget what I wrote before.
Comment 18 Jaak Ristioja 2009-01-19 23:44:43 UTC
I'm not using genkernel in any way but I still get this bug on system startup when my / is ext4. This bug should probably be reassigned. Even more so because more and more people will try out ext4 soon.
Comment 19 Balazs Nemeth 2009-01-28 13:29:44 UTC
(In reply to comment #18)
> I'm not using genkernel in any way but I still get this bug on system startup
> when my / is ext4. This bug should probably be reassigned. Even more so because
> more and more people will try out ext4 soon.
> 

Maybe this bug related to this: http://bugs.gentoo.org/show_bug.cgi?id=252880
Comment 20 Jaak Ristioja 2009-03-19 16:53:59 UTC
(In reply to comment #19) 
> Maybe this bug related to this: http://bugs.gentoo.org/show_bug.cgi?id=252880
> 

A version bump for dev-libs/klibc!? I don't even have that installed (nothing in "system" pulls it in), so how should that affect anything?
Comment 21 Ronan Arraes Jardim Chagas 2009-05-12 19:00:20 UTC
I have this problem too. In initialization the following message is showed:

EXT3-fs: sda5: couldn't mount because of unsupported optional features (240)

This problem began after the conversion of my / from ext3 to ext4. But ext4 is correctly mounted and I wasn't able to find any problem.

Here is the dmesg part that confirms that my / partition is mounted as EXT4:

EXT4-fs: barriers enabled
EXT4-fs: delayed allocation enabled
EXT4-fs: file extents enabled
EXT4-fs: mballoc enabled
EXT4-fs: mounted filesystem with ordered data mode.
EXT4 FS on sda5, internal journal on sda5:8

The grub version I'm using is 0.97-r9.
Comment 22 Vince C. 2009-06-28 08:57:36 UTC
(In reply to comment #18)
> I'm not using genkernel in any way but I still get this bug on system startup
> when my / is ext4. This bug should probably be reassigned. Even more so because
> more and more people will try out ext4 soon.

Maybe an element of response, on my system, which was formatted EXT4 from scratch:

# cat /proc/filesystems
...
	reiserfs
	ext3
	ext2
	ext4
...

That means the kernel is first trying ext3 then ext2 and finally ext4, which is the exact order we get the warning messages (first EXT3 then EXT2). So the immediate fix could be kernel argument "rootfstype=ext4".

I'm not using genkernel either.
Comment 23 Balazs Nemeth 2009-06-28 09:46:51 UTC
(In reply to comment #22)
> (In reply to comment #18)
> > I'm not using genkernel in any way but I still get this bug on system startup
> > when my / is ext4. This bug should probably be reassigned. Even more so because
> > more and more people will try out ext4 soon.
> 
> Maybe an element of response, on my system, which was formatted EXT4 from
> scratch:
> 
> # cat /proc/filesystems
> ...
>         reiserfs
>         ext3
>         ext2
>         ext4
> ...
> 
> That means the kernel is first trying ext3 then ext2 and finally ext4, which is
> the exact order we get the warning messages (first EXT3 then EXT2). So the
> immediate fix could be kernel argument "rootfstype=ext4".
> 
> I'm not using genkernel either.
> 

I'm using genkernel and "rootfstype=ext4" kernel parameter. 
Anyway I got these in dmesg. sda2 is my / partition.

EXT3-fs: sda2: couldn't mount because of unsupported optional features (240).
EXT2-fs: sda2: couldn't mount because of unsupported optional features (240).
EXT4-fs: barriers enabled
kjournald2 starting: pid 3443, dev sda2:8, commit interval 5 seconds
EXT4-fs: delayed allocation enabled
EXT4-fs: file extents enabled
EXT4-fs: mballoc enabled
EXT4-fs: mounted filesystem sda2 with ordered data mode
Comment 24 Bernard Tremblay 2010-03-25 00:20:25 UTC
I have the same with a rootfs in ext4 that doesn't get mounted either.

I just have installed a base system (stage 3 plus system) and compiled the kernel.  I can't boot because my / is ext4.  Passing rootfstype=ext4 doesn't change anything.

This bug is getting old.  Any chance of a solution soon ?
 
here is my info
------------------
pluton / # emerge --info
Portage 2.2_rc67 (default/linux/x86/10.0/desktop, gcc-4.3.3, glibc-2.9_p20081201-r2, 2.6.33-gentoo i686)
=================================================================
System uname: Linux-2.6.33-gentoo-i686-Intel-R-_Pentium-R-_M_processor_1.73GHz-with-gentoo-2.1.6
Timestamp of tree: Tue, 23 Mar 2010 05:30:24 +0000
app-shells/bash:     4.0_p35
dev-lang/python:     2.6.5
sys-apps/baselayout: 2.1.6
sys-apps/openrc:     0.6.0
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.65
sys-devel/automake:  1.10.3, 1.11.1
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc:       4.3.3-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.29
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium-m -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -march=pentium-m -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=5 --load-average=5.0 --with-bdeps y"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="fr_CA.UTF-8"
LC_ALL="fr_CA.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed"
LINGUAS="fr"
MAKEOPTS="-j2 -l2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alac alsa berkdb bluetooth branding bzip2 cairo cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr dvdread eds emboss encode evo fam firefox flac fortran gdbm gif gnome gpm gstreamer gtk hal iconv ipv6 jpeg kde lame ldap libnotify mad mikmod mng modules mp3 mp4 mpeg mudflap ncurses nls nptl nptlonly ogg opengl openmp pam pcre pdf perl png ppds pppd python qt3support qt4 quicktime readline reflection sdl session spell spl ssl startup-notification svg sysfs tcpd thunar tiff truetype unicode usb userlocales vorbis wavpack win32codecs x264 x86 xml xorg xscreensaver xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="vesa intel" 
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
---------------------------
Here is my partition layout:
---------------------------

(parted) print                                                            
Modèle: ATA WDC WD1200BEVE-0 (scsi)
Disque /dev/sda : 120GB
Taille des secteurs (logiques/physiques): 512B/512B
Table de partitions : msdos

Numéro  Début   Fin     Taille  Type      Système de fichiers  Fanions
 3      32,3kB  1078MB  1077MB  primary   ext3                 démarrage
 1      1078MB  20,5GB  19,4GB  primary   ext4
 2      20,5GB  41,8GB  21,3GB  primary   ext4
 4      41,8GB  120GB   78,3GB  extended
 5      41,8GB  42,8GB  1028MB  logical   ext3
 6      42,8GB  63,3GB  20,5GB  logical   ext3
 7      63,3GB  90,1GB  26,8GB  logical   ext4
 9      90,1GB  118GB   28,1GB  logical   ext4
 8      118GB   120GB   1859MB  logical   linux-swap(v1)
------------------------------------------------------------
/boot is on sda3 (ext3)
/     is on sda9 (ext4)
--------------------------------------------------------------
my grub lines are:
------------------------
root    (hd0,8)
kernel  (hd0,2)/kernel-2.6.33-gentoo rootfstype=ext4 root=/dev/sda9 ro quiet video-1024x768 nf_conntrack.acct=1
quiet

 
Comment 25 Angelo Arrifano (RETIRED) gentoo-dev 2010-05-09 20:29:13 UTC
My remote computer stopped booting because the rootfs (ext4) is being mounted as readonly (by linux) and the init script doesn't remount it as rw.
Even worse, /home which is a ext4 mount point doesn't mount at all. Since I'm using public-key authentication on ssh with the root account and PAM disabled, having /home unmounted prevented me from logging in!

No, I don't have extX built as modules, they are built-in.

I suspect this is caused by my last update to sys-apps/openrc-0.6.0-r1 , did you also upgrade openrc?

- -

EXT3-fs: hda2: couldn't mount because of unsupported optional features (240).
EXT2-fs: hda2: couldn't mount because of unsupported optional features (240).
EXT4-fs (hda2): barriers enabled
kjournald2 starting: pid 1067, dev hda2:8, commit interval 5 seconds
EXT4-fs (hda2): internal journal on hda2:8
EXT4-fs (hda2): delayed allocation enabled
EXT4-fs: file extents enabled
EXT4-fs: mballoc enabled
EXT4-fs (hda2): mounted filesystem with ordered data mode
VFS: Mounted root (ext4 filesystem) on device 3:2.
Comment 26 Bernard Tremblay 2010-05-11 00:01:44 UTC
(In reply to comment #25)
It is possible to mount both ext3 (and ext2, in kernels 2.6.28 and later) filesystems directly using the ext4 filesystem driver. 
See https://ext4.wiki.kernel.org/index.php/Ext4_Howto

So you'd need only ext4 module to be loaded before or compiled in kernel.

regards,

        BT
Comment 27 Angelo Arrifano (RETIRED) gentoo-dev 2010-05-11 13:16:41 UTC
(In reply to comment #25)
> My remote computer stopped booting because the rootfs (ext4) is being mounted
> as readonly (by linux) and the init script doesn't remount it as rw.

I just found that /etc/runlevels/boot/{root,localmount} etc.. were missing. I wonder how these got deleted during a emerge -u world . So, my comment is now totally unrelated to this bug.

> Even worse, /home which is a ext4 mount point doesn't mount at all. Since I'm
> using public-key authentication on ssh with the root account and PAM disabled,
> having /home unmounted prevented me from logging in!

"rc-update add localmount boot" fixed it
> 
> No, I don't have extX built as modules, they are built-in.
> 
> I suspect this is caused by my last update to sys-apps/openrc-0.6.0-r1 , did
> you also upgrade openrc?
> 
> - -
> 
> EXT3-fs: hda2: couldn't mount because of unsupported optional features (240).
> EXT2-fs: hda2: couldn't mount because of unsupported optional features (240).
> EXT4-fs (hda2): barriers enabled
> kjournald2 starting: pid 1067, dev hda2:8, commit interval 5 seconds
> EXT4-fs (hda2): internal journal on hda2:8
> EXT4-fs (hda2): delayed allocation enabled
> EXT4-fs: file extents enabled
> EXT4-fs: mballoc enabled
> EXT4-fs (hda2): mounted filesystem with ordered data mode
> VFS: Mounted root (ext4 filesystem) on device 3:2.
> 

These warnings can be fixed by adding ext4 to top of /etc/filesystems .
Comment 28 Seth Shelnutt 2010-05-19 15:27:37 UTC
I am having the same issue. I've built a kernel from gentoo-sources, and I have compiled in all the fs drivers. I am using an initrd from genkernel to boot my raid 0 array. The root filesystem mounts as ext2 instead of ext4. I get two errors in my kernel log:

[    0.223341] EXT4-fs: Unable to register as ext3 (-16)


[    8.603928] EXT3-fs (dm-4): error: couldn't mount because of unsupported optional features (240)
[    8.622661] EXT4-fs (dm-4): mounted filesystem with ordered data mode

I am almost positive this is due to the genkernel initrd. Do the patches from 2008 still work?
Comment 29 Lance Lassetter 2010-08-11 00:57:07 UTC
upgrading klibc fixed the problem

# equery depends klibc 
 * These packages depend on klibc:
media-gfx/splashutils-1.5.4.3-r3 (>=dev-libs/klibc-1.5)
sys-apps/v86d-0.1.9 (dev-libs/klibc)

dev-libs/klibc-1.5.12-r1 to dev-libs/klibc-1.5.15-r1

# eix klibc
[I] dev-libs/klibc
     Available versions:  (~)1.1!s 1.5.8!s (~)1.5.11!s (~)1.5.12!s 1.5.12-r1!s (~)1.5.15!s (~)1.5.15-r1!s {debug kernel_linux n32}
     Installed versions:  1.5.15-r1!s(07:27:41 PM 08/10/2010)(-debug -n32)
     Homepage:            http://www.zytor.com/mailman/listinfo/klibc
     Description:         A minimal libc subset for use with initramfs.

The installed version I have is ~amd64.
Comment 30 samnew 2010-08-12 13:12:53 UTC
(In reply to comment #28)
> I am having the same issue. I've built a kernel from gentoo-sources, and I have
> compiled in all the fs drivers. I am using an initrd from genkernel to boot my
> raid 0 array. The root filesystem mounts as ext2 instead of ext4. I get two
> errors in my kernel log:
> 
> [    0.223341] EXT4-fs: Unable to register as ext3 (-16)
> 
> 
> [    8.603928] EXT3-fs (dm-4): error: couldn't mount because of unsupported
> optional features (240)
> [    8.622661] EXT4-fs (dm-4): mounted filesystem with ordered data mode
> 
> I am almost positive this is due to the genkernel initrd. Do the patches from
> 2008 still work?
> 


I have a problem like this ,I am using an initrd from genkernel to boot ,The root filesystem is under LVM ,mounts as ext2 instead of ext4 ,and the patch is not work
Comment 31 Nathan Caldwell 2010-09-21 07:06:47 UTC
I have a similar issue to samnew.

My rootfs is ext4. If I compile ext4 in the kernel with the CONFIG_EXT4_USE_FOR_EXT23 option set, my rootfs gets mounted as ext2.

The current workaround I'm using is ext4 compiled in with CONFIG_EXT4_USE_FOR_EXT23 unset, and ext3 as a module.
Comment 32 Mauricio L. Pilla (RETIRED) gentoo-dev 2010-09-27 19:47:12 UTC
Bug also hit me after the last system update... before that it used to work. 
Comment 33 Roger 2010-10-20 04:11:14 UTC
I started seeing this bug as well with my rootfs without using initramfs.  Funny, I recall my other Intel P3 laptop doesn't display this bug, but is configured very similar to this box here.
Comment 34 Roger 2010-10-20 04:18:45 UTC
Adding ext4 to the /etc/filesystems doesn't help either.

I'm guessing, making ext2, ext3 as modules and ext4 static will likely subside the warnings as well.

At first, I thought the problem was initiated when I upgrade from an ext3 rootfs to ext4 using the upgrade process instead of reformatting and starting anew.  Guess not because I just reformatted and started anew a few days ago and the bug is still persistent!
Comment 35 Roger 2010-10-20 04:43:30 UTC
Found the reason my laptop doesn't complain, the ext4 rootfs is being initially mounted as an ext3... dmesg shows:
EXT3-fs (sda2): mounted filesystem with ordered data mode

But mount shows:
/dev/sda2 on / type ext4 (rw,noatime)

The laptop was a simple upgrade from ext3 to ext4 filesystem.

/etc/fstab does state to use ext4.
Comment 36 Nick Hadaway 2010-12-19 11:25:26 UTC
Has anybody tried specifying rootfstype="ext4" on your kernel commandline via grub.conf or lilo.conf?
Comment 37 Mauricio L. Pilla (RETIRED) gentoo-dev 2010-12-19 11:46:42 UTC
I have "fixed" it by excluding ext2 from my kernel. I may try Nick's solution later.
Comment 38 Roger 2010-12-19 13:15:46 UTC
Using suggestion from Comment #13:

$ dmesg |grep EXT
EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
EXT4-fs (sda2): re-mounted. Opts: (null)
EXT3-fs: barriers not enabled

I would call it hackish for now but it works, so user doesn't need to see a frivolous warning message.

This is likely an upstream bug.  Has it been reported upstream yet?  Should the finger point to init or kernel?
Comment 39 Kevin 2010-12-31 05:33:14 UTC
I encountered this problem with gentoo-sources-2.6.36-r5 on a fresh install. I got two error messages one from ext3 and the second from ext2 about how it could not mount the partition because of the extra features it had and it had the code 240 at the end.

I compiled into my kernel ext2, ext3 and ext4. My root partition is ext4. I was able to get my system to boot by adding the rootfstype="ext4" to my kernel command line in grub.conf.
Comment 40 Sebastian Pipping gentoo-dev 2011-01-05 22:41:56 UTC
PS: Adding keyword "Inclusion" and "[patch] " prefix to better show this bugs nature in searches...
Comment 41 Gil Kloepfer 2011-05-30 17:59:13 UTC
I'm seeing the same behavior as Nathan Caldwell reported (thanks Nathan, although I missed your entry until after I figured out the same thing you did!!).

It seems like the mount command in busybox always wants to mount the filesystem as ext2 by default with CONFIG_EXT4_USE_FOR_EXT23 set.  I haven't entirely tested what happens when ext3 and ext2 are both in the kernel, but I suspect that (since at one time this did really work) that the param to the ext4 filesystem is what the trouble is.  It's actually (in a way) a bug in ext4 I think in that it doesn't autodetect ext3 and default to that.

Also, for Marcin's "data=ordered" question:  take a look at CONFIG_EXT3_DEFAULTS_TO_ORDERED, which is set by default in newer kernels.

I'm thinking this whole bug may be due to a few problematic kernel parameters.

It would be nice, though, to have a real_rootfs option.  It seems like a pretty simple addition with a great deal of choice (what Gentoo is all about) if we need to use it.

Another, more complex, fix would be to have linuxrc mount the root filesystem read-only (as it is now), parse the /etc/fstab file and get the root fstype out of there, umount the root filesystem, and then mount it again with the fstype specified from the fstab file.
Comment 42 Sebastian Pipping gentoo-dev 2011-05-31 02:58:43 UTC
As of my current understanding:

1) If we were to use /etc/filesystems it would have to be "ext4 ext3 ext2 *" for CONFIG_EXT4_USE_FOR_EXT23=y and maybe "ext3 ext2 ext4 *" else. The file would need to be written at boot time.

2) rootfstype= only applies when the kernel mounts root itself, i.e. without an initramfs around

3) the initramfs could support rootfstype= by itself and pass that to its call to mount.

Adjusting Marcin's real_rootfs= patch should be easy.  Any thoughts?


Btw I'm renaming this bug so we can close bug #213541 as a duplicate after.
Comment 43 Sebastian Pipping gentoo-dev 2011-05-31 03:03:17 UTC
*** Bug 213541 has been marked as a duplicate of this bug. ***
Comment 44 Xake 2011-05-31 12:06:35 UTC
(In reply to comment #42)
> As of my current understanding:
> Adjusting Marcin's real_rootfs= patch should be easy.  Any thoughts?
> 

Go for it!
One of my aims with genkernel is currently to try and unify the arguments of the ramdisk with the ones for the kernel (i.e. use rdinit, root and init instead of homebrewn things like real_*) to ease documentation and usage of configuration tools for bootloader.
Comment 45 Sebastian Pipping gentoo-dev 2011-05-31 13:19:53 UTC
Patch now in Git:
http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commitdiff;h=fad624bc41b33f7bf418845f677caa49a33b6a94

Please test it and report back.  The live ebuild sys-kernel/genkernel-9999 may be of use to that.
Comment 46 Sebastian Pipping gentoo-dev 2011-06-07 22:34:59 UTC
Fixed in genkernel 3.4.16, closing.