Wednesday 19 Mar 2025
ZFS Pool Storage Upgrade
It's ZFS storage upgrade time! I am currently running two 4 TB hard drives, and one 2 TB hard drive in a RAIDZ1, which means my usable space is 5.45T. My pool has reached 86% capacity. You should not let ZFS get over 80% full due to performance downgrades. Let's upgrade.
I acquired another 4 TB enterprise hard drive from eBay for £50; this drive will replace the 2 TB hard drive. I used to have both WD and Seagate drives, but noticed I can get Toshiba enterprise drives at a good price second hand. I have four Toshiba drives (prior to getting this new one), with two in my back up server, one in my NAS and the one as an off-site backup.
Things to note:
- Always use the replace command to maintain redundancy should a drive fail during a resilver
- Think about the command before entering it
- Check you have the "autoexpand" option on in your pool, so that ZFS will reclaim space
I inserted the new drive into a space slot, booted the backup server. Here's the state before the upgrade:
=
zpool status
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT rpool 5.45T 4.71T 760G 889M - 0% 86% 1.00x ONLINE -
Resilver in progress
pool: rpool state: ONLINE status: One or more devices is currently being resilvered. The pool will continue to function, possibly in a degraded state. action: Wait for the resilver to complete. scan: resilver in progress since Wed Mar 19 07:56:32 2025 2.29T scanned at 2.96G/s, 206G issued at 266M/s, 4.71T total 68.5G resilvered, 4.27% done, 04:55:45 to go config: NAME STATE READ WRITE CKSUM rpool ONLINE 0 0 0 raidz1-0 ONLINE 0 0 0 ata-TOSHIBA_MG04ACA400E_XXXXXXXXXXXX ONLINE 0 0 0 ata-TOSHIBA_MG04ACA400N_XXXXXXXXXXXX ONLINE 0 0 0 replacing-2 ONLINE 0 0 0 ata-WDC_WD2002FFSX-XXXXXXXXXXXXXXXXXXXXXXX ONLINE 0 0 0 ata-TOSHIBA_MG08ADA400E_XXXXXXXXXXXX ONLINE 0 0 0 (resilvering) errors: No known data errors
Command to resilver
zpool replace rpool ata-WDC_WD2002FFSX-XXXXXXXXXXXXXXXXXXXXXXX /dev/disk/by-id/ata-TOSHIBA_MG08ADA400E_XXXXXXXXXXXX
Following Resilver
Great, everything went well and I have now more capacity.
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT rpool 10.9T 4.71T 6.20T - - 0% 43% 1.00x ONLINE -
pool: rpool state: ONLINE scan: resilvered 1.58T in 03:30:28 with 0 errors on Wed Mar 19 11:27:00 2025 config: NAME STATE READ WRITE CKSUM rpool ONLINE 0 0 0 raidz1-0 ONLINE 0 0 0 ata-TOSHIBA_MG04ACA400E_XXXXXXXXXXXX ONLINE 0 0 0 ata-TOSHIBA_MG04ACA400N_XXXXXXXXXXXX ONLINE 0 0 0 ata-TOSHIBA_MG08ADA400E_XXXXXXXXXXXX ONLINE 0 0 0 errors: No known data errors
Conclusion
It is easy to replace a hard drive in a ZFS pool to increase capacity. I now have 10T to play with, at 43% capacity now. I will write back when a drive fails - let's hope it's not soon.
Backlinks:
index
Journal:Index
Journal:2025:03