Solved zpool upgrade question

Hi,

I have upgraded from FreeBSD 11.1 to 11.2 last night and now I have the following:
zpool status
Code:
  pool: zroot
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
        still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
        the pool may no longer be accessible by software that does not support
        the features. See zpool-features(7) for details.
  scan: scrub repaired 0 in 3h10m with 0 errors on Thu Oct  4 13:44:07 2018
config:

        NAME         STATE     READ WRITE CKSUM
        zroot        ONLINE       0     0     0
          raidz2-0   ONLINE       0     0     0
            mfid0p3  ONLINE       0     0     0
            mfid1p3  ONLINE       0     0     0
            mfid2p3  ONLINE       0     0     0
            mfid3p3  ONLINE       0     0     0
            mfid4p3  ONLINE       0     0     0
            mfid5p3  ONLINE       0     0     0

errors: No known data errors
In order to fix my issue is running the zpool upgrade command all I need to do? Is there anything I need to watch out for?

Thank you
 
That is all you need to do yes. All it does is add some new feature flags to the pool and allows you to use them. I don't know what these features actually are but it's things like new compression algorithms, or encryption etc. generally nothing too major as they won't usually be used unless you specifically do something with them.

The only thing to watch out for is this will prevent you importing the pool onto a system which is running an older version of ZFS. Which means if you boot it from an 11.1 USB stick for example the pool won't be accessible. But as long as you always use 11.2 now this will not be a problem.
 
Basically # zpool upgrade should be all you need, especially with a minor version upgrade.

However... I also prefer to always re-install the boot code just in case ( # gpart bootcode ...), this will make sure that if there have been some changes which could theoretically affect the boot process then you'll be ready for those as well. Not always needed, but I prefer to make sure.
 
My system is BIOS GPT boot using the "Auto ZFS" option from the installer and I would do this with gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0 however if you use UEFI or have a different partition layout this will be different so yes, read the gpart man page first. You can run gpart show to show what currently exists.

If gpart show shows freebsd-boot as 1 then the above is likely correct. If it shows freebsd-efi then you'll have to do something else, and I don't have EFI myself so I'm not entirely sure what.
 
On an UEFI system the freebsd-boot partition is very likely at index 2. This is from my system:

Code:
$ gpart show ada0
=>      40  62533216  ada0  GPT  (30G)
        40    409600     1  efi  (200M)
    409640      1024     2  freebsd-boot  (512K)
    410664       984        - free -  (492K)
    411648   4194304     3  freebsd-swap  (2.0G)
   4605952  57925632     4  freebsd-zfs  (28G)
  62531584      1672        - free -  (836K)
 
On an UEFI system the freebsd-boot partition isn't used. kpa your system looks like it's a UEFI/CSM mix, allowing it to boot using either CSM or UEFI.

For CSM boot the freebsd-boot partition is called. For a ZFS system it should contain gptzfsboot(8). UFS systems should use gptboot(8).
For UEFI boot the efi partition is called. You can dd(1) the contents of /boot/boot1.efifat to it.
 
ok, I ran zpool upgrade zroot and got
Code:
This system supports ZFS pool feature flags.

Enabled the following features on 'zroot':
  device_removal
  obsolete_counts
  zpool_checkpoint

If you boot from pool 'zroot', don't forget to update boot code.
Assuming you use GPT partitioning and da0 is your boot disk
the following command will do it:

        gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0
I am not sure how to update the boot code. I have 6 disk on the system as raidz2.
gpart show return
Code:
=>       40  285474736  mfid0  GPT  (136G)
         40       1024      1  freebsd-boot  (512K)
       1064        984         - free -  (492K)
       2048    4194304      2  freebsd-swap  (2.0G)
    4196352  281276416      3  freebsd-zfs  (134G)
  285472768       2008         - free -  (1.0M)

=>       40  285474736  mfid1  GPT  (136G)
         40       1024      1  freebsd-boot  (512K)
       1064        984         - free -  (492K)
       2048    4194304      2  freebsd-swap  (2.0G)
    4196352  281276416      3  freebsd-zfs  (134G)
  285472768       2008         - free -  (1.0M)

=>       40  285474736  mfid2  GPT  (136G)
         40       1024      1  freebsd-boot  (512K)
       1064        984         - free -  (492K)
       2048    4194304      2  freebsd-swap  (2.0G)
    4196352  281276416      3  freebsd-zfs  (134G)
  285472768       2008         - free -  (1.0M)

=>       40  285474736  mfid3  GPT  (136G)
         40       1024      1  freebsd-boot  (512K)
       1064        984         - free -  (492K)
       2048    4194304      2  freebsd-swap  (2.0G)
    4196352  281276416      3  freebsd-zfs  (134G)
  285472768       2008         - free -  (1.0M)

=>       40  285474736  mfid4  GPT  (136G)
         40       1024      1  freebsd-boot  (512K)
       1064        984         - free -  (492K)
       2048    4194304      2  freebsd-swap  (2.0G)
    4196352  281276416      3  freebsd-zfs  (134G)
  285472768       2008         - free -  (1.0M)

=>       40  285474736  mfid5  GPT  (136G)
         40       1024      1  freebsd-boot  (512K)
       1064        984         - free -  (492K)
       2048    4194304      2  freebsd-swap  (2.0G)
    4196352  281276416      3  freebsd-zfs  (134G)
  285472768       2008         - free -  (1.0M)
Can someone confirm if I need to run the command bellow before rebooting the system
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 mfid0
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 mfid1
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 mfid2
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 mfid3
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 mfid4
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 mfid5

This is my production server and really don't want to break it.

Thank you
 
The gpart commands you posted for all disks are correct for your BIOS GPT system. It updates the protective MBR to the first sector of a disk and the ZFS bootcode to a freebsd-boot partition. Then you'll be able to boot your system from any disk.
 
Back
Top