Skip to content

Instantly share code, notes, and snippets.

@pilonsi
Created February 8, 2025 15:16
Show Gist options
  • Save pilonsi/28e7913af35145e7a9dc15b36db316c3 to your computer and use it in GitHub Desktop.
Save pilonsi/28e7913af35145e7a9dc15b36db316c3 to your computer and use it in GitHub Desktop.

Booting FreeBSD from the 5th SATA of a Microserver Gen8

The HP Microserver Gen8 when configured to disable RAID on the front loading bays (something you should do if planning on using ZFS) is unable to boot from the 5th SATA port, which is usually reserved for the front optical drive.

There are several workarounds, but the most popular one is installing a separate bootloader on an USB drive or MicroSD card, and from there load your OS of choice.

Preparing the drive

Grab your USB drive, create a MBR partition table and a FAT32 partition, and mark it bootable.

From FreeBSD

I was migrating a system that had been running directly on another USB drive, which obviously was now dying. I dded the whole thing to a separate mSATA drive I had laying around, and then booted FreeBSD again from the barely alive USB to finish configuring the new bootloader drive.

I did this to automatically grab the optimal configuration for the running system, but if you are doing this from a separate OS, there are a few links with information on how to set up a grub.cfg to do chainload, or boot FreeBSD.

I however do not like that they use fixed hdX paths which may change if a drive dies and then render the system unbootable. The grub configuration that is autogenerated from the running system uses uuids instead. I have not investigated how to do this from a separate system, but must be possible.

In any case, here, here and here are the links.

From my system I installed grub-pcbsd, installed it to my new USB drive and generated a new configuration file:

# pkg install grub-pcbsd msdosfs
# mkdir -p /mnt/usb
# mount -t msdosfs /dev/da0s1 /mnt/usb
# mkdir /mnt/usb/boot
# grub-install --no-floppy --boot-directory=/mnt/usb/boot /dev/da0
# grub-mkconfig -o /mnt/usb/boot/grub/grub.cfg

Then shut the system down, unplug the old USB, connected the SATA drive with FreeBSD if it wasn't yet connected, and you're done.

From other OSes

Procedure should be the same but you cannot use grub-mkconfig to automatically generate grub.cfg for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment