zpool upgrade calls for gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot

NOTE: when upgrading a zpool, it may be necessary to also upgrade the bootcode for that disk (or disks). Be aware of this before proceeding. I know I have missed this step more at least once.

Earlier today I was adding a new pool to the system. After creating the pool, the status showed this:

# zpool status
  pool: ssd
 state: ONLINE
  scan: none requested
config:

	NAME          STATE     READ WRITE CKSUM
	ssd           ONLINE       0     0     0
	  mirror-0    ONLINE       0     0     0
	    gpt/ssd0  ONLINE       0     0     0
	    gpt/ssd1  ONLINE       0     0     0

errors: No known data errors

  pool: system
 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 in progress since Thu Dec 25 04:16:06 2014
        3.33T scanned out of 5.14T at 86.8M/s, 6h4m to go
        0 repaired, 64.84% done
config:

	NAME           STATE     READ WRITE CKSUM
	system         ONLINE       0     0     0
	  raidz2-0     ONLINE       0     0     0
	    gpt/disk0  ONLINE       0     0     0
	    gpt/disk1  ONLINE       0     0     0
	    gpt/disk2  ONLINE       0     0     0
	    gpt/disk3  ONLINE       0     0     0
	    gpt/disk4  ONLINE       0     0     0
	    gpt/disk5  ONLINE       0     0     0

errors: No known data errors

Let’s upgrade that pool now

Upgrading the pool

Upgrading the pool is easy:

# zpool upgrade system
This system supports ZFS pool feature flags.

Enabled the following features on 'system':
  multi_vdev_crash_dump
  spacemap_histogram
  enabled_txg
  hole_birth
  extensible_dataset
  bookmarks
  filesystem_limits

If you boot from pool 'system', 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

Oh…

Now what?

I wasn’t sure what to apply the boot code to: the disk, all disks, the device?

Applying the bootcode

I have 6 devices in this zpool. I am applying the boot code to each of them.

# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada2
bootcode written to ada2
# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada3
bootcode written to ada3
# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada4
bootcode written to ada4
# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada5
bootcode written to ada5
# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada6
bootcode written to ada6
# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada7
bootcode written to ada7

Now let’s check that status, just one more time:

# zpool status
  pool: ssd
 state: ONLINE
  scan: none requested
config:

	NAME          STATE     READ WRITE CKSUM
	ssd           ONLINE       0     0     0
	  mirror-0    ONLINE       0     0     0
	    gpt/ssd0  ONLINE       0     0     0
	    gpt/ssd1  ONLINE       0     0     0

errors: No known data errors

  pool: system
 state: ONLINE
  scan: scrub in progress since Thu Dec 25 04:16:06 2014
        3.34T scanned out of 5.14T at 85.5M/s, 6h8m to go
        0 repaired, 64.89% done
config:

	NAME           STATE     READ WRITE CKSUM
	system         ONLINE       0     0     0
	  raidz2-0     ONLINE       0     0     0
	    gpt/disk0  ONLINE       0     0     0
	    gpt/disk1  ONLINE       0     0     0
	    gpt/disk2  ONLINE       0     0     0
	    gpt/disk3  ONLINE       0     0     0
	    gpt/disk4  ONLINE       0     0     0
	    gpt/disk5  ONLINE       0     0     0

errors: No known data errors

All good.

Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

3 thoughts on “zpool upgrade calls for gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot”

  1. Is your boot pool “system” or “ssd”? It seems you would want to update the boot codes on the boot pool, not your data pool. The section in the FreeBSD Handbook on upgrading pools has a warning to update the boot code, but does not say how to do it and defers to the gpart man page, which also does not say how to do it. This post confuses me a bit on which pool’s disk you needed to update.

Leave a Comment

Scroll to Top