USB Booting on 32bit EFI Macs

Status
Not open for further replies.

Lorenzo

Cadet
Joined
Jun 9, 2014
Messages
5
Hello to all FreeNAS-Experts,

I am trying to use FreeNAS on a old Mac Pro. The issue is that this old generation does not legacy boot from USB, only EFI-style (i386-efi). I am trying to make it work using Grub2.

My current issue is that I haven’t found yet the right settings for Grub.

Please help me by answering which File system(s) is/are used on the FreeNAS image.
It doesn’t seem to be ZFS, and I also cannot mount it as UFS on my Linux box (ufs_read_super: bad magic number)...

Thanks!
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
To be honest, if your box is limited to 32-bit you aren't going to have a pleasant time with FreeNAS. UFS support is being removed in the next version of FreeNAS and ZFS requires 8GB of RAM minimum and 64-bit. You're also going to have problems installing upgrades even without this problem because of the way that FreeNAS boots.
 

Lorenzo

Cadet
Joined
Jun 9, 2014
Messages
5
The CPU is 64bit, just the EFI is 32bit :)

I have 11GB of (ECC) memory installed, so the performance should be more that sufficient for the lowly backup purpose I want to use it for.
 

Lorenzo

Cadet
Joined
Jun 9, 2014
Messages
5
For the record, it is UFSv1, or ufstype=44bsd in Linux. I just forgot to take account of the disklabels.
Now let’s see if we can convince Grub to handle it ;)
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
The CPU is 64bit, just the EFI is 32bit :)

I have 11GB of (ECC) memory installed, so the performance should be more that sufficient for the lowly backup purpose I want to use it for.

Oh. That's a little weird. But okay. Can you tell I have alot of experience with Macs? ;)
 

Cainram

Dabbler
Joined
Jan 23, 2014
Messages
31
I know what the OP is talking about. I don't have a lot of experience with Macs but I know that there was a weird time with the 64 and 32 bit arena. In particular there are guides on how to force "64 bit" versions of OS X to run on Macs that "are incompatible" - they would run, they just have to be tricked into booting. The thing that sucks is that you are essentially running a Hackintosh on native Mac hardware... But I digress... To Lorenzo's point - if you are using it for "lowly backup purposes", why don't you use an older version of FreeNAS? I know some BSD security purists are going to have a heart attack and I don't want to start a 'thing' here but... If something works locally and you have a decent firewall, why not?

DON'T ANSWER THAT. IT WAS RHETORICAL.

(I know someone will quote the above and give a million reasons 'why not' but, whatever.)
 

Cainram

Dabbler
Joined
Jan 23, 2014
Messages
31
Going further... I have a similar Mac Pro - an early 2008 model. I'm installing FreeNAS to an SSD in the first bay. I don't know much about Macs or FreeBSD for that matter, but I think I've got it licked. Here is my first bit of advice: forget booting from USB. You may be able to finagle it with a 'magic' boot cd and holding the C key on a keyboard every time you want to boot or installing OS X to a second USB drive and reconfiguring rEFIt to auto-boot (that is what we do with a FreeNAS server at work on a modern Mac Mini...). My point is... just boot from a hard disk. It's easier. My boss is a hard core BSD and Mac fanatic and he was trying to get me to do all kinds of weird sh*t. Just do like I did and sacrifice an HDD bay to the OS. The headaches you save will be worth it and if you use an SSD like I am you may be able to use some of it as a ZFS intent log... I hope. See my earlier question here. Good luck.

http://forums.freenas.org/index.php...or-freenas-installation-and-intent-log.21524/
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Yeah.. you can't use any of it for anything.. :(
 

Lorenzo

Cadet
Joined
Jun 9, 2014
Messages
5
Cainram:
If you are using it for "lowly backup purposes", why don't you use an older version of FreeNAS?
How would that help? I would rather need a newer (not yet existing) version that ideally supports UEFI booting or uses at least GPT formatting ;)

Given that GPT formatting would also allow using the OS disc, e.g., for the ZIL/L2ARC, it would benefit not only yours truly. I hope the FreeNAS developers consider this idea... I also know that FreeBSD supports GPT, so it might not be that complicated :)

In any case, after over one day of promising, but ultimately fruitless attempts I have to throw in the towel. In the next post I’ll document my attempts, maybe they will be of use to someone – or someone might spot an obvious error, leading to copious mac-efi32 booting goodness!
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I don't think you understood.. using your OS disk as a ZIL or L2ARC will never be something you should do(or even can?). The ZIL and L2ARC both have algorithms that would interfere with proper access to the OS and could cause its own problems.
 

Lorenzo

Cadet
Joined
Jun 9, 2014
Messages
5
using your OS disk as a ZIL or L2ARC will never be something you should do(or even can?).
I see. It might not be ideal, but it can be done if FreeNAS used GPT, this is all I wanted to say.

Anyway, as promised, here are my attempts.

1. Hybrid GPT/MBR
This seemed like the obvious minimal-invasive strategy: leaving the MBR in place and adding just in the GPT an EFI system partition with Grub.
However, in this configuration the Mac Pro wouldn’t offer to boot from USB (i.e., the drive wouldn’t show up in the EFI boot manager)
I remember having read somewhere in the threads dedicated to making Mavericks run on the Mac Pro (what Cainram also mentioned) that someone made it boot from a Hybrid GPT, but who knows.

2. GPT
I just created a fresh GPT with an EFI system partition, formatted it as FAT and mounted it at /mnt/EFISYS, and installed Grub2
Code:
grub2-install --boot-directory=/mnt/EFISYS --efi-directory=/mnt/EFISYS --target=i386-efi --removable

then I created other four partitions with sizes equal to the partitions in the FreeNAS image, and simply used dd to copy the partitions from the image to the stick.

The Mac Pro would allow to boot from this stick and happily load Grub. So far, so good.
Here’s the grub.cfg I used to experiment with:

Code:
insmod part_gpt
insmod part_bsd
insmod ufs1
 
menuentry 'One' {
    insmod chain
    set root=(hd0,gpt2,bsd1)
    chainloader /boot/loader
}
 
menuentry 'Two' {
    set root=(hd0,gpt2,bsd1)
    kfreebsd /boot/loader
}
 
menuentry 'Three' {
    set root=(hd0,gpt2,bsd1)
    kfreebsd /boot/kernel/kernel
    kfreebsd_loadenv /boot/device.hints
}


It turns out that Grub is able to read the UFS filesystem in (hd0,gpt2,bsd1) (the first partition has a BSD disklabel), so success seemed palpable. However, none of these entries (and the many variations I tried) actually work.

chainloader +1 OR chainloader /whatevs => "error: not a valid root device". I suspect this one works only with MBR
kfreebsd /boot/loader => just hangs.
kfreebsd /boot/kernel/kernel => "error: no symbol table"

I hope this will be of use to someone.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I see. It might not be ideal, but it can be done if FreeNAS used GPT, this is all I wanted to say.

Pretty risky, and anyone with a clue will tell you that just because you can do that doesn't mean you should even consider it, let alone do it.
 
Status
Not open for further replies.
Top