Project

General

Profile

Bug #5961

FreeNAS 9.3 M3 USB Stick doesn't boot

Added by 4M8 l93 about 4 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Nice to have
Assignee:
Sean Fagan
Category:
OS
Target version:
Sprint:
Severity:
New
Backlog Priority:
Reason for Closing:
Reason for Blocked:
Needs QA:
Yes
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

I installed FreeNAS 9.3 M3 ce60fe4 20140831 on an 8 GB USB Stick (Fresh Install using the iso). The Stick doesn't boot and the following message is displayed (probably by the BIOS): "Reboot and Select proper Boot device or Insert Boot Media in selected Boot device and press a key".
FreeNAS 9.2.1.7 booted fine from the same stick though.

History

#1 Updated by Jordan Hubbard about 4 years ago

  • Assignee set to Sean Fagan
  • Priority changed from Important to Nice to have

#2 Updated by Sean Fagan about 4 years ago

  • Status changed from Unscreened to 15
  • Assignee changed from Sean Fagan to 4M8 l93

I don't think there's sufficient information here.

I've installed onto a thumb drive multiple times.

Since it's not saying it's a data disk, that means that either:

a) the BIOS isn't seeing the thumb drive, or
b) the thumb drive is corrupt, or
c) something failed during the install.

Check your BIOS first. If it sees the device, then try booting off the ISO, selecting "Shell". Then determine which device is your thumb drive (it'd be a da<x> device.) Then "gpart list" of that device (e.g., "gpart list da1"). That should show two partitions, one which is 512k bytes, the other being the rest of the device. If that is the case, then you can do "zpool import freenas-boot", and then do "zfs list".

You can also do that from a working freebsd or freenas system; that would allow you to collect the output.

But the BIOS first.

#3 Updated by 4M8 l93 about 4 years ago

There seems to be a compatibility problem with my BIOS.

I found a way the fix the problem. After the installation, I need to set the boot flag for the partition in the protective MBR. Otherwise the BIOS refuses to boot from the thumb drive.

Please modify the installer to set the boot flag in the protective MBR for improved compatibility.

#4 Updated by Jordan Hubbard about 4 years ago

  • Assignee changed from 4M8 l93 to Sean Fagan

#5 Updated by Jordan Hubbard about 4 years ago

  • Status changed from 15 to Investigation

BRB: Thanks for the additional information - we know what's happening. Investigating how to fix.

#6 Updated by Sean Fagan about 4 years ago

I don't know how to set the boot flag in the protective MBR. What did you do?

(I'm looking now, so I may find it before you tell me. But if you already did it, then you know how to fix it :).)

#7 Updated by 4M8 l93 about 4 years ago

I used fdisk (on linux). First, I set the bootable flag using command "a" and then I wrote the changes to disk (command "w"). I suppose there is a similar program on FreeBSD but I have no idea how to script that as fdisk on linux usually requires user-interaction.

#8 Updated by Sean Fagan about 4 years ago

  • Assignee changed from Sean Fagan to Xin Li

I am not at all clear how to do this. We're relying on GRUB to handle booting. I wonder if this is an issue of older vs newer BIOSes.

Xin, thoughts?

#9 Updated by 4M8 l93 about 4 years ago

I think this is more of an issue on newer BIOSes because they need to detect whether to boot from the thumb drive the traditional way (using the CSM) or via UEFI. It seems that my BIOS uses the bootable flag in the MBR as in indicator if it can boot via the CSM.
Certainly you rely on GRUB for booting but AFAIK GRUB never modifies the partition table - it should probably print a warning on installation if there is no bootable partition in the MBR though.
I assume that the partitioning tool used by FreeNAS automatically creates the protective MBR while creating the GPT but as the "usual" method to boot from a GPT partitioned drive is UEFI, it doesn't mark the partition in the MBR bootable. So I suppose that needs to be done by the FreeNAS installation script after creating the GPT.

#10 Updated by 4M8 l93 about 4 years ago

Maybe this could also be "fixed" in FreeBSD/FreeNAS's partitioning tool.

#11 Updated by Xin Li about 4 years ago

Can you boot a FreeNAS or FreeBSD system and do:

dd if=/dev/da0 bs=512 count=1 | hexdump -C

And paste it here?

My guess is that somehow the BIOS didn't see proper signature on the MBR (which it by all means, should...)

#12 Updated by 4M8 l93 about 4 years ago

Actually, before modifying the MBR, I tried to boot from the thumb drive on another (older) PC and it worked just fine. I'd be surprised if its BIOS didn't verify that its MBR had the signature 0x55AA in its last two bytes. Or do you mean something else when you say "proper signature on the MBR"?

#13 Updated by 4M8 l93 about 4 years ago

  • File freenasmbr_hexdump.txt added

I attached my current MBR (modified!).

#14 Updated by Xin Li about 4 years ago

There is one possibility -- your BIOS may be actually an EFI firmware. When it sees GPT partition table, it would require certain EFI stuff that is not available with FreeNAS at this time.

If there is a "Legacy" mode in your BIOS/EFI boot configuration, please try that and see if it helps.

#15 Updated by 4M8 l93 about 4 years ago

Indeed, my BIOS is UEFI based. That's what I was trying to say in comment 9.
I always boot FreeNAS in legacy mode since I know that it doesn't support booting in UEFI mode. FreeNAS 9.3 does boot on my modern PC using the posted MBR. This MBR should be different than the MBR the installer creates. If you compare both MBRs, I expect that they only differ in byte 0x1be except for different partition sizes. A value of 0x80 in byte 0x1be signifies that the first primary partition is active/bootable, a value of 0x00 signifies that it isn't. Can you confirm this?

#16 Updated by 4M8 l93 about 4 years ago

FYI: There are people that had the same problem when they installed FreeBSD 10-BETA / 10-RC / 10.0-RELEASE, see https://forums.freebsd.org/viewtopic.php?f=4&t=42781#p244684 . They also solved it by marking the partition in the protective MBR active using gpart set -a active adaX. That seems to be the command Sean was looking for.

#17 Updated by Sean Fagan about 4 years ago

  • Status changed from Investigation to Resolved
  • Assignee changed from Xin Li to 4M8 l93

197051a0abaadd530273c9ad469d681d2322450e

That should get into a nightly soon.

#18 Updated by Jordan Hubbard almost 4 years ago

  • Assignee changed from 4M8 l93 to Sean Fagan

#19 Updated by Phil Stickna over 3 years ago

  • Seen in changed from 9.3-M3 to 9.3-STABLE-201506042008

Just want to add that I encountered this on a Gigabyte P55M-UD4. This board doesn't seem to like GPT USB sticks during POST - it just freezes. There's no issue with GPT SATA disks whether internal or via USB adapter, or plugging GPT USB disks in after the BIOS hands off to an OS. They just can't be plugged in during POST.

I used gdisk (http://www.rodsbooks.com/gdisk/gdisk.html) to create a hybrid MBR:
  1. Run gdisk (I used Windows, but I've used the Mac version in the past as well)
  2. Select the FreeNAS boot USB
  3. Type 'r' to enter Recovery menu
  4. Type 'h' to create the Hybrid MBR
  5. Follow the prompts. For me, I selected partition 2, and choose all the default options thereafter. Please read the info at the link above and be sure you're not doing something to destroy data!
  6. When you're done, type 'w' to commit your changes.

Hope this helps someone else!

#20 Updated by 4M8 l93 over 3 years ago

Hi Phil, I think you are having a different problem than I had because my BIOS never froze. There are however other bugreports, e.g. #7631 that I think better match your description.

#21 Updated by D Dobkin over 2 years ago

Phil Stickna wrote:

Just want to add that I encountered this on a Gigabyte P55M-UD4. This board doesn't seem to like GPT USB sticks during POST - it just freezes. There's no issue with GPT SATA disks whether internal or via USB adapter, or plugging GPT USB disks in after the BIOS hands off to an OS. They just can't be plugged in during POST.

I used gdisk (http://www.rodsbooks.com/gdisk/gdisk.html) to create a hybrid MBR:
  1. Run gdisk (I used Windows, but I've used the Mac version in the past as well)
  2. Select the FreeNAS boot USB
  3. Type 'r' to enter Recovery menu
  4. Type 'h' to create the Hybrid MBR
  5. Follow the prompts. For me, I selected partition 2, and choose all the default options thereafter. Please read the info at the link above and be sure you're not doing something to destroy data!
  6. When you're done, type 'w' to commit your changes.

Hope this helps someone else!

It's actually even easier than that. After installing FreeNAS, shut down and boot into OS X. You can use an OS X installer DVD or USB stick for this part.

In OS X open the Terminal and type (substituting the FreeNAS boot disk for "disk0" in the example):

sudo bless /dev/disk0 --setBoot --legacy

Shut down, remove all installation media, and power on the machine.

#22 Updated by Dru Lavigne 9 months ago

  • File deleted (freenasmbr_hexdump.txt)

Also available in: Atom PDF