HPE Gen8: Redundant boot devices with FreeNAS

This post was published 4 years 11 months 21 days ago, so the post may be outdated.

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:

Patrik Kernstock

May I introduce my self? I am Patrik Kernstock, 25 years old, perfectionist, born in Austria and living in Ireland, Cork. Me explained in short: Tech- and security enthusiast, series & movies junky. Interesting in Linux, Container-stuff and many software solutions by Microsoft, Veeam and VMware.

0 0 votes
Article Rating
Subscribe
Notify of
guest

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

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x