I have an external SSD drive, with a Linux installation on partition 1, the EFI boot is partition 2.
There is also a second Linux installation on partition 3, that I never use.
Then there are two partition for two different live systems on ext4 partitions: 4 and 5.
Grub search grub.cfg on the first partition, then search for custom.cfg and custom2.cfg still on the same partition, in the directory /boot/grub/
.
custom.cfg
have a menu entry that set the root partition to hd1,gpt4
.
custom2.cfg
have a menu entry that set the root partition to hd1,gpt5
.
The problem is when I try to boot custom2.cfg
menu entry, it boots the live system on hd1,gpt4
instead of hd1,gpt5
.
Here is the /etc/grub.d/41_custom
that create the end of grub.cfg
:
#!/bin/sh
cat <<EOF
search --no-floppy --fs-uuid --set=prefix1 --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1 4787b339-ad49-4744-8d9a-9f0e95b78af2
if [ -f \${config_directory}/custom.cfg ]; then
source \${config_directory}/custom.cfg
elif [ -z "\${config_directory}" -a -f \$prefix1/custom.cfg ]; then
source \$prefix1/custom.cfg
fi
if [ -f \${config_directory}/custom2.cfg ]; then
source \${config_directory}/custom2.cfg
elif [ -z "\${config_directory}" -a -f \$prefix1/custom2.cfg ]; then
source \$prefix1/custom2.cfg
fi
EOF
here is custom.cfg
:
# Live boot
menuentry "Live system (amd64) toram sda4" {
search.fs_uuid 7f492729-d71b-4811-80e1-13a9e7943cf6 root hd1,gpt4
linux /live/vmlinuz toram=filesystem.squashfs boot=live components quiet
initrd /live/initrd.img
}
here is custom2.cfg
:
# Live boot
menuentry "Live system (amd64) toram sda5" {
search.fs_uuid be7cf5ce-ac26-41ee-bf26-3c1f10f0521a root hd1,gpt5
linux /live/vmlinuz toram=filesystem.squashfs boot=live modprobe.blacklist=nouveau components quiet
initrd /live/initrd.img
}
I tried, in the boot menu, to edit these entries by pressing e
, and it shows the correct entries.
Also, the result of blkid
command:
/dev/sdb1: LABEL="LINUX1" UUID="4787b339-ad49-4744-8d9a-9f0e95b78af2" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="LINUX1" PARTUUID="b43aa19d-ad07-4fe9-ba0c-dec43cb11e79"
/dev/sdb2: UUID="4C68-92D0" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="ea5e7013-fe47-49c1-a2f7-abd1cb9b790f"
/dev/sdb3: LABEL="LINUX2" UUID="5afc0ee0-ac59-4c59-985f-2ab8107a0d82" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="LINUX2" PARTUUID="035360f4-7634-4d24-8900-0f9ada81c709"
/dev/sdb4: LABEL="LIVE" UUID="7f492729-d71b-4811-80e1-13a9e7943cf6" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="LIVE" PARTUUID="a7b77431-a1b8-487d-80d2-8ef09b7add0f"
/dev/loop0: TYPE="squashfs"
/dev/sdb5: LABEL="LIVE2" UUID="be7cf5ce-ac26-41ee-bf26-3c1f10f0521a" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="LIVE2" PARTUUID="d77ffe57-e841-4890-938c-6d1997a96332"
/dev/sda: PTUUID="a6f73218-8327-45b9-981c-bae22eeb475c" PTTYPE="gpt"
So I wonder why grub boots hd1,gpt4
instead of hd1,gpt5
?