initrd.gz and Grub2
Hi,
I've been told not to use 'huge' kernel but 'generic'. See: http://www.linuxquestions.org/questi...fs-4175489134/ I am using Grub2 as bootloader and now I would like that Grub2 automatically detects the 'generic' kernel. Is it possible? How do I have to rename initrd.gz? Thanks for your help and 'Happy New Year' |
As you define the kernel with the "linux" statement, likewise for the "initrd" statement.
Documentation here. |
Hello, I had a similar issue, and got help here.
|
I could run 'initrd initrd.gz' modifing grub.cfg but I got the following error:
No kernel modules found for linux 3.10.17. mount: mounting /dev/sda8 on /mnt failed: no such device ERROR: No /sbin/init found on rootdev (or not mounted). Trouble ahead. You can try to fix it. Type 'exit' when things are done. /bin/sh: can't access tty; job control turned off. |
How did you generate that initrd.gz?
|
I used
/usr/share/mkinitrd/mkinitrd_command_generator.sh and mkinitrd -c -k 3.10.17-smp -m ext4 (README.initrd) as well. |
It's not recommended you use the Huge kernel, but honestly it works fine. I've found that Huge, for me when I used Slackware, was a better choice as dealing with the initrd.gz was just bothersome and a needless extra step that was only for someone wanting a kernel with a lighter memory footprint which, in my needs didn't matter.
Just take the safe option and stick with Huge. You can also remove the generic kernel package from pkgtools and grub2 will only detect huge. |
Quote:
Code:
echo $(/usr/share/mkinitrd/mkinitrd_command_generator.sh -r) Which of those two commands did you run to create your initrd that was used to create that error message? Could you also provide your /boot/grub/grub.cfg file contents? |
Quote:
|
Also, Reaper, refer to your sig & remember that if you have all those drivers loaded in your kernel, you are primed to do many things, possibly poorly.
Regards, Bill |
True, but since I've been using a custom kernel with LFS, some of my drivers are located within the kernel minus several modularized drivers for certain hardware like video cards, sound cards, etc.
I've also used the Huge kernel as a basis to base my custom kernels off of also. In truth you could also recompile generic with the driver for your specific file system and not even need the initrd.gz as we'll and leave the rest to udev. |
Quote:
menuentry 'Slackware Linux (Slackware 14.1) (on /dev/sda8)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-2b64bf4d-d3b8-428d-81ce-516636141ac6' { insmod part_msdos insmod ext2 set root='hd0,msdos8' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos8 --hint-efi=hd0,msdos8 --hint-baremetal=ahci0,msdos8 --hint='hd0,msdos8' 2b64bf4d-d3b8-428d-81ce-516636141ac6 else search --no-floppy --fs-uuid --set=root 2b64bf4d-d3b8-428d-81ce-516636141ac6 fi linux /boot/vmlinuz-generic-3.10.17 root=/dev/sda8 initrd /boot/initrd.gz } I would like to state that huge kernel is fine for me too. Thanks |
What does running the command
Code:
ls -l /boot/initrd-tree/dev/sda* |
You don't happen to have /boot on its own partition, do you?
|
Quote:
brw-rw---- 1 root disk 8, 0 Jan 2 12:03 /boot/initrd-tree/dev/sda brw-rw---- 1 root disk 8, 1 Jan 2 12:03 /boot/initrd-tree/dev/sda1 brw-rw---- 1 root disk 8, 10 Jan 2 12:03 /boot/initrd-tree/dev/sda10 brw-rw---- 1 root disk 8, 11 Jan 2 12:03 /boot/initrd-tree/dev/sda11 brw-rw---- 1 root disk 8, 12 Jan 2 12:03 /boot/initrd-tree/dev/sda12 brw-rw---- 1 root disk 8, 13 Jan 2 12:03 /boot/initrd-tree/dev/sda13 brw-rw---- 1 root disk 8, 14 Jan 2 12:03 /boot/initrd-tree/dev/sda14 brw-rw---- 1 root disk 8, 2 Jan 2 12:03 /boot/initrd-tree/dev/sda2 brw-rw---- 1 root disk 8, 3 Jan 2 12:03 /boot/initrd-tree/dev/sda3 brw-rw---- 1 root disk 8, 4 Jan 2 12:03 /boot/initrd-tree/dev/sda4 brw-rw---- 1 root disk 8, 5 Jan 2 12:03 /boot/initrd-tree/dev/sda5 brw-rw---- 1 root disk 8, 6 Jan 2 12:03 /boot/initrd-tree/dev/sda6 brw-rw---- 1 root disk 8, 7 Jan 2 12:03 /boot/initrd-tree/dev/sda7 brw-rw---- 1 root disk 8, 8 Jan 2 12:03 /boot/initrd-tree/dev/sda8 brw-rw---- 1 root disk 8, 9 Jan 2 12:03 /boot/initrd-tree/dev/sda9 bash-4.2# ---------- Post added 01-04-14 at 04:35 PM ---------- Quote:
|
I believe that I see a kernel mismatch.
Your mkinitrd command uses Code:
bash-4.2# echo $(/usr/share/mkinitrd/mkinitrd_command_generator.sh -r) Code:
menuentry 'Slackware Linux (Slackware 14.1) (on /dev/sda8)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-2b64bf4d-d3b8-428d-81ce-516636141ac6' { |
Quote:
Thanks Richard, you got it!!! |
Quote:
Here is my grub2 automatic output for Slackware: menuentry 'Slackware Linux (Slackware 14.1) (on /dev/sda8)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-2b64bf4d-d3b8-428d-81ce-516636141ac6' { insmod part_msdos insmod ext2 set root='hd0,msdos8' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos8 --hint-efi=hd0,msdos8 --hint-baremetal=ahci0,msdos8 --hint='hd0,msdos8' 2b64bf4d-d3b8-428d-81ce-516636141ac6 else search --no-floppy --fs-uuid --set=root 2b64bf4d-d3b8-428d-81ce-516636141ac6 fi linux /boot/vmlinuz-generic-3.10.17 root=/dev/sda8 } submenu 'Advanced options for Slackware Linux (Slackware 14.1) (on /dev/sda8)' $menuentry_id_option 'osprober-gnulinux-advanced-2b64bf4d-d3b8-428d-81ce-516636141ac6' { menuentry 'Slackware Linux (Slackware 14.1) (on /dev/sda8)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-generic-3.10.17--2b64bf4d-d3b8-428d-81ce-516636141ac6' { insmod part_msdos insmod ext2 set root='hd0,msdos8' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos8 --hint-efi=hd0,msdos8 --hint-baremetal=ahci0,msdos8 --hint='hd0,msdos8' 2b64bf4d-d3b8-428d-81ce-516636141ac6 else search --no-floppy --fs-uuid --set=root 2b64bf4d-d3b8-428d-81ce-516636141ac6 fi linux /boot/vmlinuz-generic-3.10.17 root=/dev/sda8 } menuentry 'Slackware Linux (Slackware 14.1) (on /dev/sda8)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-generic-smp-3.10.17-smp--2b64bf4d-d3b8-428d-81ce-516636141ac6' { insmod part_msdos insmod ext2 set root='hd0,msdos8' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos8 --hint-efi=hd0,msdos8 --hint-baremetal=ahci0,msdos8 --hint='hd0,msdos8' 2b64bf4d-d3b8-428d-81ce-516636141ac6 else search --no-floppy --fs-uuid --set=root 2b64bf4d-d3b8-428d-81ce-516636141ac6 fi linux /boot/vmlinuz-generic-smp-3.10.17-smp root=/dev/sda8 } menuentry 'Slackware Linux (Slackware 14.1) (on /dev/sda8)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-huge-3.10.17--2b64bf4d-d3b8-428d-81ce-516636141ac6' { insmod part_msdos insmod ext2 set root='hd0,msdos8' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos8 --hint-efi=hd0,msdos8 --hint-baremetal=ahci0,msdos8 --hint='hd0,msdos8' 2b64bf4d-d3b8-428d-81ce-516636141ac6 else search --no-floppy --fs-uuid --set=root 2b64bf4d-d3b8-428d-81ce-516636141ac6 fi linux /boot/vmlinuz-huge-3.10.17 root=/dev/sda8 } menuentry 'Slackware Linux (Slackware 14.1) (on /dev/sda8)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-huge-smp-3.10.17-smp--2b64bf4d-d3b8-428d-81ce-516636141ac6' { insmod part_msdos insmod ext2 set root='hd0,msdos8' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos8 --hint-efi=hd0,msdos8 --hint-baremetal=ahci0,msdos8 --hint='hd0,msdos8' 2b64bf4d-d3b8-428d-81ce-516636141ac6 else search --no-floppy --fs-uuid --set=root 2b64bf4d-d3b8-428d-81ce-516636141ac6 fi linux /boot/vmlinuz-huge-smp-3.10.17-smp root=/dev/sda8 } } What I would like is the 'initrd initrd.gz' automatically inserted in the generic kernel output. |
Quote:
Try running the following command as root: Code:
grub-mkconfig >/tmp/do_not_use_me.txt Code:
Generating grub.cfg ... |
Quote:
No, I'm not using 09_slackware_linux script. I use another distro (Fedora) to boot from sda.So 10_linux script refers to Fedora. ### BEGIN /etc/grub.d/10_linux ### menuentry 'Fedora, with Linux 3.12.5-302.fc20.x86_64' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.5-302.fc20.x86_64-advanced-68f1196f-abb5-4635-a848-faa252f4475f' { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos2' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2' 68f1196f-abb5-4635-a848-faa252f4475f else search --no-floppy --fs-uuid --set=root 68f1196f-abb5-4635-a848-faa252f4475f fi linux /boot/vmlinuz-3.12.5-302.fc20.x86_64 root=UUID=68f1196f-abb5-4635-a848-faa252f4475f ro vconsole.font=latarcyrheb-sun16 rhgb quiet initrd /boot/initramfs-3.12.5-302.fc20.x86_64.img } menuentry 'Fedora, with Linux 3.11.10-301.fc20.x86_64' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.11.10-301.fc20.x86_64-advanced-68f1196f-abb5-4635-a848-faa252f4475f' { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos2' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2' 68f1196f-abb5-4635-a848-faa252f4475f else search --no-floppy --fs-uuid --set=root 68f1196f-abb5-4635-a848-faa252f4475f fi linux /boot/vmlinuz-3.11.10-301.fc20.x86_64 root=UUID=68f1196f-abb5-4635-a848-faa252f4475f ro vconsole.font=latarcyrheb-sun16 rhgb quiet initrd /boot/initramfs-3.11.10-301.fc20.x86_64.img } menuentry 'Fedora, with Linux 0-rescue-d9c58866bd8a4401871fdc6b39693afb' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-0-rescue-d9c58866bd8a4401871fdc6b39693afb-advanced-68f1196f-abb5-4635-a848-faa252f4475f' { load_video insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos2' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2' 68f1196f-abb5-4635-a848-faa252f4475f else search --no-floppy --fs-uuid --set=root 68f1196f-abb5-4635-a848-faa252f4475f fi linux /boot/vmlinuz-0-rescue-d9c58866bd8a4401871fdc6b39693afb root=UUID=68f1196f-abb5-4635-a848-faa252f4475f ro vconsole.font=latarcyrheb-sun16 rhgb quiet initrd /boot/initramfs-0-rescue-d9c58866bd8a4401871fdc6b39693afb.img } ### END /etc/grub.d/10_linux ### |
I don't expect RedHat to support anything other than RedHat/Fedora and Windows. (I don't expect Slackware to support RedHat/Fedora, either.) I don't use RedHat other than at work (and we have our own custom installer), but it would not shock me to find that they've changed 10_linux to look only for the stuff that RedHat/Fedora uses.
So, just add the 09_slackware script given in the second link in post #3 of this thread to your Fedora installation and re-run grub-mkconfig. If you want the Fedora stuff to stay as the default boot, rename 09_slackware to 11_slackware. :) |
Quote:
I gave a try to your script but sadly grub.cfg is empty. See: ### BEGIN /etc/grub.d/11_slackware_linux ### ### END /etc/grub.d/11_slackware_linux ### Don't worry, as I stated above the 'huge kernel' is fine enough for me. Thanks a lot for your professional help!!! |
Well, you can be sneaky and rename or copy initrd.gz to initramfs.img and see if the RedHat version picks it up.
|
All times are GMT -5. The time now is 08:50 AM. |