Cannot boot installed TrueNAS via GRUB USB on Proliant

gubbl

Cadet
Joined
Sep 20, 2020
Messages
6
tl;dr: my grub usb won't boot my proliant

My setup - Gen8 Proliant (with b120i) with 4x4TB HDD + 32GB SSD in ODD Bay + GRUB USB
It's a well known tricky situation to install TrueNAS/FreeNAS on an HP Proliant Gen8 with a b120i raid card (in the usual 4xHDD for data + 1xSSD for boot config).
It has an ODD sata bay which nicely fits e.g. a SuperDOM, but it can't boot from it in AHCI mode (RAID mode is undesirable for obvious reasons, you can't even install TrueNAS in that mode). For that reason, the common workaround is to create a bootable GRUB USB, which can be targeted as the initial boot device, and which can then in turn boot FreeNAS from the SSD.
That's what I've attempted to do, using many threads from this and other forums as guides (e.g. this thread).

How I attempted to create the GRUB USB
  1. Booted a live linux (from another USB).
  2. Removed all partitions from a 16GB USB (using gparted)
  3. Created an unaligned un-formatted 512MiB sized bios partition (with bios_grub flag set) and an aligned, ext2-formatted second partition (with legacy_boot flag set).
  4. Mounted the second partition (/dev/sdd2 -> /mnt/usb) and ran this grub-install command on it (which passed without any warnings or errors):
    grub-install --force --boot-directory /mnt/usb/boot /dev/sdd
  5. Created a grub.cfg file in /mnt/usb/boot/grub/ with the contents listed below
  6. Unmounted the USB, plugged it out of my PC and into the server.
  7. Set bios boot order such that USB is first (see screenshot below)
  8. Reset server
Code:
menuentry "FreeNAS" --class freebsd --class bsd --class os {
    insmod zfs
    insmod ext2
    insmod part_gpt
    echo Chainloading hd5 ...
    set root=(hd5)
    chainloader +1
}

1602443381318.png


The Problem
I get the following output:
Code:
Attempting Boot From Hard Drive
Attempting Boot From NIC

Broadcom UNDI PXE-2.1 v17.2.0
Copyright ...
Copyright ...
All rights reserved

CLIENT MAC ADDR: <censored>  GUID: <censored>
PXE-E53: No boot filename received

PXE-M0F: Exiting Broadcom PXE ROM.

[next screen]

Attempting Boot From Hard Drive
Attempting Boot From NIC

Non-System disk or disk error.
replace and strike any key when ready
[...]


Anyone know what could be causing this? I'm kind of lost at this point...

Cheers and thanks in advance already!
gubbl
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,176
Where does GRUB come into play here? FreeNAS/TrueNAS (non-scale) has used the FreeBSD bootloader for several years now. Or are you trying TrueNAS Scale, specifically?
 

gubbl

Cadet
Joined
Sep 20, 2020
Messages
6
No, I'm trying to boot TrueNAS Core, at least for now. But the OS itself doesn't really matter, actually (I think). The BIOS cannot be pointed at that bootloader, if the boot drive is in the ODD SATA bay.

The problem is that the Mobo in the Proliant Gen8 and the b120i raid controller that is built into it cannot boot from the ODD SATA bay (port 5) in AHCI/legacy mode. It can access it and install to it just fine though. It's just an unfortunate quirk of that system, it seems. The solution to still be able to use an SSD in the ODD SATA port as the boot drive (instead of going full usb as boot), is - according to most posts concerning FreeNAS/TrueNAS on a gen8 Proliant - to use a GRUB USB as the initial boot drive, which just serves to point to the actual FreeBSD bootloader on the SSD.

Some people have reportedly been able to keep the raid controller in raid mode, only configure the 5th drive as a single drive raid0, which somehow makes it available as a bootable drive, but comes with some other downsides related to being in non-passthrough mode. In any case, I had also tried that, but was actually unable to install TrueNAS in that configuration.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
Re-create your USB GRUB boot. If you use gparted, create a DOS partition table (device > create partition table type MSDOS) on the USB device and a single ext2 partition which is marked as bootable (manage flags, check boot option). To install GRUB2 to the USB stick in legacy BIOS mode, use:

grub-install --no-floppy -–target=i386-pc -–boot-directory=[USB Mount Point]/boot /dev/sdX

Substitute X with correct device.

Check correct GRUB files have been created on USB stick under [USB Mount Point]/boot/grub/, eg:

Code:
drwxr-xr-x 2 root root 4096 Mar  6 16:09 fonts
-rw-r--r-- 1 root root  202 Mar  6 16:24 grub.cfg
-rw-r--r-- 1 root root 1024 Mar  6 16:09 grubenv
drwxr-xr-x 2 root root 8192 Mar  6 16:09 i386-pc


Create a grub,cfg file under [USB Mount Point]/boot/grub/ with the same contents you used before. Umount usb stick and use to boot FreeNAS. Note: hd5 is only correct in the grub.cfg menu entry if ALL four HDDs are populated.
 

blanchet

Guru
Joined
Apr 17, 2018
Messages
515
(Maybe slower but easier): you can boot directly from the USB internal port with any 2.5" SATA harddisk/SSD and an USB3-to-SATA3 Adapter.

In this case you can install directly any operating system and you can boot without chainloading the boot loaders.
 

gubbl

Cadet
Joined
Sep 20, 2020
Messages
6
Thx Krisbee, that was it!
Thx for your help! It seems the partition table and flags were the issue, the nas is booting happily now :)

Cheers!
 

calder

Cadet
Joined
Nov 28, 2020
Messages
3
Ok, this is the exact same thing I am trying to do.
I have tried following both of your instructions to no avail. I must be missing something so would love some help. Here is what I have tried so far.
I have used the steps from gubbl and from Kisbee

Booted with a live Ubuntu CD
Used the GUI gparted program to:
-Created as SD card with one MSDOS partition table
-Created a single ext2 partition
-Added the 'boot' flag to the partition

The sd was listed as /dev/sdg on my machine
Mounted the sd to /mnt/sd
opened a terminal and ran$
sudo grub-install --no-floppy -–target=i386-pc -–boot-directory=/mnt/sd/boot /dev/sdg
Created a grub.cfg file /mnt/sd/boot/grub/ with the contents:

Code:
menuentry "FreeNAS" --class freebsd --class bsd --class os {
    insmod zfs
    insmod ext2
    insmod part_gpt
    echo Chainloading hd5 ...
    set root=(hd5)
    chainloader +1
}


When I attempt to boot from the sd I get the error:
Code:
Grub loading.
Welcome to GRUB!
error: file '/grub/i386-pc/normal.mod' not found.
Entering rescue mode...
grub rescue>


So I thought maybe I needed to combine the two things gubbl and Kisbee

So I tried making a new SD card with an MSDOS table and 2 partitions. The first an unformatted partition of 512mb and a second EXT2 partition.
Set the boot flag on the ext2 partition
Mounted the 2nd partition /dev/sdg2 and ran the command from terminal of:
sudo grub-install --no-floppy -–target=i386-pc -–boot-directory=/mnt/sd/boot /dev/sdg

Complete the same setup. When trying to boot I get the same error.
I have gone into the SD card and verified that the folder and file are present under /boot/grub/i386-pc/

I'm at the end of my knowledge of grub. Can anyone see what I am doing wrong at this point? What am I not quite understanding here?

Thanks
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288

calder

Cadet
Joined
Nov 28, 2020
Messages
3
Thanks for the quick reply. I will try that live cd and report back on Monday likely.

To clarify the correct method of doing this should be :
Create MSDOS table
Create single partition ext2
Add the boot flag
Mount and install grub on it
 

calder

Cadet
Joined
Nov 28, 2020
Messages
3
@KrisBee Yes that worked! So happy and relieved. I followed your setup using the systemrescue CD/USB at https://www.system-rescue.org/ and it booted like it should. Ubuntu must have been the issue.
setup the grub.cfg like gubbl did. I did add a few lines at the top as suggested by Dan Tudora's link

set timeout=10
set default=0

So it would select the boot option automatically.

Thanks all!
 
Last edited:

BeardyDude

Dabbler
Joined
Mar 12, 2021
Messages
10
Bit of a necro here, butttt....

What would my grub.cfg need to look like if I *am* using TrueNAS scale?

V. similar situation, Microserver Gen 8 - pants at booting from USB, no EFI support, limited precious connectivity for drives! - and I'd like to use Grub on the internal Micro SD card (which is reliably bootable) to chainload the freshly installed TrueNAS Scale ZFS mirror boot-pool on 2x USB DOM's attached at the rear.
 

PULS8R

Cadet
Joined
Jun 29, 2018
Messages
1
Bit of a necro here, butttt....

What would my grub.cfg need to look like if I *am* using TrueNAS scale?

V. similar situation, Microserver Gen 8 - pants at booting from USB, no EFI support, limited precious connectivity for drives! - and I'd like to use Grub on the internal Micro SD card (which is reliably bootable) to chainload the freshly installed TrueNAS Scale ZFS mirror boot-pool on 2x USB DOM's attached at the rear.

Another necro but how would you chainload grub from the sdcard to the SSD in the ODD port on a Gen8? I can't find anything that works for TrueNAS Scale.... and I'm no linux expert to work it out myself.
 

sae24

Cadet
Joined
Mar 16, 2023
Messages
1
Go on, I'm interested, I'm using TrueNAS Scale and don't like moving one hard drive to the side of the basket. Maybe someone will show the output of the command line? To create usb flash? I'm not familar with linux, sorry.
 
Top