LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-23-2010, 01:22 PM   #1
rfernandez
Member
 
Registered: Mar 2010
Location: Brazil
Distribution: Slackware64
Posts: 264

Rep: Reputation: 41
/dev/root with EXT4-FS being mounted as EXT2-FS?


Hi, everybody. First of all, sorry for this (probably dumb) question, but I'd like to know if this is some kind of problem or just an esthetic issue.

Here is the thing: I'm on Slackware-current and I've got a /dev/sda1 (the root partition) formatted as ext4. The output of /etc/fstab is:

Code:
/dev/sda2            swap                    swap        defaults                     0   0
/dev/sda1            /                            ext4         defaults                     1   1
/dev/sda3            /home                 ext4         defaults                     1   2
#/dev/cdrom      /mnt/cdrom       auto          noauto,owner,ro    0   0
/dev/fd0              /mnt/floppy       auto          noauto,owner         0   0
devpts                 /dev/pts               devpts     gid=5,mode=620   0   0
proc                     /proc                    proc         defaults                     0   0
tmpfs                  /dev/shm             tmpfs       defaults                     0   0
But, my /etc/mtab looks like this:

Code:
/dev/root / ext2 rw,relatime,barrier=1,data=ordered 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
usbfs /proc/bus/usb usbfs rw 0 0
/dev/sda3 /home ext4 rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
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.
 
Old 03-23-2010, 02:22 PM   #2
koenigdavidmj
Member
 
Registered: Oct 2009
Posts: 73

Rep: Reputation: 25
Please list the output of the `mount` command.
 
Old 03-23-2010, 05:27 PM   #3
rfernandez
Member
 
Registered: Mar 2010
Location: Brazil
Distribution: Slackware64
Posts: 264

Original Poster
Rep: Reputation: 41
mount = `cat /etc/mtab`
 
Old 03-24-2010, 01:54 AM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Sorry, mount != `cat /etcmtab`
Not the same on most systems and definitely not on Slackware.
 
Old 03-24-2010, 09:26 AM   #5
rfernandez
Member
 
Registered: Mar 2010
Location: Brazil
Distribution: Slackware64
Posts: 264

Original Poster
Rep: Reputation: 41
@gnashley

Sorry... I meant that the output of "mount" is the same output as "cat /etc/mtab", well, at least here, it is.
 
Old 03-24-2010, 03:53 PM   #6
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Post the output of the two commands.
 
Old 03-24-2010, 08:58 PM   #7
rfernandez
Member
 
Registered: Mar 2010
Location: Brazil
Distribution: Slackware64
Posts: 264

Original Poster
Rep: Reputation: 41
Code:
rodrigo@darkstar:~$ mount
/dev/root on / type ext2 (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)
rodrigo@darkstar:~$ cat /etc/mtab
/dev/root / ext2 rw,relatime,barrier=1,data=ordered 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
usbfs /proc/bus/usb usbfs rw 0 0
/dev/sda3 /home ext4 rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
 
Old 03-25-2010, 09:02 AM   #8
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,559

Rep: Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426
Quote:
Originally Posted by rfernandez View Post
Hi, everybody. First of all, sorry for this (probably dumb) question, but I'd like to know if this is some kind of problem or just an esthetic issue.

Here is the thing: I'm on Slackware-current and I've got a /dev/sda1 (the root partition) formatted as ext4. The output of /etc/fstab is:

Code:
/dev/sda2            swap                    swap        defaults                     0   0
/dev/sda1            /                            ext4         defaults                     1   1
/dev/sda3            /home                 ext4         defaults                     1   2
#/dev/cdrom      /mnt/cdrom       auto          noauto,owner,ro    0   0
/dev/fd0              /mnt/floppy       auto          noauto,owner         0   0
devpts                 /dev/pts               devpts     gid=5,mode=620   0   0
proc                     /proc                    proc         defaults                     0   0
tmpfs                  /dev/shm             tmpfs       defaults                     0   0
But, my /etc/mtab looks like this:

Code:
/dev/root / ext2 rw,relatime,barrier=1,data=ordered 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
usbfs /proc/bus/usb usbfs rw 0 0
/dev/sda3 /home ext4 rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
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.

For creating a proper initrd, you can try:

Code:
mkinitrd -c -k $(uname -r) -f ext4 -r /dev/sda1 -m crc16:jbd2:mbcache:ext4 -o /boot/initrd-$(uname -r).gz
<EDIT>

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.
 
Old 03-25-2010, 10:32 AM   #9
rfernandez
Member
 
Registered: Mar 2010
Location: Brazil
Distribution: Slackware64
Posts: 264

Original Poster
Rep: Reputation: 41
@LuckyCyborg

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
 
Old 03-25-2010, 10:52 AM   #10
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,559

Rep: Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426
Well... Your EXT4FS driver have support for EXT2/EXT3 too.

Try to use (the old good method of) EXT2FS as built-in and CONFIG_EXT4_USE_FOR_EXT23=n. Some times, the drivers can make funny things... ;-)

Last edited by LuckyCyborg; 03-25-2010 at 10:54 AM.
 
Old 03-25-2010, 11:05 AM   #11
rfernandez
Member
 
Registered: Mar 2010
Location: Brazil
Distribution: Slackware64
Posts: 264

Original Poster
Rep: Reputation: 41
@LuckyCyborg

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. =)
 
Old 03-27-2010, 02:46 AM   #12
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,559

Rep: Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426Reputation: 3426
Cool

As bottom line.

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...
 
Old 03-27-2010, 03:22 AM   #13
rfernandez
Member
 
Registered: Mar 2010
Location: Brazil
Distribution: Slackware64
Posts: 264

Original Poster
Rep: Reputation: 41
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.
 
Old 11-24-2012, 08:41 AM   #14
jon_perez
LQ Newbie
 
Registered: Mar 2005
Posts: 6

Rep: Reputation: 0
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'?
 
  


Reply

Tags
current, filesystem, fs, fstab, mount, udev



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOS] a partition on backup drive can't be mounted , detected as ext4 gary4gar Linux - Newbie 9 10-20-2008 07:24 AM
After SDcard changed to ext2 from ntfs, card can't be mounted mongoosecage Linux - Hardware 2 07-08-2008 08:26 AM
Mount command says / is mounted from /dev/hda4, but I know its /dev/hda1 trewsfan Linux - Software 2 08-30-2006 10:01 PM
mounted as: /dev/hdb3 but listed as /dev/hda3 R2D2RABEAU Linux - Newbie 4 07-12-2006 09:10 AM
I'm getting a "VFS: Mounted root (ext2 filesystem) lockup HGeneAnthony Linux - Hardware 1 04-23-2003 01:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration