Repairing FreeBSD multiboot w GRUB


New Member

Messages: 1

We have a laptop with two SSDs. Originally, there was only one SSD, and it had Ubuntu installed on it. We added a second SSD (500 GB) and installed FreeBSD on 100GB of it. We had a little trouble getting FreeBSD to show up in GRUB, but we finally we got it working by adding some lines to the GRUB customization file /etc/grub.d/40_custom. After that, we also installed Haiku (BeOS) on the second SSD, and Haiku was given another 100 GB. When installing Haiku, we used the partitioning tool supplied with Haiku. We also had a little trouble getting Haiku to appear in GRUB, but in the end we did. After having booted into Haiku through GRUB one time, we could no longer boot either FreeBSD or Haiku through GRUB. Ubuntu still boots normally from GRUB. We checked the GRUB customization entries in /etc/grub.d/40_custom and played around a little with the numbering of the disks, in case the order had changed on reboot, but it didn't make any difference. I should mention that the numbering / order of the SSDs is a little odd: the original disk shows up as sdb and the new one shows up as sda. I have a couple of possible ideas about what the problem might be, but I'm not sure about them: 1. The Haiku partitioning tool did not understand the FreeBSD disk partitions and messed them up. The problem with this idea is that in this case one would expect that Haiku would still boot normally through GRUB. 2. The disk numbering can change from one booting session to the next, so the GRUB entries are not the same from one booting session to the next. However, in that case why couldn't we get it to boot by changing the numbering of the disks in /etc/grub.d/40_custom? I have played around with multiboot systems for many years, and have never had this problem with Linux or Windows or, I think, Solaris. Can anyone suggest what might be wrong and, more importantly, how to get FreeBSD working again? Is this a FreeBSD problem? A Haiku problem? a GRUB problem? Something else? The important thing is to get FreeBSD working. It would be nice to spare Haiku, but that's less important.



Reaction score: 661
Messages: 1,377

Take a look at Super Grub2 Disk. Put it on a USB stick and boot it. It will list all bootable partitions. Choose what you want to boot and check if it boots. After that reboot to Super Grub2 again, choose what you have booted and hit 'e'. This will display the settings which grub has used to boot the partition. Those settings you can take over to the /etc/grub.d/40_custom file. It might need further fine tuning, though.

When the new settings won't boot the partition from the chosen menu entry in grub press 'e' to edit the entry. That way you can easily experiment with the settings without touching the custom file. After the settings are right make them permanent in the file.

As for the changing of disk numbering, have you checked the BIOS/UEFI if something might have provoked the change? To escape from further disk name changing situations you could label the disks and use them in the grub configuration.

Labeling partitions done right on modern computers.