Cannot boot from ZFS (GPT) after 8.1 to 8.2 upgrade

Pratyush Dayal pratyushdayal at
Mon Mar 28 22:59:21 UTC 2011

I had used this <>  guide to setup FreeBSD 8.1 in a ZFS mirrored configuration using GPT. I have the following setup:

% gpart show
=>        63  1250263665  ad4  MBR  (596G)
          63  1250263665    1  freebsd  [active]  (596G)

=>         0  1250263665  ad4s1  BSD  (596G)
           0     2097152      1  freebsd-ufs  (1.0G)
     2097152     8388608      2  freebsd-swap  (4.0G)
    10485760    10377216      4  freebsd-ufs  (4.9G)
    20862976     1048576      5  freebsd-ufs  (512M)
    21911552  1228352113      6  freebsd-ufs  (586G)

=>        34  1953525101  ad5  GPT  (932G)
          34         128    1  freebsd-boot  (64K)
         162     4194304    2  freebsd-swap  (2.0G)
     4194466  1949330669    3  freebsd-zfs  (930G)

=>        34  1953525101  ad6  GPT  (932G)
          34         128    1  freebsd-boot  (64K)
         162     4194304    2  freebsd-swap  (2.0G)
     4194466  1949330669    3  freebsd-zfs  (930G)

After the release of FreeBSD-8.2, I upgraded the system using the procedure described in the handbook (with some changed options for ZFS). Here are the steps that I used:

# cd /usr/src
# make buildworld
# make buildkernel
# make installkernel
# shutdown -r now

Then booted the system in single-user mode and did the following:

# adjkerntz -i
# zfs mount -a <-----(Changed from: mount -a -t ufs)
# mergemaster -p
# cd /usr/src
# make installworld
# mergemaster

However, 'mergemaster' (after installworld) complained that it cannot install the files as the file system is read-only. Therefore, I did the following:

# zfs set readonly=off zroot

The 'mergemaster' finished successfully after this and all the required files were installed. Now, when I reboot the system, it cannot load the kernel. I get the following messages and subsequently loader prompt.

'definitions not found'
'forth not found'
'can't load kernel'

My /boot/loader.conf has following lines pertaining to zfs:


I managed to import the ZFS pool by booting through MBR disk with UFS partition (ad4...see above) which also has FreeBSD 8.2.

# zpool import -f -R /altroot zroot
# mkdir /mnt/zroot
# mount -t zfs zroot /mnt/zroot
# zfs list

NAME                        USED  AVAIL  REFER  MOUNTPOINT
zroot                      16.1G   897G   819M  legacy
zroot/tmp                  9.03M   897G  9.03M  /altroot/tmp
zroot/usr                  15.1G   897G  8.63G  /altroot/usr
zroot/usr/home              432M   897G   432M  /altroot/usr/home
zroot/usr/ports            5.76G   897G  73.1M  /altroot/usr/ports
zroot/usr/ports/distfiles  5.69G   897G  5.69G  /altroot/usr/ports/distfiles
zroot/usr/ports/packages     20K   897G    20K  /altroot/usr/ports/packages
zroot/usr/src               309M   897G   309M  /altroot/usr/src
zroot/var                   208M   897G   588K  /altroot/var
zroot/var/crash            21.5K   897G  21.5K  /altroot/var/crash
zroot/var/db                202M   897G   161M  /altroot/var/db
zroot/var/db/pkg           41.7M   897G  41.7M  /altroot/var/db/pkg
zroot/var/empty              20K   897G    20K  /altroot/var/empty
zroot/var/log               842K   897G   842K  /altroot/var/log
zroot/var/mail             70.5K   897G  70.5K  /altroot/var/mail
zroot/var/run                97K   897G    97K  /altroot/var/run
zroot/var/tmp              4.11M   897G  4.11M  /altroot/var/tmp

Please help me troubleshooting the problem. I have posted this problem on FreeBSD forums...please see this thread <>...where it has been suggested that the required bits of /boot/loader or /boot/zfsloader are missing. I do not know how to proceed further!


More information about the freebsd-questions mailing list