Ramblings of an aging IT geek
← Ramblings of an aging IT geek
homelab

truenas and the great disk shuffle

Migrating a FreeNAS pool onto larger disks by replacing one drive at a time and letting the resilver do the work.

A server rack with cabling

The box was full. Not "getting full", full: 94% on a pool that already wheezes above 80%. So this week was the great disk shuffle, swapping four 4TB drives for 8TB ones without taking the array offline and without losing anything.

The trick with a ZFS mirror or raidz is that you do it one disk at a time. Pull a drive, put the bigger one in, tell the pool to replace it, and wait for the resilver. Then repeat. Once every member of the vdev is the larger size, ZFS notices the extra space and the pool grows on its own (assuming autoexpand is on, which I had forgotten to set, so the first expand did precisely nothing until I did).

zpool set autoexpand=on tank
zpool replace tank gptid/old gptid/new

The slow part is the resilver. Four drives, the better part of a day each, mostly overnight so it didn't fight with anything that mattered. I kept an eye on zpool status and otherwise left it well alone. The temptation to "help" by running a scrub at the same time is a trap; let it finish.

No drama, which is exactly what you want from storage. The pool went from 14TB usable to 28TB, the alerts went quiet, and I have bought myself another two years of not thinking about it. Past me will be smug. Future me will be full again.