Long booting time on MacBook Pro

I have installed Haiku alongside macOS in a mid 2007 MacBook Pro 15” Core2Duo. I have an SSD in the regular SATA connector and another SSD in a DVD drive adapter in the ATA connector. Since I don’t have a DVD drive and this Mac refuses to boot from USB any operating system other than macOS, I ended up doing some petitions and having more than one installation.

  • On the main SSD, I have a small 1GB Haiku installation, just in case. Then I have two bigger partitions, one for Haiku 32bit, the other for 64 bit. Then macOS El Capitan using the remainder. I had installed rEFInd in this SSD but I think it gets unused because the boot process is taken over by the secondary SSD.

  • On the secondary SSD (which because of the ATA connector is a bit slower), I have a clone of one of the Haiku installers (I believe it is the 64 bit). I did it using a dd command and it was the only reliable way I got to always be able to boot, like if I had a boot DVD in the drive. If something breaks in the boot loader, I can use this one to fix it. Or I can boot into macOS and do another dd into this SSD, to get back a boot menu, instead of needing to open the computer again to extract the disk.

With this configuration, by default, it will boot from the secondary SSD, into the unused Haiku system. I usually press the shift key and select the 64 bit system (main SSD). Sometimes it boots without choosing any other options, sometimes it stays a long time with all the icons gray and it takes another reboot and maybe changing some boot options in order to boot normally. But it boots ok otherwise. If I want to boot macOS, I press Alt and choose it from the Apple boot menu.

Except for one detail. It takes too much time just to get into the Haiku boot menu. Like this:

  1. Press power button.
  2. It displays a white screen for a few seconds.
  3. Black screen appears, I press Shift.
  4. 2 minutes later, the Haiku boot loader menu shows up.

It seems to me that these 2 minutes are way too much. Is it because of having to SSDs in place? Or may be because of some bug? Is there any way to figure out and eventually make it take less time?

When I was trying to figure out the partitioning I did a few experiences. I wanted to have both 32 and 64 bit versions of haiku and macOS El Capitan in the main drive. But i never managed to boot without the second drive. If I erase it, I am only able to boot macOS, even if the Haiku partitions in the mais drive are intact. Is there any logical and safe way to make it always boot from the main drive without destroying the macOS bootloader AND without needing the second drive?

On my 2014 MBP, it takes around 7-10 seconds for the legacy BIOS to be initialised before it starts loading the target image, and then a couple of seconds for Haiku boot loader to come up. So around 10 seconds from the moment I hold OPTION and select Haiku. This is most likely a Mac OS thing.

1 Like

I would try installing the Haiku version you have on a VM, that way you would be able to rule out a big.

I have the same machine (MacBookPro3,1) but the 17" 2.4 GHz MacBook Pro. After the USB firmware update, I have had no problem in running any EFI based OS through USB. (I don’t use the Superdrive as it’s practically dead.) I’ve installed Manjaro Linux on another partition and it boots fine through refind. However, I don’t have an SSD installed and I never will install one. Your problems most likely lie with them.

While I don’t have Haiku installed on the MBP, I do have it installed on a 2008 Mac Pro 3,1. It’s on an IDE drive, booting through grub and the legacy BIOS. Other than the weird restarts when the Haiku loader gets chainloaded, it boots fine. If the EFI is failing, try legacy booting by holding down option.

Just my experiences.

1 Like

I remembered vaguely sitting at the boot screen for a long time on an old mac, and I found an old post of mine from 2012 here Macbook 1,1

Apparently, it would get to the boot screen with grey icons and just wait until you press a key. I’ve never seen this on another machine, and it’s such an old report it could well have been fixed by now. But thought I’d mention it just in case…

1 Like

on my 2008 MBP it takes about 5 seconds before the Haiku boot process starts…

something is off mate.

1 Like

The bootloader scans the administrative folder in /system/packages of every installation to be able to show the folder tree for blacklisting.
Be sure to remove old States in the administrative folders regularly to avoid long times in the bootloader.

1 Like

That seems to be a plausible explanation. Is there any way around it that does not imply to delete some of the installations?

How are old states removed? Can it be automated?

States are saved in /system/administration/. Add a script to deleted folders older than some date and put it into ~/config/settings/boot/launch.

1 Like

Ok. I will try that.

Is there any way to make the bootloader stop scanning all partitions for old states, ignoring them except for one or two of them?

Are states kept forever by default, or is there any automatic delete process after some time or any event?

Currently there’s no configuring or automatic purging of states.

1 Like

Just deleted a bunch of those folders from the two main Haiku partitions. It takes a lot less time to arrive to the boot menu after pressing the shift key. It takes a few seconds, instead of minutes.

Shouldn’t be there any limit on this? In just a few days, those folders were already about 500MB…

Yes. This is an area that needs improvement. It’s not completely trivial, because you cannot just delete all folders before some cut-off date or size. See Axel’s comment on ticket #12498.

Another issue in the same corner is a nice GUI to revert/manage these states. If you know a capable dev in search of a project… :slight_smile:

1 Like

would this make a good GSoC project idea?

1 Like

I have no idea now complicated it gets, but it’d be a nice feature to have.