Triple-boot (Linux, hai/Genode, Haiku)

A recurrent theme in alt-OS forums is the “multi boot” topic, whereby posters compete with each other to see how many Operating Systems you can cram on an HDD, whilst multi-booting them with e.g. the Grub boot menu.
I’m not looking to break any records in this post, in fact there’s just two systems that are of interest to me, plus a third one which is a “necessary standard” for handling the other two :slight_smile: .

The below describes the steps to replicate my setup. This is mainly for myself, in case I change my hard-drive again (but who knows if this might inspire someone else ?).

Anyway I’m now setup on my T410’s newer/secondary HDD with:

  • Linux (Debian), ext4fs partition + swap partition
  • NTFS partition for h/o/g (not actually booting off that one directly, instead I boot h/o/g from a USB thumbdrive which uses this partition as storage, but I’ll look into moving the boot-modules to the partition and integrating it in the GRUB menu at some point in the future)
  • Haiku R1/beta5, BFS partition

Haiku got installed in litterally less than a minute, once I (finally) got it to boot to the installer. That’s for doing a full install with optional packages and with the dev environment and GCC compiler. Quite a contrast with Linux. All those years, and I still can’t get over how fast it installs ^^. Well, SculptOS obviously takes even less time to be ‘flashed’ to a USB stick, but that comparison won’t be apples-to-apples until SculptOS is self hosted/has gcc on the image (and when it does, I’ll have high expectations :wink: ).

Anyway, the steps:

  1. install Debian in the first 100 GiB of the drive; then, thinking of the next step, try a manual re-config of the partition layout to add another partition, reserved for NTFS – I don’t remember for sure but that was possibly done after installing and rebooting… which seems to have upset linux or grub, as it now pauses after the BIOS for 30 seconds echoing strange messages, but I can live with that.
  2. format a second 100 GB partition as NTFS (using Debian), then reboot to h/o/g thumbdrive, launch GeDepot to make it download and install depot packages (Falkon etc).
  3. reboot to Haiku beta5 thumbdrive, launch DriveSetup to create a third 100 GiB partition, format it to BFS, install to it. Then figure out how to integrate Haiku in GRUB.

Resulting partition layout :

I won’t belabor #1 and #2 as they are relatively straightforward, ‘RTFM’ steps. However the last one is a step I should keep a trace of, in case I ever need to replicate it:

After step #3, one needs to reconfigure GRUB, otherwise that third partition remains unaccessible… I was a little apprehensive, but it turned out to be fairly easy. I just followed the “GRUB 2” instructions down this page.

One needs to find out the partition name first. How to determine if the partition to be configured in GRUB is “/dev/sda1” or “/dev/sda2” or whatever? In MATE I realized I just need to open it, in the desktop : when opened for the first time after boot-up, I get a dialog asking “Password required to mount /dev/sda4”. There it is!

Then I saw that the steps outlined in the “install guide” above can be simplified to just two:

sudo nano /etc/grub.d/40_custom  # see below
# I didn't need this step:  sudo nano /etc/default/grub
sudo update-grub

The first “sudo nano” was for appending this:

# Haiku on /dev/sda4 .............
menuentry "Haiku" {
  set root=(hd0,4)
  chainloader +1
}

That’s it. There is now a “Haiku” line in the GRUB boot menu, below the Debian ones, which works as intended. Later I’ll try to configure a dev environment for building Genode from source (you can never have too many of those ^^).

EDIT: Debian just crashed on me (the desktop, that is). I was re-arranging screenshot files etc and browsing them, after editing this post… All of a sudden I got a blank/black screen, then a few seconds later the login screen… Typed my login/pwd, the desktop was empty of FireFox etc. I guess coding a Desktop is still a challenge (in some cases) in this day and age still ^^

1 Like

After the MBR multi-boot post above, I’ll now document my EFI (GPT partitions) multi-boot adventures. This is the first time I’m exposed to an EFI/GPT system, learned a lot.


So this household now has a brand-new “gamer” PC. Daddy won’t get an account on it to play games, but still gets a vote as to how to configure it ^^. Took me a day, but as of now my kid’s PC now has 3+1 multi-boot.

Steps overview:

  • shrink the Win10 partition that it ships with, to make room for Linux and Haiku
  • do a minimal (offline) install of Debian 12.7.0
  • install Haiku R1/b4 (R1/b5 won’t boot on that device for some reason)
  • do a full install of Debian (let it download MATE desktop etc), hoping to finish the boot menu
  • realize that Debian’s GRUB won’t recognize the Haiku partition
  • configure GRUB by hand to force it to support Haiku
  • profit

Details and notes:

Took a bit of fiddling with the computer’s BIOS to allow it to boot to a USB stick. Heck, even accessing the BIOS itself was not easy, but I found out about the “Open Start menu, hold SHIFT, click restart” trick (didn’t know about it) that makes Win10 reboot into UEFI BIOS. Then I changed the BIOS settings to make it easier to access with just ‘Del’ at POST time, then I configured it to accept booting into USB sticks (with some caveats: boot order needs to be specified each time, won’t “stick”).

Booting the Debian USB stick, I created “/” and “swap” partitions in the newly freed space, leaving a few GB free for the Haiku partition.

Boot-menu wise, the Debian Install screen does mention (briefly) its setup of GRUB, you gotta be careful to spot it in the late install stage. No interaction needed in this case in EFI mode, they probably feel confident enough it won’t break anything, since it’s simpler than in MBR mode – seems they just shuffle around the Win10 /EFI/BOOT/Boot x 64.efi, moving it to its own /EFI/Microsoft/ folder, to make way for (an /EFI/debian folder and for) a new Boot x64.efi which (presumably) redirects to GRUB. Hence the new boot menu that appears on power-up, which takes a detour through Linux and then goes back to the EFI partition if one decides to boot Win10 instead of Debian.

The default GRUB-created boot menu selects Debian with a 5 seconds timeout… As requested by my son, I edited it to make it default to Win10, with a 3 seconds timeout:

$ sudo nano /etc/default/grub
[sudo] password ....
...
GRUB_DEFAULT=2
GRUB_TIMEOUT=3
...
$ sudo update-grub

Tested the modified boot menu, it works as expected.

Installing Haiku took 30 seconds as usual, once the BFS partition was created.

Then boot the Debian stick again to do the “full” Debian install. (Funny note: the resulting desktop looks quite different, more pleasing to the eye, than the one I installed from the very same USB stick a couple months ago… I guess they updated their packages on the server in the meantime ?)

At this point I thought that going back to Debian Install would add the new OS to the GRUB boot menu, but no luck, “os-prober” does not support Haiku (as confirmed by grep’ping through its xx_foo sources looking for case-insensitive “Haiku” or “BFS”). Ok, let’s add it by hand then.

Adding Haiku to the GRUB boot-menu in this (EFI, GPT partitions) case took me longer than I would have liked. The explanations on the official Haiku website or its Discourse forum wouldn’t work as-is.

Was eventually successful with these:

sudo blkid

(in order to retrieve the UUID of the EFI/FAT32 partition), plus:

sudo nano /etc/grub.d/40_custom 

menuentry "Haiku" {
  insmod part_gpt
  insmod fat
  set root='hd0,gpt1'
  search --fs-uuid --set=root <EFIBOOT partition UUID>  # 7C2F-BEF5 in my case...
  chainloader /EFI/Haiku/BOOTX64.EFI
}

Plus

sudo update-grub

Plus: copy the BOOTX64.EFI file from the Haiku USB stick’s “efi” partition, to the path mentionned above, inside the EFI (FAT32) partition.

I wasted some time fiddling with the “menuentry” stuff because I initially pointed the “search” line at the Haiku partition, resulting in the “chainloader” line searching the Haiku bootloader there, whereas the Haiku EFI bootloader actually goes inside the EFI partition, together with its Debian and MS peers, so that’s where “search” must point.


Next up: as soon as I have my TTS stuff adapted to Genode 24.10 I’ll try it out on that machine.

3 Likes

The Haiku forum always sings the praises of reFind for multiboot within uefi machines. Is this something that you have considered?

I have a suspicion that the GRUB partition on the Sculpt image must be doing a lot more in the background than simply telling the computer to boot Sculpt, and can’t be replaced with a ReFind entry?

The problem is, I’m extra careful with boot-up stuff usually, but was even more so in this case since the computer is my son’s, didn’t want him to come back from school and find it “broken”… Beside I can’t find my way or ‘orient’ myself any time I look for info on rEFInd… So I went the conservative way, went with the flow since Debian installs GRUB. It’s not all that bad anyway, just a few text files to edit. Of course that assumes one of the partitions in the mix is Linux, so as to host the GRUB files. If I meant to multi-boot sans Linux, that’d be a big incentive to look for a more modern and ergonomic alternative to GRUB.

Oh yea, with my newfound ‘understanding’ (let’s stay humble) of GRUB, I might take another look at how it’s done with Genode and Sculpt OS in the future, to see if I can go further.

I should mount the USB stick within Linux to examine it, it’s hard to examine Genode sticks in Haiku due to a never ending litany of problems (partition recognition esp.)

1 Like

Thanks for the blow-by-blow description. I suspect this information will be useful sooner or later (probably sooner).

1 Like