FreeBSD Slow ZFS Bootloader

This is just a quick little post for people running into the same problem and spending a lot of time to figure this out.

I was setting up a new server which was built with a Supermicro X11SSL-F motherboard. I booted via IPMI and installed FreeBSD 10.3 with a ZFS Root Mirror setup. After the reboot, the boot loader took forever to make progress. The whole boot process took about 10 minutes where most of the time was spent in the BTX Loader and the boot menu screen with the little spinning progress indicator making a move only every second.

Once the kernel was loaded, the rest of the boot process was fast again.

I suspected some weird BIOS / SATA interaction and first tried all kinds of BIOS settings to fix the issue but with no success. I tried different SSDs and HDDs and I tried using a non mirror setup. Lastly I checked whether UFS had the same problem because the installer from the CD image bootet just fine and indeed installing FreeBSD 10.3 on UFS worked normally.

Then I tried installing FreeBSD 11-ALPHA-3 and with that my ZFS Root Mirror setup booted lightning fast as well. That meant it was really the ZFS boot loader (gptzfsboot/zfsloader) that was problematic.

Lastly I tried installing 10.3 on a ZFS Mirror again, then booting the FreeBSD 11 image and copying the boot loader from 11 into my 10.3 /boot directory because a newer boot loader should be able to load older versions of FreeBSD.

So once I booted from the FreeBSD 11 image again, I imported and mounted my installed pool to /mnt and copied all boot / zfs related files from the image to /mnt/boot/ (watch out for /boot/loader.conf and /boot/zfs/zpool.cache!).

Then I rebooted and now the boot process was lightning fast like in the beginning when I installed 11 only that it was now booting 10.3.

The files I’ve copied are: /boot/pmbr, /boot/gptzfsboot and /boot/zfsloader

Also see »How FreeBSD Boots on ZFS«

4 thoughts on "FreeBSD Slow ZFS Bootloader"

  1. Mark says:

    Very nice, thank you for the hint with the boot loader.

  2. Florian says:

    Had the exact same issue with the exact same board and exact same FreeBSD. Thanks a lot!

  3. Joerg says:

    Thanks for your post – I had exactly the same issue (well, my board is a X11SSM…), even tried an Upgrade from FreeBSD 10.3 to 10.4 (but that didn’t help). After reading your description, I installed 11.1-RELEASE in a VirtualBox and grabbed the bootloader files from there. After writing the bootloader to my existing zroot pool disks (gpart -b … -p … ) the issue was solved. Thanks a lot!

  4. mike says:

    Cool! Just ran into this yesterday!

Leave a Reply

Your email address will not be published. Required fields are marked *