OK, I successfully booted into Arch Linux, Arch Linux's Fallback kernel, Windows 10, openSUSE Tumbleweed and Bionic Beaver 18.04.1 LTS and all went well.
This is from within Arch Linux though but, the differences should not be much. Just perhaps different on some Linux distributions.
Arch Linux uses the UUID of the EFI system partition as well as the UUID of the Arch partition, for reasons unbeknownst to me.
Here is the custom file I used. I will explain what I did before it's added to the Wiki as I need input from you all to make sure it works first.
Of course I cheat and change that +3 to a +4 so that we can at least see what is between the quotes when doing an update-grub, that and the picture should be the only things you see (a tip Drs305 taught me).
Code:
#!/bin/sh
echo 1>&2 "Adding Arch Linux, Windows 10, openSUSE Tumbleweed and Xubuntu Bionic Beaver 18.04 LTS"
exec tail -n +4 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-bbca28b2-503e-4dc8-9850-c54bd0492da8' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod fat
set root='hd2,gpt1'
search --no-floppy --fs-uuid --set=root 688D-126B
linux /vmlinuz-linux root=UUID=bbca28b2-503e-4dc8-9850-c54bd0492da8 rw quiet
initrd /intel-ucode.img /initramfs-linux.img
}
menuentry 'Arch Linux (fallback kernel)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-bbca28b2-503e-4dc8-9850-c54bd0492da8' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod fat
set root='hd2,gpt1'
search --no-floppy --fs-uuid --set=root 688D-126B
linux /vmlinuz-linux root=UUID=bbca28b2-503e-4dc8-9850-c54bd0492da8 rw quiet
initrd /initramfs-linux-fallback.img
}
menuentry 'Windows 10' --class windows --class os $menuentry_id_option 'osprober-efi-688D-126B' {
insmod part_gpt
insmod fat
set root='hd2,gpt1'
search --no-floppy --fs-uuid --set=root 688D-126B
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry 'openSUSE Tumbleweed' --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-274e3321-d7af-4544-9afa-b1b3c118c325' {
insmod part_gpt
insmod ext2
set root='hd2,gpt7'
search --no-floppy --fs-uuid --set=root 274e3321-d7af-4544-9afa-b1b3c118c325
linux /boot/vmlinuz root=/dev/sdc7 splash=silent resume=/dev/disk/by-uuid/be437b2b-9c95-4590-8d32-4da8e6c90318 quiet
initrd /boot/initrd
}
menuentry 'Ubuntu 18.04.1 LTS' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-899f7460-1d2a-43ab-b98e-5e33953cb0c4' {
insmod part_gpt
insmod ext2
set root='hd2,gpt8'
search --no-floppy --fs-uuid --set=root 899f7460-1d2a-43ab-b98e-5e33953cb0c4
linux /vmlinuz root=UUID=899f7460-1d2a-43ab-b98e-5e33953cb0c4 ro quiet splash $vt_handoff
initrd /initrd.img
}
This is my system:
Code:
[cavsfan@ArchLinux ~]$ sudo blkid |grep sdc
[sudo] password for cavsfan:
/dev/sdc1: UUID="688D-126B" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="3c1b6d6f-8a24-43da-b595-8c304ceee48d"
/dev/sdc3: UUID="C4968A52968A44C0" TYPE="ntfs" PARTLABEL="Windows_10" PARTUUID="345c85f4-bce7-4bc7-bbe0-db03eb319cad"
/dev/sdc4: UUID="701AE4631AE427B4" TYPE="ntfs" PARTUUID="1e337754-b45d-45a5-a971-b8cdcae8a002"
/dev/sdc5: UUID="be437b2b-9c95-4590-8d32-4da8e6c90318" TYPE="swap" PARTLABEL="Basic data partition" PARTUUID="3a259867-656d-41ed-9931-cf15a3bd0148"
/dev/sdc6: LABEL="ArchLinux" UUID="bbca28b2-503e-4dc8-9850-c54bd0492da8" TYPE="ext4" PARTLABEL="Arch_Linux" PARTUUID="5312b771-0835-4957-80a6-9a8a7107f24a"
/dev/sdc7: LABEL="opensuse" UUID="274e3321-d7af-4544-9afa-b1b3c118c325" TYPE="ext4" PARTUUID="25d7851a-f45f-4d60-955a-4a31706f8452"
/dev/sdc8: LABEL="Bionic" UUID="899f7460-1d2a-43ab-b98e-5e33953cb0c4" TYPE="ext4" PARTLABEL="Bionic_Beaver" PARTUUID="c4e0fdc9-7eac-4661-a7c6-c5a00c9a46fc"
/dev/sdc10: LABEL="Media" UUID="840ac879-510a-4b8d-be01-9d3a5f37dbb2" TYPE="ext4" PARTLABEL="Media" PARTUUID="61e2e7f9-1a98-44f7-881e-ae85fceaf994"
/dev/sdc2: PARTLABEL="Microsoft reserved partition" PARTUUID="49992d5b-79cd-4934-a12f-11782bb345bd"
So, this should boot an Ubuntu system, just the partitions and UUID needs changed to match your system.
Code:
#!/bin/sh
echo 1>&2 "Adding Xubuntu Bionic Beaver 18.04.1 LTS"
exec tail -n +4 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry 'Ubuntu 18.04.1 LTS' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-899f7460-1d2a-43ab-b98e-5e33953cb0c4' {
insmod part_gpt
insmod ext2
set root='hd2,gpt8'
search --no-floppy --fs-uuid --set=root 899f7460-1d2a-43ab-b98e-5e33953cb0c4
linux /vmlinuz root=UUID=899f7460-1d2a-43ab-b98e-5e33953cb0c4 ro quiet splash $vt_handoff
initrd /initrd.img
}
Right now I see no way to boot Ubuntu to a backup kernel because there is only a /vmlinuz file and no /vmlinuz.old file. Which may be because I haven't had enough kernels get installed yet.
So, this is a tad more complicated than the Legacy/MBR partitioned systems were but, at least you do not have to go to the OS where your grub is installed and update the grub there when a kernel is added to a different system.
Because the default grub has the /vmlinuz and /initrd tied to a kernel number.
A lot if not all of each entry can be copied from the existing /boot/grub/grub.cfg file and then modified, which makes it MUCH easier.
Bookmarks