Wrong grub entries for Arch Linux

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
norseman
Level 1
Level 1
Posts: 10
Joined: Sat Jul 04, 2020 5:09 am

Wrong grub entries for Arch Linux

Post by norseman »

Some days ago, I installed Arch (sda3=/boot sda8=/) alongside Windows and Linux Mint 19.3 on my system and thought that a sudo update-grub would be enough to get a working entry for Arch Linux in my grub boot menu.

Code: Select all

> sudo update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50_linuxmint.cfg'
Sourcing file `/etc/default/grub.d/60_mint-theme.cfg'
Generating grub configuration file ...
Found theme: /boot/grub/themes/linuxmint/theme.txt
Found linux image: /boot/vmlinuz-4.15.0-109-generic
Found initrd image: /boot/initrd.img-4.15.0-109-generic
Found linux image: /boot/vmlinuz-4.15.0-108-generic
Found initrd image: /boot/initrd.img-4.15.0-108-generic
Found memtest86+ image: /memtest86+.elf
Found memtest86+ image: /memtest86+.bin
Found Windows 7 on /dev/sda1
Found Windows 10 on /dev/sda2
Found Arch Linux on /dev/sda8
done
The entry that is generated looks like

Code: Select all

menuentry 'Arch Linux (on /dev/sda8)' --class arch --class gnu-linux --class gnu
 --class os $menuentry_id_option 'osprober-gnulinux-simple-837828af-3f66-49f1-bf
45-592e13930559' {
        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  5c43fb42-2e14-4b87-b3a8-fc07df9f9a
99
        else
          search --no-floppy --fs-uuid --set=root 5c43fb42-2e14-4b87-b3a8-fc07df
9f9a99
        fi
        linux /vmlinuz-linux-lts root=UUID=837828af-3f66-49f1-bf45-592e13930559 
rw loglevel=3 quiet
        initrd /intel-ucode.img
}
and that one leads to a kernel panic crash if I select it at boot time ...

The entry that was generated by Arch itself looks like

Code: Select all

menuentry 'Arch Linux *Manual* ' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-837828af-3f66-49f1-bf45-592e13930559' {
        load_video
        set gfxpayload=keep
        insmod gzio
        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-ieee1275='ieee1275//disk@0,msdos3' --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  5c43fb42-2e14-4b87-b3a8-fc07df9f9a99
        else
          search --no-floppy --fs-uuid --set=root 5c43fb42-2e14-4b87-b3a8-fc07df9f9a99
        fi
        echo    'Loading Linux linux-lts ...'
        linux   /vmlinuz-linux-lts root=UUID=837828af-3f66-49f1-bf45-592e13930559 rw  loglevel=3 quiet
        echo    'Loading initial ramdisk ...'
        initrd  /intel-ucode.img /initramfs-linux-lts.img
}
I put that in my 40_custom, and it works fine.

Obviously, the initramfs part is missing somehow in the version that Mint generates.

The questions:
1. Is there any way to configure update-grub, so that the correct entry is generated?
2. Now that Arch is on my harddisks, the update-grub is much slower and it takes several minutes. Maybe someone can explain that, too.


PS As long as both grubs/os-probers are not fully working, I have the
Mint grub is /dev/sdb
while the
Arch grub is on /dev/sda
so that I can choose on of them with F12 at boot time.
Note: The Arch os-prober/grub-mkconfig finds the Tricia installation but does not generate a menu entry for that at all.
If I use the Mint generated entry there (40_custom), the 2.04 grub claims about two entries, but eventually boots.
User avatar
arvy
Level 6
Level 6
Posts: 1098
Joined: Sat Mar 26, 2016 11:22 am

Re: Wrong grub entries for Arch Linux

Post by arvy »

norseman wrote:
Sat Jul 04, 2020 5:38 am
The questions:
1. Is there any way to configure update-grub, so that the correct entry is generated?
2. Now that Arch is on my harddisks, the update-grub is much slower and it takes several minutes. Maybe someone can explain that, too.
1) Only way that I've found is to disable the /etc/grub.d/30_os-prober script (remove the file's executable bit) and use /etc/grub.d/40_custom instead to create my own Grub boot menu entries for all of my multi-boot options other than the one that actually controls the update-grub process. I use partition labels for mine rather than UUIDs just 'cuz it accommodates my occasional "re-organizations" more readily, but UUIDs work fine too, of course. And, rather than bothering with the specifics of various 'linux' and 'initrd' entries, I just use 'configfile' to pass control to each distro's own Grub configuration. If you think that approach might suit you, a few examples, including one for Arch-based Manjaro, are provided below. Be sure to change insmod part_msdos to part_gpt if/as appropriate for your own setup.

Code: Select all

menuentry 'Linux Mint Bootmenu' --class linuxmint --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	search --no-floppy --set=root --label rootMint
	configfile /boot/grub/grub.cfg
}
menuentry 'Linux LMDE Bootmenu' --class linuxmint --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	search --no-floppy --set=root --label rootLmde
	configfile /boot/grub/grub.cfg
}
menuentry 'Linux Manjaro Bootmenu' --class manjaro --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	search --no-floppy --set=root --label rootManjaro
	configfile /boot/grub/grub.cfg
}
menuentry 'Linux MX Bootmenu' --class mx --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	search --no-floppy --set=root --label rootMX
	configfile /boot/grub/grub.cfg
}
2) Once again, it's os-prober that's responsible. It tries to "interpret" all of the various distros' /boot/grub/grub.cfg file entries, but it's not very efficient and, as you've discovered, less than perfect in the attempt. I guess it finds Arch Linux even more challenging than most others. Personally, I think os-prober should adopt my much more straightforward configfile handoff method. :D
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
norseman
Level 1
Level 1
Posts: 10
Joined: Sat Jul 04, 2020 5:09 am

Re: Wrong grub entries for Arch Linux

Post by norseman »

Thanks, my entry now looks like

Code: Select all

menuentry 'Arch Bootmenu' --class archlinux --class gnu-linux --class gnu --class os {
        insmod gzio
        insmod part_msdos
        insmod ext2
        search --no-floppy --set=root --label bootArch
        configfile /grub/grub.cfg
}
because I have a separate /boot partition. It works nicely!
arvy wrote:
Sat Jul 04, 2020 7:21 am
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
Top
Btw: Is the Sumsung Pro a chinese copy of the Samsung Pro ;) SCNR
User avatar
arvy
Level 6
Level 6
Posts: 1098
Joined: Sat Mar 26, 2016 11:22 am

Re: Wrong grub entries for Arch Linux

Post by arvy »

norseman wrote:
Mon Jul 06, 2020 3:36 am
because I have a separate /boot partition. It works nicely!
I've never quite figured out what advantage a separate /boot partition setup confers, but yes, that would be right for that arrangement.
Btw: Is the Sumsung Pro a chinese copy of the Samsung Pro ;) SCNR
Nah, they're the "genuine" South Korean article: two of these and three of these, plus a drawer full of assorted swapables. :D

__
P.S.: Each independently bootable one way or another, which ain't always easy with UEFI-GPT boot loader installers. :(
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
Post Reply

Return to “Installation & Boot”