I have a HP microserver gen8 running FreeBSD with mirrored boot media: one USB stick (16GB) and one microSD card (16GB). The stick recently showed checksum errors, so I replaced it, but I only had a 32GB stick at hand. After resilvering, zpool seems to be content but I cannot write the bootcode and gpart does not even recognize the media.
In detail.
This is the zpool status when the problem arose:
Checking status of zfs pools:
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
freenas-boot 14.5G 791M 13.7G - - 5% 1.00x ONLINE -
freising 928G 84.6G 843G - 6% 9% 1.00x ONLINE /mnt
pool: freenas-boot
state: ONLINE
status: One or more devices has experienced an unrecoverable error. An
attempt was made to correct the error. Applications are unaffected.
action: Determine if the device needs to be replaced, and clear the errors
using 'zpool clear' or replace the device with 'zpool replace'.
see: http://illumos.org/msg/ZFS-8000-9P
scan: scrub repaired 213K in 0h15m with 0 errors on Thu Mar 23 04:00:56 2017
config:
NAME STATE READ WRITE CKSUM
freenas-boot ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
da0p2 ONLINE 0 0 3
da1p2 ONLINE 0 0 0
errors: No known data errors
I powered the machine down, replaced the stick with a 32GB one, rebooted. zpool status yielded:
NAME STATE READ WRITE CKSUM
freenas-boot DEGRADED 0 0 0
mirror-0 DEGRADED 0 0 0
3278622582862864884 UNAVAIL 0 0 0 was /dev/da0p2
da1p2 ONLINE 0 0 0
Fine, so I told zpool to use the new media:
sudo zpool replace freenas-boot 3278622582862864884 /dev/da0
(zpool didn't let me use '/dev/da0p2')
It took about 8 hours to resilver the thing, now zpool seems to be happy:
sudo zpool status -xv
all pools are healthy
But I cannot write the bootcode:
sudo gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0
gpart: No such geom: da0.
gpart does not even recognize the new stick:
sudo gpart status
Name Status Components
ada0p1 OK ada0
ada0p2 OK ada0
ada1p1 OK ada1
ada1p2 OK ada1
da1p1 OK da1
da1p2 OK da1
What would be the best way to proceed? I am quite uncertain what I should control via gpart and what is better left to zfs and its magic.