zpool Upgrade
List all block devices:
% lsblk
DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT
ada0 0:128 112G GPT - -
<FREE> -:- 3.0K - - -
ada0p1 0:130 512K freebsd-boot gpt/gptboot0 -
<FREE> -:- 492K - - -
ada0p2 0:132 4.0G freebsd-swap gpt/swap0 SWAP
ada0p3 0:134 108G freebsd-zfs gpt/zfs0 <ZFS>
<FREE> -:- 456K - - -
ada1 0:137 2.7T GPT - -
<FREE> -:- 3.0K - - -
ada1p1 0:154 2.7T freebsd-zfs gpt/diska <ZFS>
<FREE> -:- 3.5K - - -
ada2 0:139 1.8T GPT - -
<FREE> -:- 3.0K - - -
ada2p1 0:157 1.8T freebsd-zfs gpt/diskb <ZFS>
<FREE> -:- 3.5K - - -
ada3 0:141 2.7T GPT - -
<FREE> -:- 3.0K - - -
ada3p1 0:160 2.7T freebsd-zfs gpt/diskc <ZFS>
<FREE> -:- 3.5K - - -
ada4 0:143 2.7T GPT - -
ada4p1 0:163 2.7T freebsd-zfs gpt/disce <ZFS>
<FREE> -:- 4.0K - - -
ada5 0:145 7.3T GPT - -
<FREE> -:- 3.0K - - -
ada5p1 2:50 7.3T freebsd-zfs gpt/backup06 <ZFS>
<FREE> -:- 3.5K - - -
Insert new disk, create a gpt partition table and a new partiton (remember to replace ada4
and diskx
with the appropriate disk name; I have inconsistently named older disks sometimes disc or disk).
# gpart create -s gpt ada4
# gpart add -a 4k -t freebsd-zfs -l diskx ada4
Then replace the disk. (The longer number will show up in zpool status
# zpool replace -f storage 10024461117764645891 gpt/diskx
If the minium disk size of the pool is larger than before, expand the pool by onlining every single disk:
cg@brutus% sudo zpool online -e storage gpt/diska
cg@brutus% sudo zpool online -e storage gpt/diskb
cg@brutus% sudo zpool online -e storage gpt/diskc
cg@brutus% sudo zpool online -e storage gpt/diskd
Last upgrade
2022-02-17
Before:
cg@brutus% zfs list storage
NAME USED AVAIL REFER MOUNTPOINT
storage 4.76T 355G 151K /storage
after:
cg@brutus% zfs list storage
NAME USED AVAIL REFER MOUNTPOINT
storage 4.76T 2.90T 151K /storage