Bootloader: Wrong Boot Volume

I installed Haiku yesterday on EFI. After install I copied the bootloader to EFI/Haiku/bootx64.efi, added it to the boot lists with efibootmgr in linux, and rebooted. Every time I get into the bootloader though, I’m forced to pick a boot volume (it detects them fine after the scan.) I’m assuming that the “correct” boot volume is saved somewhere and the entry is wrong, but I’m not sure where and how to fix it. I tried looking through my efivars on Linux and didn’t see anything too promising. Does anyone have some pointers to where I could get this fixed? It’s not world-ending, but it’s annoying to have to fix the menu every time I oot.

We don’t save anything.

The boot volume is detected from several factors, including:

  • Asking the EFI firmware which disk the bootloader was booted from, and enumerating partitions from that disk,
  • Looking for the partition type UID (not the partition GUID, but the partition type one) to detect partitions that declare themselves as BeOS/Haiku. If you did not create your partition using DriveSetup (not just formatted, but created there), or if you selected a different type, then your partition may simply have the wrong type.

From this we usually find one partition that is on the same disk as the bootloader, and has the coorect type, and we boot that.

If your partition has the correct type, then it may be step 1 that fails. In that case, maybe the “bootloader log” contents (accessible from the boot menu) may be useful to investigate why that’s so.

I got it! After combing through the bootloader log I saw where it dumps the partition table…

and I saw that the partition type was set to “linux data.” Apparently when the installer formatted as BeFS, it didn’t update the GPT entry to note that it’s a be filesystem. I went and pre-created the partitions yesterday since I had to resize an lvm partition for it, but nobody would ever notice if they created the partition from scratch. A quick swap back to eb00 in gdisk fixed it.

While trying to fix it I noticed that DriveSetup claims it can change partition type flags, but when you try to do it it says “Unsupported operation.” Is that just something broken in nightlies?

1 Like

Possibly, there may be some unfinished work in that area.

Have you used the command line tool in linux : blkid
To set the UUID of the boot Disk, maybe my post can help you?
Here

The final code I use is this one for Grub2 bootloader:

#!/bin/sh
exec tail -n +3 $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.

# for BIOS systems
menuentry "Haiku" {
        load_video
        insmod part_msdos
        insmod chain
        search --fs-uuid --set=root 1C93-8EC3
        chainloader ($root)/EFI/haiku/BOOTX64.EFI
}

At this line:

 search --fs-uuid --set=root 1C93-8EC3

1C93-8EC3 is the UUID of my Disk so you must to put your own boot Disk UUID

This unfortunately wouldn’t have done anything. There was no problem with loading the haiku bootloader, the bootloader itsel

I think DriveSetup can’t change the partition type of the partition it is currently on, you can only change it by an external tool like gdisk, or DriveSetup running off another partition.

At first I thought that was the problem, but it also refused when I booted off of usb, unmounted the partition, and tried there.

I guess it’s worth a bug report if there isn’t one already?