# Installing on macpro1,1: installs but does not boot



## hlindh (Dec 11, 2016)

I'm trying to get FreeBSD running on an old macpro1,1. There are a couple of threads with at least one user indicating that it should be possible.

First, FreeBSD 11 appears to be impossible to install right now. The official install images are unbootable on the old macpro because they are hybrid EFI64/BIOS images, and a BIOS-only CD image that I built myself could not mount root on the machine (although it worked in Virtualbox).

FreeBSD 10.3 and 10.2 installers boot and installing works, but the installed OS does not boot. It only shows a black screen for a few seconds and then a blinking underscore cursor appears at the top left corner and after that it does not progress anymore.

My setup has two hard disks. One with OS X and one that I would dedicate to FreeBSD, an SSD if that matters.

I've tried different combinations of MBR/GPT and UFS/ZFS, but all of them have produced the same result, described above. Partitioning to MBR allowed the Apple EFI boot chooser (holding option key during boot) to see the FreeBSD disk as Windows, while any GPT installation attempt did not show there. Blessing the GPT attempts with
`bless --device /dev/disk1s1 --setBoot`
allowed them to "boot" to the all-too-familiar black screen. Blessing without --setBoot did nothing with visible effect.

I have tried with the gpart bootcode incantations and without and that trick also does not seem to do much. Actually, I'm wondering why such should even be necessary? Can the installer really not set up the boot partition it creates?

I have also tried to boot it from GRUB and rEFInd. GRUB (EFI version) could not read zfs volumes and could not boot from a ufs installation, rEFInd recognized FreeBSD and ended up in the same black screen as normal boot attemps.

I have never had as much difficulties in getting an OS installed and I have done plenty of serial console installs to headless machines loaded through TFTP and such, so I can usually work my around these things.

If anyone remembers seeing the black screen boot and knows what it means and how to fix it, I'd sure appreciate hearing about it.


----------



## hlindh (Dec 23, 2016)

Some progress:

Using MBR with either UFS / ZFS works when I use
`gpart bootcode -b /boot/mbr ada0`
and
`bless --device /dev/disk0 --setBoot --legacy`
The blessing might not be needed, actually, but I don't know how to undo any blessings, so it's difficult to verify. At least the MBR/UFS combo survived NVRAM reset without reblessing anything.

Using GPT always results in the black screen with blinking cursor, which leads to believe that maybe there is something wrong with the protective MBR loader /boot/pmbr. Yet, other people have succeeded in getting GPT to work..


----------



## teh_fink (Mar 7, 2017)

I'm trying to do the same (MacPro 2,1), and running into the same issues with FreeBSD 11. Were you able to make any progress?


----------



## trev (Mar 7, 2017)

The OS X `bless` stores the result in NVRAM - I guess if you want to "undo" it, you'd need to follow this Apple support article https://support.apple.com/en-au/HT204063

I'm not sure whether what follows is your issue or not, but it may be worth a shot.

After FreeBSD 9.x I was unable to get a Mac Mini (late 2009 - 3,1 hardware version) to boot GPT partitions. The issue seems to be the size of the boot-partition. FreeBSD 9.x used 64KB, but FreeBSD 10.x uses 512KB during install. I have found that a 128KB partition does boot (I only increased it from 64KB for some future proofing ... no idea why FreeBSD 10.x jumped from 64KB to 512KB).


```
1. Name: ada0p1
   Mediasize: 131072 (128K)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 1024
   Mode: r0w0e0
   rawuuid: 37a79448-fa27-11e6-8a81-0026bb5b0dd0
   rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
   attrib: bootme
   label: (null)
   length: 131072
   offset: 17408
   type: freebsd-boot
   index: 1
   end: 289
   start: 34
```

Additionally, I did not have to `bless` the drive, but instead set the `bootme` attribute on the partition with gpart(). This even made the Mini boot from the external USB drive and ignore the internal drive which was blessed


----------



## hlindh (Mar 7, 2017)

teh_fink said:


> I'm trying to do the same (MacPro 2,1), and running into the same issues with FreeBSD 11. Were you able to make any progress?



Yes, I got 10.3 working. More recently I even got 11.0 working. The main obstacle for me was believing and blindly copy & pasting incantations from the forums or web or expecting knowledgeable people to help with such an exotic platform instead of actually looking into how things work. Compared to installing ubuntu on a bog standard PC the process was unbelievably tiresome. 

I'm going to write a blog post or something about the whole thing, but I can help you with specific issues here. First, I'd like to ask you, just out of curiosity, how did you get FreeBSD 11 install media to even boot? rEFInd? The provided media has EFI64 and BIOS dual boot setup and it does not work as-is on EFI32 machines such as the macpro2,1, unless you were using a 32-bit media which I wouldn't recommend. I posted a bug report on that (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=215143). The 10.3 non-uefi install media works. If you want 11.0, I can provide you an install media that works.


----------



## hlindh (Mar 7, 2017)

trev said:


> The OS X `bless` stores the result in NVRAM - I guess if you want to "undo" it, you'd need to follow this Apple support article https://support.apple.com/en-au/HT204063
> 
> I'm not sure whether what follows is your issue or not, but it may be worth a shot.
> 
> After FreeBSD 9.x I was unable to get a Mac Mini (late 2009 - 3,1 hardware version) to boot GPT partitions. The issue seems to be the size of the boot-partition. FreeBSD 9.x used 64KB, but FreeBSD 10.x uses 512KB during install. I have found that a 128KB partition does boot (I only increased it from 64KB for some future proofing ... no idea why FreeBSD 10.x jumped from 64KB to 512KB).



The bootcode (gptzfsboot, etc.) appears to be fatter now than 64 KiB, so that probably explains the partition size increase. If you tried to install the new bootcode to a partition too small for it, it obviously wouldn't work.


----------



## trev (Mar 7, 2017)

hlindh said:


> The bootcode (gptzfsboot, etc.) appears to be fatter now than 64 KiB, so that probably explains the partition size increase. If you tried to install the new bootcode to a partition too small for it, it obviously wouldn't work.



The problem was the reverse  The boot partition was too big, not too small. Shrinking it from 512KB to 128KB worked in so far as the boot code is installed and the system will actually boot which it won't with a 512KB partition <shrug/>


----------



## hlindh (Mar 7, 2017)

trev said:


> The problem was the reverse  The boot partition was too big, not too small. Shrinking it from 512KB to 128KB worked in so far as the boot code is installed and the system will actually boot which it won't with a 512KB partition <shrug/>



I've got 512 KiB boot partition on the macpro and everything's peachy. I guess you're hitting a _feature_ in your particular Mac model's Apple EFI implementation  I suppose you'd be better off utilizing the EFI support in newer FreeBSDs, though, and just put the EFI loader somewhere where you can bless it for the Apple firmware. Mac Mini 2009 has 64-bit EFI, has it not?


----------



## trev (Mar 7, 2017)

hlindh said:


> I've got 512 KiB boot partition on the macpro and everything's peachy. I guess you're hitting a _feature_ in your particular Mac model's Apple EFI implementation



Oh, undoubtedly a _feature_ to make life interesting ;-)



> I suppose you'd be better off utilizing the EFI support in newer FreeBSDs, though, and just put the EFI loader somewhere where you can bless it for the Apple firmware. Mac Mini 2009 has 64-bit EFI, has it not?



Yeah, tried that. The install worked, wonder of wonders, but the system then suffered file system induced panics during heavy i/o (eg buildworld). The non-EFI install did not have this issue. 

I know, I know, I'm told the EFI installation couldn't cause this... it just did. I tried EFI/nonEFI installations several times and the EFI one would always panic while the non-EFI one has never done so.


----------



## teh_fink (Mar 9, 2017)

Hi guys, thanks for your help!

TLDR: successfully installed FreeBSD 11 via zfsonroot & booted a MacPro2,1, but got stuck on loading zfspools:

```
Solaris: NOTICE: Cannot find the pool label for 'zroot'
Mounting from zfs:zroot/ROOT/default failed with error 5.
```
----


hlindh said:


> First, I'd like to ask you, just out of curiosity, how did you get FreeBSD 11 install media to even boot?



By applying the c program from this page:
https://mattgadient.com/2016/07/11/linux-dvd-images-and-how-to-for-32-bit-efi-macs-late-2006-models/
to the FreeBSD 11 AMD64 dvd image, I was able to burn a DVD which booted in the MacPro2,1 (Quad-Core Intel Xeon, 3 GHz, Boot ROM MP21.007F.B06, etc.)

The machine has a single 120GB SSD, on which I tried via the FreeBSD installer to install zfsonroot using the various presets (mbr bios, gpt bios, gpt uefi, gpt bios + uefi, gpt + active bios, gpt + lenovo fix bios). The MBR default install setting was the only one which succeeded in showing a hard drive labeled "Windows" in the Apple Startup Manager (holding down the option key on reboot). However, choosing it results in a console screen with a message "missing operating system".

Using some commands from when I had installed mirrored zfsonroot using FreeBSD 8 on a bunch of these machines a few years ago, things moved bit further. After booting from the DVD again and choosing the live system:


```
# gpart list
Geom name: ada0
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 234441647
first: 63
entries: 4
scheme: MBR
Providers:
1. Name: ada0s1
   Mediasize: 120034086912 (112G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 32768
   Mode: r2w2e4
   attrib: active
   rawtype: 165
   length: 120034086912
   offset: 32768
   type: freebsd
   index: 1
   end: 234441639
   start: 64
Consumers:
1. Name: ada0
   Mediasize: 120034123776 (112G)
   Sectorsize: 512
   Mode: r2w2e6

Geom name: ada0s1
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 234441575
first: 0
entries: 8
scheme: BSD
Providers:
1. Name: ada0s1a
   Mediasize: 2147483648 (2.0G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 32768
   Mode: r1w1e1
   rawtype: 27
   length: 2147483648
   offset: 0
   type: freebsd-zfs
   index: 1
   end: 4194303
   start: 0
2. Name: ada0s1b
   Mediasize: 8589934592 (8.0G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 2147516416
   Mode: r0w0e0
   rawtype: 1
   length: 8589934592
   offset: 2147483648
   type: freebsd-swap
   index: 2
   end: 20971519
   start: 4194304
3. Name: ada0s1d
   Mediasize: 109296664576 (102G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 2147516416
   Mode: r1w1e1
   rawtype: 27
   length: 109296664576
   offset: 10737418240
   type: freebsd-zfs
   index: 4
   end: 234441567
   start: 20971520
Consumers:
1. Name: ada0s1
   Mediasize: 120034086912 (112G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 32768
   Mode: r2w2e4

# gpart set -a active -i 1 ada0
active set on ada0s1

# gpart show ada0
=>       63  234441585  ada0  MBR  (112G)
         63          1        - free -  (512B)
         64  234441576     1  freebsd  [active]  (112G)
  234441640          8        - free -  (4.0K)

# gpart show ada0s1
=>        0  234441576  ada0s1  BSD  (112G)
          0    4194304       1  freebsd-zfs  (2.0G)
    4194304   16777216       2  freebsd-swap  (8.0G)
   20971520  213470048       4  freebsd-zfs  (102G)
  234441568          8          - free -  (4.0K)

# more /boot/loader.conf
vfs.root.mountfrom="zfs:zroot/ROOT/default"
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
zfs_load="YES"

# ls -l /boot/zfs*
-r--r--r--  1 root  wheel   66048 Sep 28 21:45 /boot/zfsboot
-r-xr-xr-x  1 root  wheel  389120 Sep 28 21:45 /boot/zfsloader

/boot/zfs:
total 5
-rw-r--r--  1 root  wheel  1248 Mar  8 12:40 zpool.cache

# zfs list
NAME                 USED  AVAIL  REFER  MOUNTPOINT
bootpool             121M  1.80G   121M  /mnt/bootpool
zroot                279M  97.6G    96K  /mnt/zroot
zroot/ROOT           278M  97.6G    96K  none
zroot/ROOT/default   277M  97.6G   277M  /mnt
zroot/tmp             96K  97.6G    96K  /mnt/tmp
zroot/usr            384K  97.6G    96K  /mnt/usr
zroot/usr/home        96K  97.6G    96K  /mnt/usr/home
zroot/usr/ports       96K  97.6G    96K  /mnt/usr/ports
zroot/usr/src         96K  97.6G    96K  /mnt/usr/src
zroot/var            600K  97.6G    96K  /mnt/var
zroot/var/audit       96K  97.6G    96K  /mnt/var/audit
zroot/var/crash       96K  97.6G    96K  /mnt/var/crash
zroot/var/log        120K  97.6G   120K  /mnt/var/log
zroot/var/mail        96K  97.6G    96K  /mnt/var/mail
zroot/var/tmp         96K  97.6G    96K  /mnt/var/tmp

# kldstat
Id Refs Address            Size     Name
 1   20 0xffffffff80200000 1fa7c38  kernel
 2    1 0xffffffff82221000 2a05     uhid.ko
 3    1 0xffffffff82224000 3710     ums.ko
 4    1 0xffffffff82228000 1fe5a3   zfs.ko
 5    1 0xffffffff82427000 811f     opensolaris.ko
 6    1 0xffffffff82430000 adec     tmpfs.ko
 7    1 0xffffffff8243b000 665d     nullfs.ko

# gpart bootcode -b /boot/boot0 ada0
bootcode written to ada0

# reboot
```

Resulted in an unresponsive console screen with something like:
`F1 FreeBSD
F6 PXE
Boot: F1 ##`

Trying again from the DVD:

```
# dd if=/boot/zfsboot of=/dev/ada0s1 count=1
# dd if=/boot/zfsboot of=/dev/ada0s1a skip=1 seek=1024
dd: Operation not supported
```

Resulted in it booting and showing the beastie logo! But booting hung when trying to load the zfs pools:

```
…
uhub5: <Alps Electric Hub in Apple Extended USB Keyboard…> on usbus2
Solaris: NOTICE: Cannot find the pool label for 'zroot'
Mounting from zfs:zroot/ROOT/default failed with error 5.

Loader variables:
 vfs.root.mountfrom=zfs:zroot/ROOT/default

Manual root filesystem specification:
…
mountroot>
```

At this point, I'm in over my head, so any help would be appreciated.


----------



## teh_fink (Mar 9, 2017)

hlindh said:


> I've got 512 KiB boot partition on the macpro and everything's peachy.


Could you post your output from `gpart show`, and any relevant bootcode commands? I'll see if I can replicate it!
Thanks


----------



## trev (Mar 11, 2017)

hlindh said:


> I've got 512 KiB boot partition on the macpro and everything's peachy. I guess you're hitting a _feature_ in your particular Mac model's Apple EFI implementation  I suppose you'd be better off utilizing the EFI support in newer FreeBSDs, though, and just put the EFI loader somewhere where you can bless it for the Apple firmware. Mac Mini 2009 has 64-bit EFI, has it not?



Latest attempts with Mac Mini 3,1 late 2009 --

1. A stable snapshot of FreeBSD 11 amd64 on CD does not boot - offering the 1, 2 option but no keyboard input working. Holding down the ALT/Option key shows bootable Windows and EFI partitions (the 1, 2 I assume) and choosing EFI allows the CD to boot. It then installs with EFI (accepting the guided partitioning install) but does not boot. Holding down the ALT/Option key shows the EFI install on the internal drive and choosing it boots. Unfortunately heavy file system i/o causes file system induced panics.

2. Same incantation needed to boot the stable snapshot of FreeBSD 11 amd64 CD. It installs without EFI by choosing manual partitioning and setting up a GPT disk. It does not boot. Interestingly, escaping to the CD bootloader prompt and using `lsdev` only shows the two CD partitions and no internal drive at all.

3. Same incantation needed to boot the stable snapshot of FreeBSD 11 amd64 CD. Installing using MBR partitioning works, but again fails to boot. I didn't bother messing with this attempt, just confirmed it didn't boot.

4. Using a FreeBSD 9.1-Release CD, the CD boots without any magic. Proceeding to do a GPT (non-EFI) installation works and the system reboots without any magic incantations -- white screen for 30-60 seconds, then black screen with top left flashing hyphen which after a second or two spins and the system boots FreeBSD. Interestingly, escaping to the CD bootloader prompt, an `lsdev` shows both the CD partitions and the internal drive partition.

5. Following on from the successful FreeBSD 9.1 installation, doing a `freebsd-update` to bring 9.1 up to date, then an upgrade to 10.3-Release and finally an upgrade to 11-Release works and the system still boots all by itself.

[ Note that downloading the latest src code and building world and kernel does not panic the machine when installed without EFI, but with an EFI installation it paniced the machine every time either during downloading or during compilation or both. I even resorted to replacing the hard drive which in this Mini involves putty knives and is not for the faint of heart  So, I can rule out the hard drive as the source of the panic issue. ]

Previous attempts with FreeBSD 9.3 and 10.x CDs are documented here


----------



## teh_fink (Mar 11, 2017)

Thanks for the detailed list. I might end up trying FreeBSD 9 and moving up from there. 


trev said:


> A stable snapshot of FreeBSD 11 amd64 on CD


What exactly is that? Do you mean the mfsbsd image?


----------



## trev (Mar 11, 2017)

teh_fink said:


> What exactly is that? Do you mean the mfsbsd image?



No - see https://www.freebsd.org/snapshots/

I downloaded the stable snapshot from 1 March from https://www.freebsd.org/where.html (scroll down to the FreeBSD 11.0-STABLE listing).


----------



## hlindh (Mar 12, 2017)

teh_fink said:


> Could you post your output from `gpart show`, and any relevant bootcode commands? I'll see if I can replicate it!
> Thanks



The basic drill is:

Get the STABLE 11 snapshot install CD and modify that to remove the EFI part (I built the images by myself, but if the hybrid CD stripper tools work, then, by all means..) RELEASE-11.0.0 does not work on my macpro1,1 and as I understand there's very little different in a macpro2,1. The RELEASE kernel simply has some problems with the hardware or firmware and gets stuck mounting root so don't use it. I haven't tried RELENG, yet..

Install with autopartitioning, ZFS, GPT (BIOS). That will give you a GPT partition map with protective MBR, MBR booter and BIOS-compatible ZFS loader in the boot partition. You don't need to do any of the gpart bootcode magic mentioned by some other sources. That is already done by bsdinstall as I suspected in my initial posting so all of that would be basically NOOPs.

Then comes the tricky part. Because of Apple's nice firmware, no amount of blessing will make the GPT-partitioned drive boot a BIOS-based OS. Instead, you need to create a hybrid MBR from the GPT partition map that contains #1 a protective MBR, #2 the bsd boot partition and #3 the bsd root partition. That can be accomplished with the gdisk tool on Linux (some rescue cd?), which I used, or, for instance, rEFInd (I think the rEFInd bootcd might do it so you don't need to install anything). There's also plenty of info on hybrid MBRs on rEFInd's site. With the hybrid MBR in place, you should start seeing your BSD install as Windows in Apple's boot chooser (Alt/Option after start-up chime) and it should also be able to boot.


----------



## tfba (Mar 13, 2017)

Hi, do you know if I'd have similar issues with FreeBSD on my MacPro 3,1?  It currently runs 10.11 with Open ZFS on OS X and is used as a backup system to send snapshots to (from a FreeBSD machine).  So I'm considering FreeBSD on it instead of OS X but it sounds like it's not that straight forward to get to boot.


----------



## hlindh (Mar 13, 2017)

tfba said:


> Hi, do you know if I'd have similar issues with FreeBSD on my MacPro 3,1?  It currently runs 10.11 with Open ZFS on OS X and is used as a backup system to send snapshots to (from a FreeBSD machine).  So I'm considering FreeBSD on it instead of OS X but it sounds like it's not that straight forward to get to boot.



It should be easier because the MacPro3,1 has a 64-bit EFI. Most of the problems with the MacPro1,1 and 2,1 come from their 32-bit EFI and the (required) BIOS emulation. Linux works fine,  because they have 32-bit EFI to 64-bit EFI translation layer in the kernel. In any case, the BIOS emulation should work at least, and you shouldn't need to mess with the install cds in any way (or build your own).

However, read what trev writes above about his experiences with FreeBSD booted from EFI, so things might not be as rosy as they should. I would first try whether the RELEASE-11 install cd boots without problems, and if it doesn't, use the STABLE-11 snapshot. Then if you hit similar problems as trev, I would do a BIOS install, save `sysctl -a` from that, followed by an EFI install and compare its `sysctl -a` to the BIOS one in case there are some kernel tunables that get different values from EFI.


----------



## tfba (Mar 13, 2017)

hlindh said:


> It should be easier because the MacPro3,1 has a 64-bit EFI. Most of the problems with the MacPro1,1 and 2,1 come from their 32-bit EFI and the (required) BIOS emulation. Linux works fine,  because they have 32-bit EFI to 64-bit EFI translation layer in the kernel. In any case, the BIOS emulation should work at least, and you shouldn't need to mess with the install cds in any way (or build your own).
> 
> However, read what trev writes above about his experiences with FreeBSD booted from EFI, so things might not be as rosy as they should. I would first try whether the RELEASE-11 install cd boots without problems, and if it doesn't, use the STABLE-11 snapshot. Then if you hit similar problems as trev, I would do a BIOS install, save `sysctl -a` from that, followed by an EFI install and compare its `sysctl -a` to the BIOS one in case there are some kernel tunables that get different values from EFI.



Thanks.  I'll give it a go with EFI first and see how it works.


----------



## teh_fink (Mar 13, 2017)

Hi guys,
I'm happy to report a successful zfsonroot install & boot of FreeBSD 11 amd64 on a MacPro2,1!

Steps to reproduce:

Convert the FreeBSD 11 AMD64 dvd install image using mattgadient's c program:
http://ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/11.0/FreeBSD-11.0-RELEASE-amd64-dvd1.iso
https://mattgadient.com/2016/07/11/linux-dvd-images-and-how-to-for-32-bit-efi-macs-late-2006-models/


Boot from DVD and in the installer, choose zfs on root install, mbr bios, 8g swap, single disk stripe
I used a single 120GB SSD in the 1st drive bay

Proceed with installation and setup, and at the last stage of the of the install, choose the shell to allow for command line configuration
I ran the following commands, and then rebooted:
`# systctl kern.geom.debugflags=16
# gpart bootcode -b /boot/boot0 ada0
bootcode written to ada0
# cp /boot/zfsboot /tmp/zfsboot
# zpool export bootpool
# dd if=/tmp/zfsboot of=/tmp/zfsboot_count-1 count=1
dd: …
# gpart bootcode -b /tmp/zfsboot_count-1 /dev/ada0s1
bootcode written to ada0s1
# dd if=/tmp/zfsboot of=/dev/ada0s1a skip=1 seek=1024
dd: …
# exit`

This should work! I tried it twice from scratch to be sure. When holding down the option key on startop, you should see two disks labeled "Windows": a hard drive icon (your FreeBSD install), and a CD icon (the install disk).

Additionally, I had run at various times the following commands, while booted from an OSX 10.7 disk:
`bless --device /dev/disk0 --setBoot --verbose
bless --device /dev/disk0 --setBoot --verbose --legacy`
I don't know which of these are necessary, or if they are at all required with just a single disk.

Later I'll post the full command line output as well as system specs.

Thanks to hlindh, npaisnel, sprock, tfba, et al. for your help!


----------



## hlindh (Mar 14, 2017)

Uh..I think you went slightly overboard with that one, but glad it works  Using plain MBR, at least with 10.3 just works straight outta installer. I don't see why 11 wouldn't, but 11 needs a STABLE kernel instead of RELEASE. I wanted GPT and to see FreeBSD in the boot menu, so hybrid MBR was needed. When you have MBR and there's a partition set as bootable there, you don't need those bless commands. They can be used (with --setBoot) to force booting from something when there are no other OSs to care about and the firmware doesn't want to recognize anything as bootable by itself, eg. attempting boot from a GPT install of a BIOS OS (which then likely fails at a later stage for other reasons).


----------



## teh_fink (Mar 14, 2017)

hlindh said:


> I think you went slightly overboard with that one


It actually wasn't that complicated, as the DVD's standard installer interface can be used. The various commands were taken from this wiki tutorial (which I had long ago used to install 8.3 RELEASE amd64 with mirrored zfsroot on these machines), and just needed to be adapted to the vagaries of the FreeBSD 11 setup (eg: bootpool, etc.).



hlindh said:


> Using plain MBR, at least with 10.3 just works straight outta installer. I don't see why 11 wouldn't, but 11 needs a STABLE kernel instead of RELEASE.


I specifically needed a stock install tracking RELEASE, preferably with standard settings from the installer.
Unfortunately, none of the standard 11 RELEASE images would boot in any of the Mac Pro 2,1s I tried. Once I was able to boot from the converted DVD image, the only zfsonroot install that would show up in the Apple Startup Manager despite using the various bless commands was MBR – all noted here.

If anybody else was able to install 11 RELEASE on a Mac Pro 2,1 with something other than MBR, I'd love to know how! But to be honest MBR is good enough for our uses at the moment, seeing as it boots directly without issues.


----------



## hlindh (Mar 14, 2017)

teh_fink said:


> It actually wasn't that complicated, as the DVD's standard installer interface can be used. The various commands were taken from this wiki tutorial (which I had long ago used to install 8.3 RELEASE amd64 with mirrored zfsroot on these machines), and just needed to be adapted to the vagaries of the FreeBSD 11 setup (eg: bootpool, etc.).
> 
> 
> I specifically needed a stock install tracking RELEASE, preferably with standard settings from the installer.
> ...



At least regarding MacPro1,1, they broke something in 11.0 that used to work in 10.3 and again works in STABLE-11 and current CURRENT. Assuming the same breakage affects MacPro2,1, and you want to track RELEASE, you'd have to wait for 11.1 (or use 10.3) and then you can probably use the instructions I outlined to get a system that has GPT and zfsroot. Building an install CD from RELENG might also work in the meantime, but I haven't verified that.

The main thing to notice about any install method is that the Apple firmware requires quite specific form of MBR to recognize it as something bootable and most of the mistakes and successes seem to happen there. In the hybrid MBR method Apple's firmware will see MBR and FreeBSD will see GPT.


----------



## teh_fink (Sep 5, 2018)

hlindh said:


> and you want to track RELEASE



Sorry for not following up sooner, but in case anyone is still wondering about this setup, I soon after had some issues installing OS updates or running pf, as apparently after a reboot, 'bootpool' was not automatically loaded. Following the directions here fixed the problem:

`# nano /boot/loader.conf`

```
zpool_cache_load="YES"
zpool_cache_type="/boot/zfs/zpool.cache"
zpool_cache_name="/boot/zfs/zpool.cache"
```

After a reboot:
`# zpool list`

```
NAME       SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
bootpool  1.98G   256M  1.73G        -         -    10%    12%  1.00x  ONLINE  -
zroot      101G  3.08G  97.9G        -         -     1%     3%  1.00x  ONLINE  -
```


----------



## Martin Etcheverry (Jun 28, 2020)

Hi everyone! Using the method from *teh_fink *i succesfully installed the freebsd 13 on a old macbook pro 2,1. 
but i have a tottaly noob question (yes i am migrating from linux to freebsd , and i am a noob on freebsd)*: 
i can't find /boot/loader.conf *
so i cant configure support for touch pad, etc. 
any help is super appreciated.


----------



## tingo (Jun 28, 2020)

It might not exist by default; simply create it `# touch /boot/loader.conf` and add any options you need.


----------



## teh_fink (Dec 5, 2020)

Just successfully installed *FreeBSD 12.2 *on a *MacPro2,1*: Quad-Core Intel Xeon, 3 GHz, 2 Processors, 8 Cores

Steps to install zfs-on-root on a single, boot SSD:

Boot from converted 12.2 DVD using isomacprog.c from here: https://mattgadient.com/2016/07/11/linux-dvd-images-and-how-to-for-32-bit-efi-macs-late-2006-models/
Partitioning: Auto ZFS, zfs on root install
Single disk stripe: ada0
Partition scheme: mbr bios

Manual configuration
sysctl kern.geom.debugflags=16
gpart bootcode -b /boot/boot0 ada0
cp /boot/zfsboot /tmp/zfsboot
zpool export bootpool
dd if=/tmp/zfsboot of=/tmp/zfsboot_count-1 count=1
gpart bootcode -b /tmp/zfsboot_count-1 /dev/ada0s1
dd if=/tmp/zfsboot of=/dev/ada0s1a skip=1 seek=1024
zpool import bootpool
echo 'zpool_cache_load="YES"' >> /boot/loader.conf
echo 'zpool_cache_type="/boot/zfs/zpool.cache"'  >> /boot/loader.conf
echo 'zpool_cache_name="/boot/zfs/zpool.cache"' >> /boot/loader.conf
exit

Reboot

Without the commands in the "manual configuration" section, bootpool didn't automatically load after reboot, which means pf won't load and freebsd-update won't work. For example:

```
# /usr/sbin/freebsd-update fetch
src component not installed, skipped
Cannot identify running kernel
# zpool import bootpool
cannot import 'bootpool': pool may be in use from other system
use '-f' to import anyway
# zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
zroot  89.5G   267M  89.2G        -         -     0%     0%  1.00x  ONLINE  -
# zpool import -f bootpool
# zpool list
NAME       SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
bootpool  1.88G   137M  1.74G        -         -     0%     7%  1.00x  ONLINE  -
zroot     89.5G   267M  89.2G        -         -     0%     0%  1.00x  ONLINE  -
```


----------

