LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   initrd.gz and Grub2 (https://www.linuxquestions.org/questions/slackware-14/initrd-gz-and-grub2-4175489673/)

Richard Cranium 01-04-2014 02:51 PM

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)
mkinitrd -c -k 3.10.17-smp -f ext4 -r /dev/sda8 -m usb-storage:xhci-hcd:mbcache:jbd2:ext4 -u -o /boot/initrd.gz

...while your grub.cfg is using
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' {
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
}

You should decide if you're going to run SMP or not. If you are then you want the kernel-generic-smp and kernel-modules-smp packaged installed. If not, then have the kernel-generic and kernel-modules packages installed.

joshua60 01-05-2014 04:49 AM

Quote:

Originally Posted by Richard Cranium (Post 5091948)
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)
mkinitrd -c -k 3.10.17-smp -f ext4 -r /dev/sda8 -m usb-storage:xhci-hcd:mbcache:jbd2:ext4 -u -o /boot/initrd.gz

...while your grub.cfg is using
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' {
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
}

You should decide if you're going to run SMP or not. If you are then you want the kernel-generic-smp and kernel-modules-smp packaged installed. If not, then have the kernel-generic and kernel-modules packages installed.






Thanks Richard, you got it!!!

joshua60 01-05-2014 05:05 AM

Quote:

Originally Posted by aaditya (Post 5089503)
Hello, I had a similar issue, and got help here.

Back to my post question...

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.

Richard Cranium 01-05-2014 01:06 PM

Quote:

Originally Posted by joshua60 (Post 5092214)
Back to my post question...

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.

Is that from using my 09_slackware_linux script? Even so, the 10_linux script should pick up your initrd.gz image.

Try running the following command as root:
Code:

grub-mkconfig >/tmp/do_not_use_me.txt
You should see some messages printed out to stderr (your console) that would be hidden in all the other output. It should look somewhat like
Code:

Generating grub.cfg ...
/usr/sbin/grub-probe: warning: Couldn't find physical volume `pv0'. Some modules may be missing from core image..
/usr/sbin/grub-probe: warning: Couldn't find physical volume `pv0'. Some modules may be missing from core image..
/usr/sbin/grub-probe: warning: Couldn't find physical volume `pv0'. Some modules may be missing from core image..
/usr/sbin/grub-probe: warning: Couldn't find physical volume `pv0'. Some modules may be missing from core image..
Found linux image: /boot/vmlinuz-generic-3.10.17
Found initrd image: /boot/initrd.gz
Found linux image: /boot/vmlinuz-huge-3.10.17
/usr/sbin/grub-probe: warning: Couldn't find physical volume `pv0'. Some modules may be missing from core image..
Found linux image: /boot/vmlinuz-huge-3.10.17
Found initrd image: /boot/initrd.gz
Found linux image: /boot/vmlinuz-generic-3.10.17
Found initrd image: /boot/initrd.gz
/usr/sbin/grub-probe: warning: Couldn't find physical volume `pv0'. Some modules may be missing from core image..
Found Windows 7 (loader) on /dev/sdb1
done

The stuff in bold indicates that the scripts found your initrd image. I'm using the 64 bit version of Slackware, so my kernel names are different.

joshua60 01-06-2014 03:01 AM

Quote:

Originally Posted by Richard Cranium (Post 5092420)
Is that from using my 09_slackware_linux script? Even so, the 10_linux script should pick up your initrd.gz image.

Try running the following command as root:
Code:

grub-mkconfig >/tmp/do_not_use_me.txt
You should see some messages printed out to stderr (your console) that would be hidden in all the other output. It should look somewhat like
Code:

Generating grub.cfg ...
/usr/sbin/grub-probe: warning: Couldn't find physical volume `pv0'. Some modules may be missing from core image..
/usr/sbin/grub-probe: warning: Couldn't find physical volume `pv0'. Some modules may be missing from core image..
/usr/sbin/grub-probe: warning: Couldn't find physical volume `pv0'. Some modules may be missing from core image..
/usr/sbin/grub-probe: warning: Couldn't find physical volume `pv0'. Some modules may be missing from core image..
Found linux image: /boot/vmlinuz-generic-3.10.17
Found initrd image: /boot/initrd.gz
Found linux image: /boot/vmlinuz-huge-3.10.17
/usr/sbin/grub-probe: warning: Couldn't find physical volume `pv0'. Some modules may be missing from core image..
Found linux image: /boot/vmlinuz-huge-3.10.17
Found initrd image: /boot/initrd.gz
Found linux image: /boot/vmlinuz-generic-3.10.17
Found initrd image: /boot/initrd.gz
/usr/sbin/grub-probe: warning: Couldn't find physical volume `pv0'. Some modules may be missing from core image..
Found Windows 7 (loader) on /dev/sdb1
done

The stuff in bold indicates that the scripts found your initrd image. I'm using the 64 bit version of Slackware, so my kernel names are different.


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 ###

Richard Cranium 01-06-2014 08:41 AM

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. :)

joshua60 01-07-2014 10:55 AM

Quote:

Originally Posted by Richard Cranium (Post 5092812)
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. :)

Hi Richard,

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!!!

Richard Cranium 01-07-2014 11:36 AM

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 04:47 AM.