[SOLVED] /dev/root with EXT4-FS being mounted as EXT2-FS?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Now, the funny thing is that I haven't compiled my kernel (2.6.33.1) with ext2 support, and this is why i suspect this is an esthetic issue (but, I have to be sure, you know?). dmesg shows something like this:
Code:
[ 4.368999] EXT4-fs (sda1): mounted filesystem with ordered data mode
[ 4.372979] VFS: Mounted root (ext2 filesystem) readonly on device 8:1.
So, I really don't know, but I'd like to. =)
Other thing, I noted that the "/dev/root" symlink points to sda1 (of course), but, under the
/dev/.udev/links/root/b8:1
symlink points to
/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1
instead of /sys/device ..., but, would this be a problem?
Now, the funny thing is that I haven't compiled my kernel (2.6.33.1) with ext2 support, and this is why i suspect this is an esthetic issue (but, I have to be sure, you know?). dmesg shows something like this:
Code:
[ 4.368999] EXT4-fs (sda1): mounted filesystem with ordered data mode
[ 4.372979] VFS: Mounted root (ext2 filesystem) readonly on device 8:1.
So, I really don't know, but I'd like to. =)
Other thing, I noted that the "/dev/root" symlink points to sda1 (of course), but, under the
/dev/.udev/links/root/b8:1
symlink points to
/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1
instead of /sys/device ..., but, would this be a problem?
Thanks in advance.
I assume that you have a kernel configuration similar to generic, so EXT4FS is compiled as a module and Santa Claus of Linux saved your ass by a gracious kernel panic, somehow managing to mount the root partition using the built-in EXT2FS driver.
Use a initrd or rebuild the kernel with a proper EXT4FS built-in.
I tried to reproduce the problem in a virtual machine, and it appears only if you have an incorrect initrd (-f ext2) that mounts the root partition as EXT2FS. So you have to rebuild the initrd.
Last edited by LuckyCyborg; 03-25-2010 at 09:52 AM.
I haven't installed ext2 support, neither as a module. I have built-in ext4 and ext3 as a module (the ext4 was built-in because then I won't need an initrd image). This is some of the .config output:
Code:
# CONFIG_EXT2_FS is not set
CONFIG_EXT3_FS=m
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT23=y
CONFIG_EXT4_FS_XATTR=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
# CONFIG_EXT4_DEBUG is not set
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
So, if the system is really mounting /dev/root as ext2, then I don't know where this module came from.
Wops... seems that this line
Code:
CONFIG_EXT4_USE_FOR_EXT23=y
has something in it, I'll take a look into it and post something about it.
Last edited by rfernandez; 03-25-2010 at 10:34 AM.
Reason: Something new founded
Totally agree with you. I just recompiled the kernel with CONFIG_EXT4_USE_FOR_EXT23=n, but without ext2fs. Now, the output is just the expected one:
Code:
rodrigo@darkstar:~/Source$ mount
/dev/root on / type ext4 (rw,relatime,barrier=1,data=ordered)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda3 on /home type ext4 (rw)
tmpfs on /dev/shm type tmpfs (rw)
Now, I wonder why this happend and I'm almost sure that that was just an esthetic issue. But, thank you, anyway. =)
Well, this problem is not only a esthetical one. Let's see what says a stock 2.6.33 (in a virtual machine):
Code:
Mar 26 12:59:06 darkstar kernel: EXT3-fs (sda1): error: couldn't mount because of unsupported optional features (240)
Mar 26 12:59:06 darkstar kernel: EXT2-fs (sda1): error: couldn't mount because of unsupported optional features (240)
Mar 26 12:59:06 darkstar kernel: VFS: Mounted root (ext4 filesystem) readonly on device 8:1.
So, for a EXT4FS root partition, kernel try to use EXT3FS, EXT2FS and finally EXT4FS driver. In your case, the EXT4FS driver also support EXT2. After EXT3FS driver gracious protest that this baby is not his problem, EXT4FS driver accept to mount the root partition AS EXT2.
What's wrong with mounting a EXT4 partition as EXT2? Well, the journaling is disabled. A simple power loss will create a big trouble, because the filesystem utilities will treat the dirty partition as EXT4 and his journal is NOT updated long time ago. That's very bad for your data...
This is very, very interesting... The partitions are formatted as EXT4-FS, so, they are EXT4-FS (I haven't ran cfdisk since Slackware installation nor mke2fs) and yet the system mounts the partition as EXT2-FS. Even more interesting, is that this begin to happen *after* kernel install 2.6.33.1, on kernel 2.6.32.9, everything was ok.
The bottom line:
Partitions *are not* EXT2-FS, but only the *root* partition were mounted so.
This all began with kernel 2.6.33.1
Another interesting thing:
Code:
Allow the ext4 file system driver code to be used for ext2 or
ext3 file system mounts. This allows users to reduce their
compiled kernel size by using one file system driver for
ext2, ext3, and ext4 file systems.
kernel help about CONFIG_EXT4_USE_FOR_EXT23.
Really, the problem is solved, but I have no idea at all about what happend.
This problem surfaced for me in 2.6.37.6 (Slackware 13.37), when I used virtio for the disks, e.g. /dev/root got mapped to /dev/vda1 and was being mounted as ext2.
CONFIG_EXT4_USE_FOR_EXT23=n did solve the problem, but I haven't tracked down why this was happening.
Looking through /etc/rc.d/rc.S didn't yield answers for me, but it's probably there somewhere. Could be a bug with 'mount'?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.