ZFS Pool upgrade

Written 2023-09-10

Tags:ZFS 5big NAS Debian Lacie 

One of the old 500GB disks in my NAS has begin to throw errors.

Buy SSDs

I picked up 6x used PM863 SSDs from eBay. They came with 90%+ wear leveling remaining, except for one at 85%, which will be my cold spare and backup disk.

Checksum everything

find /media/ -type f -exec md5sum {} \+ >backup.md5sum 2>backup.failure
cat backup.failure #should be empty

zfs-send everything to the cold-spare

First, we need a root pool snapshot. In my case:
zfs snapshot -r tank@backup
Next, we send it to the external SSD that I've mounted at /media/usb, running in screen:
zfs send -vRI tank > /media/usb/backup.zfs

pro-tip: make sure you're plugged into the USB3 not the USB2 ports :p

Hardware swap

Take out the old array, put the new array into adapters and install.

recreate new zpool

sudo zpool create tank raidz

zfs-recv everything from the cold-spare to the pool

cat /media/usb/tank@backup | sudo zfs receive tank -F

verify checksums

md5sum --check backup.md5sum