# Kernel panic, root fs not found, initramfs w/o /linuxrc

## jwezel

I joined the lines of those no longer able to boot the kernel because it couldn't open the root fs.

Here is a screenshot (taken with cam and gimped heavily, how to get a console shot in software?): http://s18.postimage.org/xljjb7ijd/panic.png

/usr/src/linux/.config: https://gist.github.com/2900922

/boot/grub/grub.conf: https://gist.github.com/2900926

emerge --info: https://gist.github.com/2901085

First thing I did I deleted any files left over from earlier kernel installations, like /lib/modules/*, then re-emerged gentoo-sources, then tried an older version of gentoo-sources, and then I saw that even older kernels could not be rebuilt to work.

Which made me think of initrd. I looked into various /boot/initramfs-* and saw that recently-built initramfs files did not have a /linuxrc in it, whereas those old ones from kernels that still boot have it. I cannot believe genkernel does this by design. Without /linuxrc, nothing happens, right? I believe this is the reason why my kernels won't find the root fs, despite all hardware and fs drivers built-in (<*>).

But why does genkernel no longer put a /linuxrc into initramfs? The source for linuxrc is there:

```
beluga ~ # ll /usr/share/genkernel/defaults/

total 196

-rw-r--r-- 1 root root 28380 Jun  8 22:14 busy-config

-rw-r--r-- 1 root root   846 Jun  8 22:14 config.sh

-rw-r--r-- 1 root root  1869 Jun  8 22:14 initrd.defaults

-rw-r--r-- 1 root root 31651 Jun  8 22:14 initrd.scripts

-rw-r--r-- 1 root root 79650 Jun  8 22:14 kernel-config

-rw-r--r-- 1 root root 14071 Jun  8 22:14 keymaps.tar.gz

-rw-r--r-- 1 root root 17585 Jun  8 22:14 linuxrc

-rw-r--r-- 1 root root  2466 Jun  8 22:14 modprobe

-rw-r--r-- 1 root root  2175 Jun  8 22:14 modules_load

-rw-r--r-- 1 root root   790 Jun  8 22:14 udhcpc.scripts
```

Of course I re-emerged genkernel and grub, did a new grub-install just in case, to no improvement.

Any ideas?

----------

## Logicien

Bonjour,

if your kernel have everything needed built in, try to boot without the initramfs with minimal parameters like this

```
title Gentoo Linux simple

root (hd0,4)

kernel /kernel root=/dev/sda13 video=vesafb:1280x800-32@60
```

The fact that the kernel can boot as a standalone will confirm the problem come from the initramfs. You do not use the kernel parameter root= . Because you use real_root= parameter, maybe one can thing the root= is not mandatory. Who know? Maybe it is.

I use an initramfs without any init, initrc or linuxrc. It is created by splash_geninitramfs. It do not prevent the boot to succeed. For sure my kernel have everything needed built in.

----------

## Hu

According to Documentation/filesystems/ramfs-rootfs-initramfs.txt, the kernel looks for /init, not /linuxrc, when processing an initramfs.  The name /linuxrc was part of the older initrd mechanism.

To capture a panic in software, use netconsole or a serial console.  The remote machine can then log the console output as it is received.

----------

## eccerr0r

This is still strange that it cannot mount root.  I would have thought it was the root of the initrd but not sure, it could be root of the main disk... the device IDs don't quite make sense.  The options in the config file look correct, if you didn't have tmpfs then it would fail like this I would think.  Sure you're using the right kernel?

If it couldn't find the linuxrc or init file, there should have been another type of panic, indicating it couldn't find init or ran out of code to run...

----------

## Hu

Specifying init=/linuxrc when you have specifically confirmed that no /linuxrc exists is unlikely to work well.  Also, specifying quiet and a splash screen could easily suppress useful kernel output.  Remove those until you have a working system.

----------

## jwezel

 *Hu wrote:*   

> According to Documentation/filesystems/ramfs-rootfs-initramfs.txt, the kernel looks for /init, not /linuxrc, when processing an initramfs.  The name /linuxrc was part of the older initrd mechanism.
> 
> 

 

There was no /init link either in the initramfs.

 *Hu wrote:*   

> To capture a panic in software, use netconsole or a serial console.  The remote machine can then log the console output as it is received.

 

Netconsole would probably not be active at this time.

----------

## jwezel

OK, this is really strange. All of a sudden, the /linuxrc (and the link /init) is there again and the kernel boots. The real only thing I did was to change some modules from <M> to <*>. I think genkernel has a serious bug. The problem is I cannot reproduce the bug so I cannot report it.

----------

