I've a Debian in my computer and now I want to add a Gentoo distro. I've installed Gentoo by terminal in Debian and chrooted to Gentoo in order to emerge all packages.
Now, I added Gentoo to Grub (installed on Debian) and for that I used the command:
root@reborn:/home/jota# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Encontrada imagen de linux: /boot/vmlinuz-3.16.0-4-amd64
Encontrada imagen de memoria inicial: /boot/initrd.img-3.16.0-4-amd64
Encontrado Gentoo Base System release 2.3 en /dev/sda3
hecho
root@reborn:/home/jota#
So it works ok. When I reboot I have the new entry of Gentoo but when is booting the system halts with kernel panic error
Kernel panic - not synching:VFS:Unable to mount root fs on unknown-block(0,0)
The part of grub.cfg seems ok,
menuentry 'Gentoo Base System release 2.3 (en /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-f40f428c-f76d-489f-9d97-a259f34ed457' {
insmod part_msdos
insmod ext2
set root='hd0,msdos3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3 f40f428c-f76d-489f-9d97-a259f34ed457
else
search --no-floppy --fs-uuid --set=root f40f428c-f76d-489f-9d97-a259f34ed457
fi
linux /boot/vmlinuz-4.4.39-gentoo root=/dev/sda3 ro
}
fdisk output is:
Device Boot Start End Sectors Size Id Type /dev/sda1 2048 97656831 97654784 46,6G 83 Linux /dev/sda2 97656832 116088831 18432000 8,8G 82 Linux swap / Solaris /dev/sda3 * 116088832 218488831 102400000 48,8G 83 Linux
Where sda1 is Debian /, sda2 is swap for both Debian and Gentoo, and sda3 is Gentoo /
I've tried to change the boot flag trough sda1 and sda3 with no changes.
And the fstab file of Gentoo is:
/dev/sda3 / ext4 errors=remount-ro 0 1 /dev/sda2 none swap sw 0 0
Edit: As mentioned in comments, Gentoo doesn't generate initrd.img file, I've never needed it before.
root@reborn:/boot# ls /boot/ config-3.16.0-4-amd64 grub initrd.img-3.16.0-4-amd64 System.map-3.16.0-4-amd64 vmlinuz-3.16.0-4-amd64 root@reborn:/boot# ls /mnt/gentoo/boot/ config-4.4.39-gentoo config-4.4.39-gentoo.old grub System.map-4.4.39-gentoo System.map-4.4.39-gentoo.old vmlinuz-4.4.39-gentoo vmlinuz-4.4.39-gentoo.old root@reborn:/boot#
initrd /initrd.img-3.16.0-4-amd64(or similar) line. Not sure why though considering grub-mkconfig clearly found it (from the messages it generated)