I must admit that I don’t know the difference between the two, and the exact purpose of wriembr off-hand, either. If you have the time to explain it, it would certainly be appreciated.
Writembr writes the boot code in the MBR (master boot record) of the disk. This is generic code that finds the active partition and loads the PBR (partition boot record) from that partition. There is some de facto standardization so you can use the same MBR code to boot Windows, Haiku, and various other systems.
In the case of Haiku, the partition bootloader is haiku_loader stage 1 (that will load the remaining part of haiku_loader). This is the part that makebootable modifies, but if you used Installer to create the partition, it already does this for you.
The MBR being a shared part of the system, the install process doesn’t touch it. We don’t want to break other operating systems you may have. Notably, Linux tends to install GRUB there, which cannot be replaced with a “standard” code (it would make your linux install unbootable). On the other hand, if you are installing on an USB drive with its default boot record, you will likely find that the MBR code there is set up to tell the BIOS “This is not a bootable disk, try the next one”. Otherwise, rebooting your machine with an USB disk connected would try to boot that disk, find no usable partition, and block the boot process with a confusing error message.
So you have several options to make sure a compatible master boot code is installed:
- Reinitialize the partition table with DriveSetup
- Use writembr
- Use BootManager, which installs another version of the boot code with a menu allowing to select which partition to boot (instead of just picking the active one)
Makebootable on the other hand, touches only the partition boot record, which is unlikely to help, unless you have moved the hartition to a different offset on the disk (this is because our partition boot record hardcodes its own offset on disk to know where to load the stage2 loader from). In all other cases, the partition boot record will already be correct, and makebootable is not needed.
Probably because we came across it, used it and our broken systems started booting again …
No. Again, unless you moved the partition, makebootable will not help. As you mentioned, you eventually fixed your problem by installing bootmanager, or you could have used writembr. You can safely remove makebootable from the equation. It did not fix your problem, even if you run it before or after another step that eventually did fix your problem.
Doesn’t makebootable also mark the partition as active?
I don’t think so
According to its help text, it doesn’t. Would make a great option, though ![]()
We had (over IRC) a user reporting that he borked his Windows install by running makebootable. Granted, unadvisable to just run commands without knowing what they do, but it should have warned/failed if the partition wasn’t a BFS one, no?
Doing a quick look at the makebootable code, seems it does checks for BFS partitions, but only for GPT, not for MBR. (I may be missing other checks… too late on XMas night to be 100% sure
).
I had all kinds of grey hairs appearing trying to use makebootable.
In fact, I stashed thenetbook in a corner and decided to work on it another day.
Then I checked in here and yes indeed, writembr did the trick and worked as expected.
I now have the coolest Haiku machine in the neighbourhood! My 2GB RAM stick is supposedly in the mail to so that should upgrade my battle station to fully operational status!
Thanks!
Should we change Installer to run writembr automatically if the Haiku partition takes up the entire disk?
I think it should offer it, but not do it automatically.
You may very well have a setup where you have GRUB on that disk (or whatever other bootloader) and use it to boot other disks as well.
So we should never touch that without at least a confirmation from the user. And then, if we ask the user, there’s no reason to do it only if Haiku is the only partition. We can always ask.