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:

  1. Hardware boots up
  2. Boots the grub bootloader from the sdcard
  3. GRUB bootloader tries to find the first available boot device labeled “freenas-boot”
  4. Then the bootloader just uses the chainloader functionality to boot the integrated FreeNAS bootloader
  5. 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
}

Resources which helped a lot:

Author: Patrik Kernstock

May I introduce my self? I am Patrik Kernstock, 23 years old, perfectionist, born and still living in Austria. Me explained in short: I am a tech- and security enthusiast, a series junky and gaming addicted. Basically my interests belong to many different things in the IT-world, but specially I am interested in Ubuntu/Debian, nginx, MariaDB, Docker and various software solutions by Microsoft, Veeam and VMware.

Leave a Reply

avatar

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
Notify of