Installation on USB and EFI drives

I’d like to share some observations with you regarding installing Haiku on EFI. I’ll start by saying that I haven’t used Haiku in a while, and I’m not sure how much of what I’m writing is already common knowledge.

I decided to test the Beta6 TC0 test image that was made available, as well as the applications available on Haiku Depot, so I needed to install it on a drive with more free space than the raw image provides.

I had two USB drives. I burned a system image to a USB flash drive. I booted the system. I did the installation on a portable drive connected via USB.
The computer doesn’t see the drive to boot. I asked around and found out that Haiku might have trouble booting on EFI. So I found and followed this guide: UEFI Booting Haiku | Haiku Project .

Unfortunately, with

mkdir -p /EFIBOOT/EFI/BOOT
cp /system/data/platform_loaders/haiku_loader.efi /EFIBOOT/EFI/BOOT/BOOTX64.EFI

I have something like error Invalid Argument.

Then I try diffrent method,

I burned the same image on this portable ssd,

then I boot again from first pendrive,

mount portable ssd where I leave haiku esp, remove burned image, create bfs partition and install Haiku again on this partition,

restart and now I see ssd to boot, booting and I have Haiku on bigger drive ready to test.

OK. And now, two details. Pendrive was on USB, SSD was on USB C.

So. I noticed something curious. When I booting this SSD on usb c everything is ok. Problem is when I change cable and connect ssd to usb, then on booting screen, on disk icon I get kdl with something like: cant find boot partitions. Propably I open ticket soon. Has anyone else had experiences similar to mine?

1 Like

My Haiku drive is a USB SSD connected to the computer on a USB hub. If I change the spot where the drive is plugged into, whether it’s another spot on the hub or a USB port on the computer, it will no longer boot with the same message you can’t. It will only boot when plugged into the same hub and port it was installed on.

This is… not good for me, as the hub it’s plugged into is slowly dying. Eventually I will need to re-install Haiku completely once the hub completely fails.

So it’s not a coincidence. That’s not how it’s supposed to be. I hope the team doesn’t say it’s not a bug but a feature:)

And do you remember that, unlike Windows 98 with drivers, you could move a BeOS on hdd drive between computers? Haiku can’t even be moved between USB ports—what’s going on here?:slight_smile:

You should create the haiku_esp partition as on the installer drive on the USB drive you targeted as final install.

  1. if your machine know BIOS Legacy and UEFI boot as well, then I suggest to create MS DOS partition table in Drivesetup - that enables 4 primary partition - that’s enough any shared purpose Haiku boor drive, if you want.
    For example I have 2 BFS partitions (one with 2k (recommended) cluster size for Haiku (HaiQR1Nitely), and one 8k cluster size for Data/Media files (DATA_MEDIA), an EFI partition (haiku_esp) strictly formatted with default FAT type only otherwise Drivesetup skip as EFI partition- even small 64 MB enough big, an another FAT that can formatted FAT32 (LBA type) to move files between Haiku and other OS vice-versa.)
  2. If no BIOS Legacy available, and you do not want use this Haiku install for another computer, that may have BIOS Legacy available, then you should stay or select on GPT partition table initialization of the drive in Drivesetup - this is a menu option, how to initialize the partition table for the target drive. (Dont forget the select the appropriate drive in drivesetup before initialize the partition table there, as all existing data will be removed then on the selected drive.)
    2. create first a primary BFS type partition for your Haiku, if you do not want separate your OS and data, than this first will be the most significant size, aspecially, if you will have no other partition after that than the haiku_esp (64-128 MB depending if you want to add another of Os’s EFI bootloader on it.)
    Select the partition as Active, so that means bootable.
    The bootable flag won’t appear as in Drivesetup at that partiton until reboot. In the installed Haiku if you launch Drivesetup, then it should have flagged with small icon as bootable - just as in case of Haiku installer boot pendrive first partition has that flag.
  3. then create the small haiku_esp as EFI partition on remaining free size - I used to set as Active, but not sure it is necessary, but does not hurt, as partition type in itself sign to the computer to find EFI bootloader on such EFI System
    Partitions (ESP) There can be more ESP partitions in the system on several drives. Generally the UEFI firmware by defauld the internal drives (IDE/PATA, SATA, NVME HDD/SSD drives and Optical ones can scan for such partitions.
    If your machine knows BIOS Legacy boot mode and UEFI boot mode, then you have a mode selector and 2 available boot order of devices.
    One for Legacy boot as for older machines you can set device type, but if you have more similar drives you cannot pinpoint drives in the boot order.
    In case UEFI Boot order there bwill be a shorter list, as usually Legacy boot devices are like floppy or SD card or other exotic type of storage drives are not available there.
    You must select which boot mode is active : Legacy or UEFI.
    Thjere is a cheat at boot - many manufacturer secure a way to render a boot device list at boot time. If the Legacy mode is available, andI is active .. with help of boot device list you can select drive from Legacy list, and from UEFI boot order drives as well. If UEFI was set in the BIOS then you can select only from EFI boot partitions.
    Back on track ..
    This haiku_esp partition format to FAT (first default), Haiku Drivesetup does not enable to format EFI partiton type to fs type FAT16 or FAT32.
  4. Install the new Haiku system on the new BFS drive (if you had not created a separate BFS data partition it’s quite easy to select, as pecially you added a good label at formattiong to BFS fs type, if you had selected recommended 2k size and selected to enable indexing that will pays well back later.
  5. ok as install finished, then with Installer Menu option I suggest to install Bootman into the MBR of the target USB drive - even if you have one BFS you would boot in that system - you do it more easily to boot Legacy, but in that case you should put the Haiku boot drive in that port USB that your machine handle as lower number of USB HUB/port - as I wrote above with Legacy boot order you can select to boot from USB storage , but if 2 drive attached, then it will try to boot from lower number of HUB/port then you should have get lucky if your USB disk is on the appropriate port.
    Otherwise it will boot from installer drive, if that is in the USB drive that your UEFI BIOS firmware find on the lower number USB port.
    Haiku itself does not take care with these USB port numbers - always numbers the disk storage devices Based on where is the boot device - if it is on the USB bus. issue df -h if you put it in one port and after another - in df -h output /boot and other mounted filesystems will be always on the same device path - independently to which port you plugged in. However there are systems where it does matter where to plugged in your USB thumbdrive or USB external drive.
    It is possible to boot from one port only - in that case the Installer drive, after installation not just should be removed from the system, but the new USB drive install should be replaced with Installer drive - regarding the port you plug in it to boot from.
  6. and before restart the system I would recommend to mount the
    ‘haiku esp’ partition from Installer drive (mount as read-only is enough)
    and
    mount ‘haiku_esp’ partition you had created (mount as read-write mode) as now you will copy all files and directories
  7. from ‘haiku esp’ partition to 'hailku_esp new partition.
    If completed wait a minute and umount both ESP partitions.
    Now you can have a new install with the same UEFI bootloader as the USB installer drive - without Live and Intstaller selection

This definitely sounds like a bug. Is it reported anywhere?

Is the USB attached to a hub? That might be a problem (I think we still don’t support USB3 hubs quite properly.)

I haven’t reported it, no.

The USB SSD is connected to a hub, yes. Currently, that’s the only way it’ll boot. Once this hub stops working I’ll need to figure something else out and install Haiku fresh again.

I’m not sure why it needs to be on the same hub in the same port, unless that particular device path is saved somewhere instead of using whatever it was started the boot process.

The page you linked to with UEFI booting instructions is a bit out of date now as it’s not necessary to manually create directories on the EFI System Partition (ESP) and copy the UEFI bootloader files anymore. There is now a option in the Tools menu of the Installer application in R1/beta6 called ‘Install EFI loader’ that does it automatically. You still need to create and format the ESP partition in DriveSetup beforehand however.

Its definitely worth yourself and @MrEntropy to file a ticket at https://dev.haiku-os.org as the issues described seem to be related to USB, not the UEFI boot setup. That way the devs can look into it and hopefully fix it.

In my case, it’s connected directly to my laptop. I’ll open a ticket today.

1 Like

Unfortunately, I can’t log in because I need to reset my password, but Trac won’t send me an email and says:
Warning: Email and username must match a known account.
Even though my username and email address are correct.

Anybody from trac can help me?

Works. Thanks to humdinger for help.