# [SOLVED]Can't mount root file system after building new kern

## Gear.0

My old kernel still works fine, which was linux-2.6.34-gentoo-r1

I just finished configuring and compiling linux-2.6.35-gentoo-r12

But when I try to boot from it I see this:

```
 * Checking root filesystem ...

/dev/sda3: clean, 481993/3563520 files, 3936582/14247646 blocks

 * Remounting root filesystem read/write ...

 * Root filesystem could not be mounted read/write :(

Give root password for maintenance

(or type Control-D to continue):_
```

It actually displays that sad face lol.

Anyways, it looks to me that it is unable to finish the filesystem check for some reason.

What is even stranger is I think that it actually does mount everything correctly before it tries to do the filesystem check.. i can't be completely sure because right at that point the monitor decides to change resolution so all of the previous text gets cut off, but from what I can see really quickly, it looks like it is running a bunch of mount commands which end successfully..

Also, it says remounting so I'm guessing that the system check unmounts it maybe and then doesn't complete correctly, and then fails to remount it.

Any thoughts?

I am using ext4, and I have built in the capabilities for that, and some ext3 as well.Last edited by Gear.0 on Tue Dec 14, 2010 12:39 am; edited 1 time in total

----------

## Logicien

Because it is say 

```
/dev/sda3: clean
```

the filesystem check ended successfully. Remounting the root filesystem read/write depend for sure of your kernel configuration and the contain of the line for the root filesystem in /etc/fstab plus, the defaults mount options when you create the filesystem. If you have an initrd, the remount rw problem can come from there.

----------

## Gear.0

I don't have initrd

Here is my /etc/fstab

```

/dev/sda1        /boot        ext2        defaults,noatime        1 2

/dev/sda3        /              ext4        noatime                     0 1

/dev/sda2        none         swap      sw                             0 0

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

proc                /proc         proc       defaults                     0 0

```

sorry for the bad formatting..

you can go here to see it a little better while the link lasts.

http://pastebin.com/nsxZBGC1

----------

## jburns

Add defaults option in /etc/fstab

```
/dev/sda3        /              ext4       defaults,noatime                     0 1 
```

----------

## Gear.0

I added defaults, so that it now reads

defaults,noatime

and I observed no change.

I even tried a second time after running

grub-install --no-floppy /dev/sda

I wasn't sure if that would help or not.. but it didn't make a difference.

----------

## Logicien

The line of the root partition must come before any partition who need a mount point in / . Only the swap partition in principle can preceed it. If you try to mount the /boot partition, as you try to do, before the / partition is mount, there will be no mount point for the /boot partition. Consequently, the /boot directory must exist in the root partition. As I know, the mount command mount everythings possible in  fstab by the lines order it contain. In plus, some inappropriates kernel boot parameters can effect the boot process. If the change of /etc/fstab do not resolv the problem, you can look that way.

----------

## Gear.0

I made the changes placing the /dev/sda3 and / line at the top, and the problem persists..

Also, I am not using any boot parameters. It looks like this in grub.conf

```
default 0

timeout 30

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Gentoo Linux 2.6.35-r12

root (hd0,0)

kernel /boot/kernel-2.6.35-gentoo-r12 root=/dev/sda3
```

----------

## rh1

I'd compare your working kernel's config to your new kernels config. The fact that the old kernel works fine tells me fstab, grub.conf, ect.. should be fine. Did you try using your old config file and "make oldconfig" on your new kernel?

----------

## nativemad

Hi, 

i suspect a failure in /etc/init.d/checkroot...

You can circumvent the check by a "touch /fastboot".

At least you can then see if it's the kernel that makes trouble or the init script...  :Wink: 

Hth, Cheers

----------

## Logicien

If the old kernel worked then the modification I suggest can be useless but, in your grub.conf, you have

```
kernel /boot/kernel-2.6.35-gentoo-r12 root=/dev/sda3
```

Do you have a boot directory or a symbolic link call boot that point to the root directory of /dev/sda1? If no, you should create one of it or the line should be

```
kernel /kernel-2.6.35-gentoo-r12 root=/dev/sda3
```

If you do not specify ro as boot kernel parameter, then the root directory can be already mount read and write, so it is impossible to remount it read/write again. I propose to add ro as boot kernel parameter

```
kernel /boot/kernel-2.6.35-gentoo-r12 ro root=/dev/sda3
```

or maybe

```
kernel /kernel-2.6.35-gentoo-r12 ro root=/dev/sda3
```

----------

## Gear.0

AH, I solved it  :Very Happy: 

The problem was that I forgot to turn on the kernel option:

Support for large (2TB+) block devices and files

I don't have anywhere near even 1TB, so I didn't think to turn it on, but if you go into the help it says at the bottom:

```
The ext4 filesystem requires that this feature be enabled in

order to support filesystems that have the huge_file feature

enabled.  Otherwise, it will refuse to mount in the read-write

mode any filesystems that use the huge_file feature, which is

enabled by default by mke2fs.ext4.
```

Well all I did was turn this on, recompile, and install the kernel and it mounts the filesystem properly.

Thanks for helping me.

----------

## painteru

 *Gear.0 wrote:*   

> AH, I solved it 
> 
> The problem was that I forgot to turn on the kernel option:
> 
> Support for large (2TB+) block devices and files
> ...

 

Oh fkn!!!  this was my problem, too ! 

I though that I'm getting crazy after my system was f up by the prelink and the new glibc ( or glib? I forgot)

Unfortunately, I didn't check the forum for a solution to segfault so I did a reinstall since I couldn't solve that myself...

Well, I said myself to disable in the new kernel the support for large block device since my hdd is only 160 Gb ... big mistake using ext4

Thank you very much for solution!

----------

