Unable to boot after adding an extra partition.

Mike Clarke mike at milibyte.co.uk
Mon Nov 7 21:18:47 UTC 2016

My current motherboard uses BIOS boot but in preparation for the new
motherboard I'll be installing soon I thought I'd add an efi boot
partition. Somewhere along the way I must have done something wrong
because I ended up being locked out and unable to boot.

curlew:/home/mike% uname -a
FreeBSD curlew.lan 11.0-RELEASE-p2 FreeBSD 11.0-RELEASE-p2 #0: Mon Oct
24 06:55:27 UTC 2016
root at amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

I have a ZFS mirror running on a couple of SSD's at ada0 and ada3. When
I installed them a couple of years ago I left some spare space in
readiness for this:

=>       34  250069613  ada0  GPT  (119G)
         34          6        - free -  (3.0K)
         40       1024     1  bios-boot  (512K)
       1064       3032        - free -  (1.5M)
       4096  230686720     2  freebsd-zfs  (110G)
  230690816   19378831        - free -  (9.2G)
I added a 512K efi partition with:
gpart add -t efi -b 2048 -s 1024 -l efiboot1 ada0
gpart add -t efi -b 2048 -s 1024 -l efiboot2 ada3

This created a new partition with index 3 on each drive between the
partitions numbered 1 and 2 with some free space on each side.

I then created /EFI/BOOT in each efi partition and
copied /boot/boot1.efi into it.

I was then unable to boot my system, it just hung immediately after the
"Verifying DMI Pool Data" message.

I ran "gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0", and
likewise for ada3, in case the boot partition had been corrupted but
that made no difference.

After this I deleted the efi partition, and re-ran gpart bootcode, to
revert to the original configuration. When I next rebooted it failed

Verifying DMI Pool Data .............
Missing boot loader

As a workaround I've used zfs send | zfs receive to copy my ZFS
filesystem to a spare hard drive and taken  the SSD's out of service
until I can resolve the boot problem.

The system is running on the spare drive as a temporary measure so I
know there was no problem with the filesystem but what did I do wrong
with the boot partitions and how can I rectify the problem?

Mike Clarke

More information about the freebsd-questions mailing list