I have two compiles of the same kernel version (4.0.5+gentoo patches). One boots, correctly, but lacks several kernel CONFIG flags.

Adding those flags and running make all && make install gives me an "unable to find root device /dev/sda4" error.

I have a bog-standard /etc/fstab:

/dev/sda1               /boot           ext2         noauto,noatime,discard  0 2
/dev/sda4               /               ext4         noatime,discard         0 1
/dev/sda3               none            swap            sw              0 0
/dev/cdrom              /mnt/cdrom      auto            noauto,ro       0 0
/dev/fd0                /mnt/floppy     auto            noauto          0 0

Inspection of the fine Googles suggests that this due to some configuration in the initramfs, which is... interesting (and hard to debug, as far as I can tell!).

I'm using Grub 1 with the following configuration:

title Gentoo Linux 4.0.5 - no docker, has X.
root (hd0,0)
kernel /boot/vmlinuz-4.0.5-gentoo-x root=/dev/sda4 rootfstype=ext4
initrd /boot/initramfs-genkernel-x86_64-4.0.5-gentoo

title Gentoo Linux 4.0.5 - latest build.
root (hd0,0)
kernel /boot/vmlinuz-4.0.5-gentoo root=/dev/sda4 rootfstype=ext4
initrd /boot/initramfs-genkernel-x86_64-4.0.5-gentoo

Note that the first entry is the booting build and the second is the non-booting build.

My suspicion is that the kernel + initramfs have a binary matching requirement, and the new build changes up the binary locations, causing the firmware to be unloadable.

If someone has some links to authoritative documentation on kernels/initramfs/root device interaction or an authoritative answer that would be appreciated.

Edit: Spending some time studying this, it turns out that UUID=<uuid> doesn't help either. However, it appears that in the dysfunctional boot, dropping into the initramfs shell demonstrates that /dev/sda<1-4> don't exist (which is what I'm trying to find). Hmmm.

  • 1
    it may be hard for you to debug, but it's definitely going to be a lot harder for those of us that don't know what config flags you changed. if /dev/sda<1-4> are missing but you can still mount initramfs and open a shell, then your problem will be with the kernel modules in initramfs. you're missing some you need for your disks. – mikeserv Oct 21 '15 at 5:54
  • The usual advice would be to return to a working configuration and add the config options one at a time (or several at a time if there are too many) to determine which one breaks it. – Dmitry Grigoryev Oct 21 '15 at 11:53
  • 2
    Could you please post a diff of your two .config files? It sounds like in addition to having added options you might have also removed some. – p8952 Oct 24 '15 at 20:59

You seem to be using the same initramfs for both kernels. The initramfs contains kernel modules that may need to be loaded from there, and depending on the kernel configuration differences, this may or may not be a problem.

Generally, I consider two kernels "compatible" only if they were produced in the same source tree, and the modules were not recompiled at the second kernel compilation. So, enabling an additional module (which does not result in the existing modules getting recompiled) results in a "compatible" kernel, whereas changing a CONFIG flag which causes the existing modules to be recompiled results in an "incompatible" kernel. Mixing modules between incompatible kernels could be a problem. Therefore you need to generate a new initramfs for incompatible kernel configuration changes. Also, having two incompatible kernels with the same version string installed on the same machine at the same time might give you problems, as /lib/modules/<version> would be a single location for the modules of both kernels - but you can put the modules of only one of them there... You can add a string into the root Makefile of the kernel tree after EXTRAVERSION= to make your kernel version string unique.

  • this turned out to be the correct answer! – Paul Nathan Oct 28 '15 at 5:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.