# 2.6.35: why does kernel try to mount ext4 as ext2 first?

## low

this is the output i get from dmesg:

```
[    3.076021] EXT2-fs (sda3): error: couldn't mount because of unsupported optional features (240)

[    3.101201] EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: (null)

[    3.102564] VFS: Mounted root (ext4 filesystem) readonly on device 8:3.
```

on 2.6.34 it was mounting my ext4 root as ext2 for some reason but i was too lazy to ask about it. now that i upgraded my kernel i'm still curious. one thought i had to explain this behavior was the kernel option to use ext4 for ext2/ext3 partitions to save kernel space, which i had enable on 34 but have disabled it on 35. here is my fstab:

```
# /etc/fstab: static file system information.

#

# noatime turns off atimes for increased performance (atimes normally aren't 

# needed; notail increases performance of ReiserFS (at the expense of storage 

# efficiency).  It's safe to drop the noatime options if you want and to 

# switch between notail / tail freely.

#

# The root filesystem should have a pass number of either 0 or 1.

# All other filesystems should have a pass number of 0 or greater than 1.

#

# See the manpage fstab(5) for more information.

#

# <fs>         <mountpoint>   <type>      <opts>      <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

UUID=2d0bbe0f-ea0c-41a7-a792-7498d1d624b5   /boot   ext2   relatime   1 2

UUID=567eaf34-37d3-40e1-85de-19ac1cd5806c   /   ext4   relatime   0 1

UUID=6d7bc62b-dbc7-4943-95b7-dca742a333a8   none   swap   sw   0 0

UUID=a83ec661-5cc9-42b3-b5b7-ed92c16eb4d1   /home   ext4   relatime   0 2

/dev/cdrom      /mnt/cdrom   auto      noauto,ro   0 0

#/dev/fd0      /mnt/floppy   auto      noauto      0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for 

# POSIX shared memory (shm_open, shm_unlink).

# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will

#  use almost no memory if not populated with files)

shm   /dev/shm   tmpfs   nodev,nosuid,noexec   0 0

proc   /proc      proc   defaults      0 0

```

and my partition table:

```
Number  Start (sector)    End (sector)  Size       Code  Name

   1            2048          264191   128.0 MiB   0700  Linux/Windows data

   2          264192          266239   1024.0 KiB  EF02  BIOS boot partition

   3          266240        33820671   16.0 GiB    0700  Linux/Windows data

   4        33820672        42209279   4.0 GiB     8200  Linux swap

   5        42209280       312581774   128.9 GiB   0700  Linux/Windows data

```

----------

## Randy Andy

Hi low  (either or: hi or low)  :Laughing: 

```
[    3.076021] EXT2-fs (sda3): error: couldn't mount because of unsupported optional features (240) 

[    3.101201] EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: (null) 

[    3.102564] VFS: Mounted root (ext4 filesystem) readonly on device 8:3. 
```

This is a more expressive, but normal kernel message. I've noticed it too, since some kernel releases. 

AFAIK this is to show what the kernel does while trying to recognize the filesystem of the root device oft your kernel line.

At this time your ext2 (/boot) filesystem is already in use, cause the kernel is booting from it.

Now it tries to detect your root partition, starting with the lowest extension.

"kernel"  lets look, is it ant ext2 - no

ist it an ext3 - no

is it an ext4 - ah, yes, it is, so let it mount with these options...

So don't worry about it.

Regards, Andy.

----------

## dlaor

You can specify the file system of your root partition to be ext4 by putting the following option in the kernel line in grub.conf

```
rootfstype=ext4

```

My kernel line looks like this

```
kernel /boot/kernel-2.6.35-gentoo-r5 root=/dev/sda2 rootfstype=ext4 ... [other options]

```

Hope that works!

----------

## Jaglover

Build EXT2 support as module and the EXT2 line will disappear from dmsg.

----------

## low

 *Jaglover wrote:*   

> Build EXT2 support as module and the EXT2 line will disappear from dmsg.

 

can't do that cause i need ext2 for my /boot partition. thanks for the replies, i'll use rootfstype=ext4 and try my luck.

----------

## Manko10

Add

```
rootfstype=ext4
```

to your Kernel options in grub.conf and you'll get rid of this message.

[EDIT]

Too slow.

[EDIT2]

Oh, and that's already being said ways before. But yes, rootfstype will work.  :Very Happy: 

----------

## Shining Arcanine

Compile your kernel without EXT2 support. Toggle the CONFIG_EXT4_USE_FOR_EXT23 kernel option and everything should just work.

Another option is to reformat your boot partition to be ext4.

----------

## d2_racing

Yeah you can do that, I noticed that too on my box.

----------

## Hu

OP: when posting /etc/fstab, it is helpful to post it in a form that can be consumed by those of us who cannot read the UUIDs off your disk.  :Wink: 

 *Randy Andy wrote:*   

> At this time your ext2 (/boot) filesystem is already in use, cause the kernel is booting from it.

 No.  The kernel does not need to touch the boot filesystem at all, because Grub (or some other boot loader) has already placed the kernel and initramfs in memory.  This quirk is what allows people to get themselves into the situation that they are running a kernel that cannot mount /boot to let them install a new kernel.

----------

## Shining Arcanine

 *Hu wrote:*   

> OP: when posting /etc/fstab, it is helpful to post it in a form that can be consumed by those of us who cannot read the UUIDs off your disk. 
> 
>  *Randy Andy wrote:*   At this time your ext2 (/boot) filesystem is already in use, cause the kernel is booting from it. No.  The kernel does not need to touch the boot filesystem at all, because Grub (or some other boot loader) has already placed the kernel and initramfs in memory.  This quirk is what allows people to get themselves into the situation that they are running a kernel that cannot mount /boot to let them install a new kernel.

 

In such a situation, would it be possible to compile ext2 as a kernel module and load it, or would things in the kernel binary have to change to support that?

----------

## Hu

I believe I have read of people building ext2 as a module in that situation.  However, there are some situations where a module and the running kernel must be built with the same .config so that the kernel exports functionality required by the module.

----------

## sparrow1

I think this behaviour exist because mounting ext2 as ext4 should be possible, but will upgrade filesystem in-place and thus make it (potentially) incompatible with boot loader for example.

----------

## Hu

You can mount ext2 using the ext4 kernel driver, but that does not convert it to an ext4 filesystem.  It remains ext2 until you change it using tune2fs.

----------

## Corona688

 *low wrote:*   

>  *Jaglover wrote:*   Build EXT2 support as module and the EXT2 line will disappear from dmsg. 
> 
> can't do that cause i need ext2 for my /boot partition.

  So what? Your kernel doesn't need to read the /boot partition to boot.  That's grub's job.

----------

## Etal

There's actually no need for any workarounds - there's nothing to worry about. According to Theodore Ts'o, it's just a cosmetic issue.

----------

