Unable to boot after fixing root-on-zfs layout

I have a server that is still on 15.0-RELEASE and I was going to update to 15.1-RELEASE following the instructions provided here, starting with creating a backup with bectl. Bectl did not work, which I came to learn had to do with the layout of my root zpool. For some reason after installation the plain "root" dataset was used for the / mountpoint rather than root/ROOT/default, which did not exist.

Anyway, I have managed to fix the layout by creating root/ROOT and root/ROOT/default filesystems and moved all data to root/ROOT/default by using the live CD but I end up with a screen like this after rebooting (the computer is a Dell Vostro 200):

Code:
BIOS drive C: is disk0
BIOS drive D: is disk1
BIOS drive E: is disk2

The system was using GPT but with BIOS and worked so it's laid out like so (I do not have direct access to the system to easily copy and paste it so I am paraphrasing here):

freebsd-swap on ada0p1
freebsd-boot on ada0p2
freebsd-zfs on ada0p3

Also /boot/gptzfsboot, /boot/pmbr, and /boot/zfs/zpool.cache all exist.

zpool get bootfs root shows root/ROOT/default as the location used for bootfs.

Here is how I was attempting to restore boot capabilities:

Code:
# gpart bootcode -b /boot/pmbr ada0
# gpart bootcode -p /boot/gptzfsboot -i 2 ada0

Zpool status reports the disk is healthy and I can chroot into the system fine. I would prefer not to reinstall as 1. It seems perfectly fine if boot can be restored and 2. This teaches me more about FreeBSD. Also I have some programs set up on the root/ROOT/default dataset I would prefer not to lose. Thanks.
 
Where is it stuck if you try to boot? mountroot prompt?

And what's bootfs set to on the pool? Assuming you moved everything correctly to zroot/ROOT/default, bootfs should be pointing at that. Perhaps that's still set to zroot/?
 
Where is it stuck if you try to boot? mountroot prompt?

And what's bootfs set to on the pool? Assuming you moved everything correctly to zroot/ROOT/default, bootfs should be pointing at that. Perhaps that's still set to zroot/?
Its showing what I believe is a BIOS prompt when I try to boot that looks like the following:

Code:
BIOS drive C: is disk0
BIOS drive D: is disk1
BIOS drive E: is disk2

So I dont think its getting very far. The other two drives are another hard drive I have with a separate zpool and the USB with FreeBSD. Bootfs is set to root/ROOT/default. Does the pool have to be named zroot specifically?
 
I believe is a BIOS prompt
No, I believe that's code from the PMBR.

freebsd-swap on ada0p1
freebsd-boot on ada0p2
How big is that swap partition? It shouldn't matter if freebsd-boot is the second partition, but it might be too far out on the disk? Not sure what these limitations are. Any chance you can delete the swap and freebsd-boot partitions and swap them around. putting freebsd-boot first? Make sure it's 512K, don't make it any larger or smaller. Then write the bootcodes again, keep in mind the index will be 1 now.

Does the pool have to be named zroot specifically?
No. As long as the naming is consistent. It can be named anything you want. It's common to be zroot because that's what the installer normally creates by default.
 
How big is that swap partition? It shouldn't matter if freebsd-boot is the second partition, but it might be too far out on the disk? Not sure what these limitations are
The swap partition is 4G, the freebsd-boot is 512K and the zfs partition is 145G.

I can try that but it worked before I attempted to fix the layout and the entire zpool is only using 23.4G of the 145G partition.

EDIT: I have moved freebsd-boot to index 1 (still 512K) and freebsd-swap to index 2 but I end up stuck at the PMBR still.
 
Back
Top