Skip to content

Instantly share code, notes, and snippets.

@michaellindman
Last active January 6, 2021 15:54
Show Gist options
  • Save michaellindman/8d6c2bf9a848c85f1238 to your computer and use it in GitHub Desktop.
Save michaellindman/8d6c2bf9a848c85f1238 to your computer and use it in GitHub Desktop.
This document explains the process I used to boot FreeNAS on the ASUS AM1M-A

Booting FreeNAS on the ASUS AM1M-A

The ASUS AM1M-A has an issue with booting OSes in legacy mode that are using the GUID partition table, which is used by FreeNAS by default. In this document I will explain how to implement a workaround that will allow the system to boot into FreeNAS.

The workaround involves installing grub on to a bootable usb memory stick that is using the Master Boot Record partition table and add an entry for the FreeNAS boot device. We are basically using grub on the memory stick as a catalyst to access grub on the FreeNAS device which in turn will let us boot FreeNAS.

When doing this I suggest using a Linux Live-CD to install grub onto the memory stick (I used Ubuntu 14.04.2 Desktop), while it will work on an installed version of Linux, providing it is using the legacy boot mode and not UEFI, I wouldn't recommend it as it is possible that installing grub on the USB memory stick may break the version of grub that is currently in use. I would also suggest either removing or disabling in UEFI all the storage devices that are currently using grub as a bootloader.

Creating a GRUB2 USB

First we need to identify the USB memory stick that we want to install Grub on. To do this open a Terminal session and type in lsblk and look for the USB device. It should show up as something like:

sdd      8:48   1   3.7G  0 disk
└─sdd1   8:49   1   3.7G  0 part /media/ubuntu/Flash Drive

With the correct USB device identified we need to create a mountpoint for the device so we can run the grub installation by entering:

sudo mkdir /mnt/usb
sudo mount /dev/sdd1 /mnt/usb # replace /dev/sdd1 with the identified USB device

With the USB device mounted we can now install grub by running the following command:

grub-install --force --boot-directory=/mnt/usb/boot /dev/sdd

In order for grub to boot FreeNAS it first needs a grub.cfg file which isn't created by default when we used the grub-install command, so we have to create it manually with:

cd /mnt/usb/boot/grub/
nano grub.cfg

Below is the text we need to enter to boot FreeNAS:

set timeout=1
set default=0

menuentry 'FreeNAS' {
    set root='(hd3)'
    chainloader +1
}

For this to work on your system you need to change hd3 to the device that FreeNAS is installed on. To find this, insert the USB stick into the AM1M-A board and boot into the memory stick. Once grub loads press C and type in ls to see a list of storage devices connected to the system and use process of elimination to find the correct device. It should show up as something like this:

grub> ls
(hd0) (hd1) (hd2) (hd3)

With the correct boot device selected the memory stick should load grub on the FreeNAS device and boot into FreeNAS normally.

@rykr
Copy link

rykr commented Feb 18, 2017

I found this article and am really interested to see if this will help me. I have an older i7 board (gigabyte p55m-ud2). Everytime I install freenas 9.10 to a usb drive and try to boot from it my system simply hangs. I am starting to think that my system will not support gpt partitions. I would be intersted in trying this technique. The freenas installation has a small boot partition and then a larger partition. I'm thinking the small boot paritition is not needed if I am booting from grub? You just boot from grub and then pointn to the larger partition?

Think those could be on the same flash drive?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment