I have a problem booting into the OS installed on an external hard drive.
I have Manjaro installed on the internal nvme drives and a second Manjaro on the external drive /dev/sda. The second system is supposed to be portable and has it’s own /boot and boot/efi. It’s partitioned like that:
I would like to boot into the second system from the grub menu of the main system.
For that I boot into the main system, connect the external drive and update the grub menu: $ grub-mkconfig -o /boot/grub/grub.cfg
The system on the external drive is detected and added to the grub.cfg:
log
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Manjaro Linux on /dev/sda3
However, when I select it from the grub menu, I get:
error: file `/boot/initramfs-x.xx-x86_64.img` not found.
Press any key to continue...
I’m super tired, but since nobody seems to touch this, I’ll give you my five cents.
What is that???
Did you install the kernels while sda2 was mounted? Are you mounting that on your btrfs root in fstab or smthn?
I have no idea how grub would handle that. It’s also in ext4, not fat32. Why?
Do you then mount your efi partition, sda1 inside that or something?
Was the drive a bootable system somewhere else?
Why are the partitions mounted like that? I’m so confused.
It’s probably on sda2, idk where you installed them.
On the boot partition on your functioning system yes. No idea where, you did not provide info.
Probably looking for it where you installed it, on sdb2 maybe?
This is a mess, you need to provide more info.
Inxi of your system.
lsblk of your whole system.
How did you install the other os.
What IS the other os?
etc etc.
For anyone to be of any assistance you should post:
The complete grub entry that gets generated for your external-drive OS,
Plus output of your partitions that include the UUID’s…
Plus contents of your fstab of your external-drive OS,
Keep in mind that the ESP of your external-drive OS (sda1 on it) will NOT be used when booting into your main OS which most likely boots from NVMe, because the ESP on that will be used by default.
That means the grub of your main OS will be initialized with the NVMe drive as root device and all entries following that will assume paths are on the NVMe unless explicitly changed in the grub-menu entry.
Anyhow like said at start, you need to provide more detailed technical info about your grub-config and partitions, the info you have provided so far is not enough to help for your problem at hand…
Sorry for not being clear enough.
The second system is Manjaro and was installed completely on the external drive sda. It has separate /boot and /boot/efi. The main system is on internal nvme with it’s own /boot and /boot/efi.
You’re right, it’s enough to have a fat32 or ext2. I think ext4 still should work.
Thanks for clarification, that can be the problem in my case. I have a separate ESP for the external OS.
Is there a way to set a different ESP in grub?
Grub entry for the external-drive OS:
from grub.cfg
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Manjaro Linux (on /dev/sda3)' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-0b23081f-891c-481a-a19b-99a0fd580225' {
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b85841a4-0cb5-49ec-a801-0cf14d61d024
else
search --no-floppy --fs-uuid --set=root b85841a4-0cb5-49ec-a801-0cf14d61d024
fi
linux /vmlinuz-6.1-x86_64 root=UUID=0b23081f-891c-481a-a19b-99a0fd580225 rw rootflags=subvol=@ quiet apparmor=1 security=apparmor udev.log_priority=3
initrd /intel-ucode.img /boot/initramfs-6.1-x86_64.img
}
submenu 'Advanced options for Manjaro Linux (on /dev/sda3)' $menuentry_id_option 'osprober-gnulinux-advanced-0b23081f-891c-481a-a19b-99a0fd580225' {
menuentry 'Manjaro Linux (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-6.1-x86_64--0b23081f-891c-481a-a19b-99a0fd580225' {
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b85841a4-0cb5-49ec-a801-0cf14d61d024
else
search --no-floppy --fs-uuid --set=root b85841a4-0cb5-49ec-a801-0cf14d61d024
fi
linux /vmlinuz-6.1-x86_64 root=UUID=0b23081f-891c-481a-a19b-99a0fd580225 rw rootflags=subvol=@ quiet apparmor=1 security=apparmor udev.log_priority=3
initrd /intel-ucode.img /boot/initramfs-6.1-x86_64.img
}
menuentry 'Manjaro Linux (Kernel 6.1.38-1-MANJARO x64) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-6.1-x86_64--0b23081f-891c-481a-a19b-99a0fd580225' {
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b85841a4-0cb5-49ec-a801-0cf14d61d024
else
search --no-floppy --fs-uuid --set=root b85841a4-0cb5-49ec-a801-0cf14d61d024
fi
linux /vmlinuz-6.1-x86_64 root=UUID=0b23081f-891c-481a-a19b-99a0fd580225 rw rootflags=subvol=@ quiet apparmor=1 security=apparmor udev.log_priority=3
initrd /intel-ucode.img /boot/initramfs-6.1-x86_64.img
}
menuentry 'Manjaro Linux (Kernel 6.1.38-1-MANJARO x64 - fallback initramfs) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-6.1-x86_64--0b23081f-891c-481a-a19b-99a0fd580225' {
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b85841a4-0cb5-49ec-a801-0cf14d61d024
else
search --no-floppy --fs-uuid --set=root b85841a4-0cb5-49ec-a801-0cf14d61d024
fi
linux /vmlinuz-6.1-x86_64 root=UUID=0b23081f-891c-481a-a19b-99a0fd580225 rw rootflags=subvol=@ quiet apparmor=1 security=apparmor udev.log_priority=3
initrd /initramfs-6.1-x86_64-fallback.img
}
menuentry 'Manjaro Linux (Kernel 5.15.120-1-MANJARO x64) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-5.15-x86_64--0b23081f-891c-481a-a19b-99a0fd580225' {
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b85841a4-0cb5-49ec-a801-0cf14d61d024
else
search --no-floppy --fs-uuid --set=root b85841a4-0cb5-49ec-a801-0cf14d61d024
fi
linux /vmlinuz-5.15-x86_64 root=UUID=0b23081f-891c-481a-a19b-99a0fd580225 rw rootflags=subvol=@ quiet apparmor=1 security=apparmor udev.log_priority=3
initrd /intel-ucode.img /boot/initramfs-5.15-x86_64.img
}
menuentry 'Manjaro Linux (Kernel 5.15.120-1-MANJARO x64 - fallback initramfs) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-5.15-x86_64--0b23081f-891c-481a-a19b-99a0fd580225' {
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b85841a4-0cb5-49ec-a801-0cf14d61d024
else
search --no-floppy --fs-uuid --set=root b85841a4-0cb5-49ec-a801-0cf14d61d024
fi
linux /vmlinuz-5.15-x86_64 root=UUID=0b23081f-891c-481a-a19b-99a0fd580225 rw rootflags=subvol=@ quiet apparmor=1 security=apparmor udev.log_priority=3
initrd /initramfs-5.15-x86_64-fallback.img
}
menuentry 'Memory Tester (memtest86+) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/memtest86+/memtest.bin--0b23081f-891c-481a-a19b-99a0fd580225' {
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b85841a4-0cb5-49ec-a801-0cf14d61d024
else
search --no-floppy --fs-uuid --set=root b85841a4-0cb5-49ec-a801-0cf14d61d024
fi
linux /memtest86+/memtest.bin
}
}
List of partitions:
Output of lsblk
/dev/sda also includes partitions for other systems (it’s supposed to be multiboot drive).
But I think it’s not important in that case.
No the UEFI-BIOS chooses the first it encounters, in sequence of devices connected or configured in it.
You can however use Grub specific commands to choose the root filesystem to use…See:
then it appears in the bios menu and boots fine when selected. However, when I reconnect the external drive, the entry doesn’t reappear.
Looks like a bios specific issue…
No that is expected behaviour, the UEFI-Bios doesn’t allow permanent boot entries that are on external drives by design… (Because the entry could point to something completely different as what was setup at time when you insert a different drive…) What actually happens is when you boot without the external drive, the UEFI-Bios purges entries where the medium can not be found AFAIK…
For external drives you should use the default boot entry in /EFI/BOOT/BOOTx64.efi or similar /EFI/BOOT/BOOT.efi for it to be auto-added…