I have two encrypted Ubuntu installations (20.10) on two separate physical disks. I want to load the grub of the second installation from the first grub. Currently I only achieved loading a specific kernel of the second installation via a menu entry in my primary grub (added with grub customizer), using the following boot sequence:
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd2,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt3 --hint-efi=hd2,gpt3 --hint-baremetal=ahci2,gpt3 f54aac74-c88d-4963-a23f-84d5b27c2829
else
search --no-floppy --fs-uuid --set=root f54aac74-c88d-4963-a23f-84d5b27c2829
fi
linux /vmlinuz-5.8.0-33-generic root=/dev/mapper/vgubuntu-root ro
initrd /initrd.img-5.8.0-33-generic
Of course this will fail as soon as the kernel of second installation is updated as it points to a specific kernel.
So I want to load the grub of the second installation from the first installation. I created the following image to illustrated the situation:
I tried two options (boot sequences):
chainloader (hd3,gpt3)/grub/x86_64-efi/core.efi
yields:
error: invalid signature
and (based on https://www.linuxquestions.org/questions/linux-software-2/grub2-chainloader-833236/)
search --fs-uuid --set f54aac74-c88d-4963-a23f-84d5b27c2829
multiboot /grub/x86_64-efi/core.img
yields:
error: file '/grub/x86_64-efi/core.img' not found
Thus both didn't work. So my question is how do I create a grub entry to load another grub instance?
Update:
I tried the solution from @TSJNachos117 like this:
I switched from grub-customizer to editing the following files directly:
/etc/grub.d/40_custom_proxy
was pointing to /etc/grub.d/proxifiedScripts/custom
I added the following menu entry:
menuentry 'The Other Ubuntu' {
insmod chain
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt3 --hint-efi=hd2,gpt3 --hint-baremetal=ahci2,gpt3 f54aac74-c88d-4963-a23f-84d5b27c2829
else
search --no-floppy --fs-uuid --set=root f54aac74-c88d-4963-a23f-84d5b27c2829
fi
#set root=(hd2,3)
configfile /boot/grub/grub.cfg
}
When choosing this menu entry my screen goes black for about 10 seconds before showing the same grub menu again. Any hints what's wrong?
Here the output of lsblk -o name,type,uuid
:
NAME TYPE UUID
loop0 loop
loop1 loop
loop2 loop
loop3 loop
loop4 loop
loop5 loop
loop6 loop
loop7 loop
loop8 loop
loop9 loop
loop10 loop
sda disk
└─sda1 part d8c4609f-a602-44e8-b8e5-d88b3ab664c2
└─additional_disk_crypt crypt d07398f4-5f04-41bc-a31a-e44c112e3ae3
sdb disk
├─sdb1 part
├─sdb2 part DA91-B238
├─sdb3 part 9e57c5ea-219b-4b3a-8759-b98eb7d34c93
└─sdb4 part 8f45cd57-43c9-413f-b3c5-88f4f943554a
└─sda4_crypt crypt Qb93l3-3kQ4-cL0y-beud-DjZ0-RXef-MosuKX
├─vgubuntu-root lvm a206ae07-c959-434b-a8a4-4fd46afc2d77
└─vgubuntu-swap_1 lvm d7f15c2d-1f6b-4bd6-9536-426ec27a620e
sdc disk
├─sdc1 part
├─sdc2 part 0C57-CD8C
├─sdc3 part f54aac74-c88d-4963-a23f-84d5b27c2829
└─sdc4 part 86119b44-5b4a-4034-a761-52303f26b743
sdd disk
├─sdd1 part E0DC5287DC5257BC
├─sdd2 part AA1A58321A57FA31
└─sdd3 part 50B8C8FEB8C8E396
sr0 rom