HPE Gen8: Redundant boot devices with FreeNAS
Since more than a year I’m running FreeNAS on a dedicated HPE ML310e v2 Gen8 machine in my HomeLab as my main storage, mainly as a iSCSI server for my VMware ESXi nodes. However when building this specific setup, I’ve came across a limitation from the BIOS: Just like the HPE MicroServer Gen8 the ML310e v2-tower is only able to boot from the first attached SATA device. So when the system disk is not detected as the first disk or once the first boot device fails (partially), the FreeNAS machine can’t boot up anymore. Not something I was pretty happy about, specially because FreeNAS runs on small mirrored SSD drives.
Time to get a workaround in place to get across this limitations. However one important aspect was to keep FreeNAS untouched, to prevent that something breaks after future updates. After a lot of research and hardware reboots I was able to come up with a working solution for me…
The solution
I’ve put the smallest sdcard in the integrated card reader I was able to find and installed a custom grub bootloader on this (from now on) primary boot device. The procedure is as following:
- Hardware boots up
- Boots the grub bootloader from the sdcard
- GRUB bootloader tries to find the first available boot device labeled “freenas-boot”
- Then the bootloader just uses the chainloader functionality to boot the integrated FreeNAS bootloader
- The bootloader shipped with FreeNAS does the rest
Even when the GRUB configuration looks pretty simple, it took me days to finally figure out the correct, working configuration which is also able to look through ZFS volumes:
set default=0 set timeout=3 menuentry "Boot OS" { insmod zfs insmod part_gpt search --no-floppy --set=root --label freenas-boot regexp --set 1:root (.*)[,] ${root} chainloader +1 }