The Problem My server, cprox, as I call it, was set up with only 64GB of storage on the root partition. I don’t know what I was thinking at the time, but this caused issues only a week after setting up the new server.
Within this time, the OS, packages, and other things Proxmox does, consumed 86% of the drive. This made things run slowly and caused the command line to freeze sometimes, which was very weird since the OS was on mirrored SSDs - which is exactly what allowed me to do this resizing live.
A few tricks to reduce SSD (NOT NVMe/M.2) wear when running ZFS:
Remember to enable autotrim option on the pool. You should also setup a cron job to run zpool trim tank0 weekly or bi-weekly. Replace tank0 with your tank/dataset name. zpool get autotrim tank0 # check trim zpool set autotrim=on tank0 # enable trim on tank0 zpool trim tank0 # run trim manually Use a large ashift of at least 12 but 13 is better.
I came upon a very powerful and simple script when I was searching for a good way to automate the ZFS snapshots. I have found this to the best one so far in terms of how I can edit the script and tweak it for my use very easily. I know that other scripts and programs exist such as sanoid by Jim Salter, which you can find at his GitHub page here jimsalterjrs/sanoid, but I have found iceflatline’s script to be quite good at what it does which is a basic ZFS snapshot creator.
In this scenario I want to replace a HDD in my ZFS tank0 pool. The pool has grown from 4 TB across 3 HDDS to 8TBs. I have swapped out two of the HDDs in the pool but I’m needing to swap out the last one to finally start using 8TB of storage where right now I’m stuck at 4TB.
Now, I have several things I can do to swap out this hard drive but since I didn’t use the /dev/by-disk or /dev/by-id labels and all of my HDDs in my zpool pull are labeled as /dev/sdx, I don’t know which one it currently is I’m needing to replace.