TrueNAS Boot from SSD on HP ProLiant Gen8 (AHCI Boot Fix)
This guide provides a robust solution for enabling S.M.A.R.T. monitoring on your main storage drives when TrueNAS is installed on the ODD port (Port 5) of an HP ProLiant Gen8 server.
Goal & Problem Overview
- Goal: Enable S.M.A.R.T. monitoring for the drives in the four main front bays (Ports 1-4).
- The Conflict: TrueNAS installed on the ODD port (Port 5) often requires the BIOS to be set to Legacy Mode for booting, but Legacy Mode disables S.M.A.R.T. for the main drives.
- The Solution: Switch the BIOS to AHCI Mode (to enable S.M.A.R.T.) and use a small, dedicated GRUB Chainloader on an internal MicroSD or USB stick to reliably force the boot process to the TrueNAS installation on the ODD port.
Prerequisites
- A dedicated any size MicroSD Card (or internal USB DriveKey).
- A separate Linux machine or a Live Linux USB for preparing the card. (I used Ubuntu USB on the Microserver)
- Familiarity with basic Linux command-line operations.
IMPORTANT: Always double-check device names (/dev/sdb, etc.) to prevent data loss.
Step 1: Prepare the MicroSD Card (The GRUB Chainloader)
You will use the entire MicroSD card for this purpose. Always double-check the device name (e.g., /dev/sdb) to avoid data loss.
1.1 Partitioning (MBR)
Use fdisk to create a single MBR/DOS partition covering the whole card, and set the Bootable Flag on it.*
1.2. Formatting
Format the partition (e.g., as ext4):
sudo mkfs.ext4 /dev/sdb1
1.3. Mounting
Mount the newly formatted partition:
sudo mkdir /mnt/grubboot
sudo mount /dev/sdb1 /mnt/grubboot
1.4 Install GRUB
Install the boot files to the mounted partition and write the boot code to the Master Boot Record (MBR) of the device itself (/dev/sdb):
sudo grub-install --no-floppy --root-directory=/mnt/grubboot /dev/sdb
Step 2: Create the Robust grub.cfg Configuration
This configuration file is crucial. It uses a search loop to automatically find your TrueNAS boot drive (which is Partition 3, gpt3) on one of the potential SATA ports, regardless of which ones are populated in the front bays.
sudo nano /mnt/grubboot/boot/grub/grub.cfg
2.2 Paste the Configuration
Paste the following code, which searches for the ZFS Boot Pool Partition 3 starting from disk hd5 down to hd1:
set default='0'
set timeout='10'
insmod part_gpt
insmod part_msdos
insmod chain
# Search for the ZFS Boot Pool (Partition 3) on hd5 down to hd1 (ODD is often hd5).
for i in 5 4 3 2 1; do
# Check if GPT Partition 3 exists on the current disk.
if [ -e (hd$i,gpt3) ]; then
set root=(hd${i})
break
fi
done
menuentry "TrueNAS Scale (Automatically Found ODD)" {
if [ -n "${root}" ]; then
echo "Found TrueNAS on drive: ${root}"
# Chainload the boot sector of the drive found above
chainloader +1
boot
else
echo "ERROR: Failed to find TrueNAS ZFS boot pool (partition 3) on any disk (hd1-hd5)."
sleep 5
fi
}
2.3 Save and Unmount
Save the file, exit, and safely unmount the MicroSD card:
sudo umount /dev/sdb1
Step 3: BIOS Configuration on the HP Gen8
Insert the completed MicroSD card into the internal slot of the Gen8 server.
3.1 Change SATA Mode to AHCI
- Start the server and press F9 to enter BIOS/System Utilities.
- Navigate to System Options→ SATA Controller Options → Embedded SATA Configuration.
- Change the setting to Enable SATA AHCI Support.
3.2 Set Boot Order
Go to Boot Options → Boot Order
Ensure that Internal MicroSD Card (or Internal USB DriveKey if you used a USB stick) is set as the first boot device.
Note: The server will now boot from the MicroSD card, which will execute the GRUB script. The script will find your TrueNAS installation on the ODD port and chainload the boot process, enabling you to boot TrueNAS while maintaining the necessary AHCI mode for S.M.A.R.T. monitoring.