How to overprovision an SSD for holding a smaller ZFS volume (ZVOL)?

I have a pair of 480 GB "Datacenter" SSDs (SAMSUNG MZ7LM480HMHQ-00005) that will make up a ZFS pool in a mirroring configuration. The pool's only content will be a ZFS volume (ZVOL) for a virtual machine. However, the ZVOL will only be 400 GB in size, leaving 80 GB of unused space on each SSD.

I'd like the SSDs to make the best use of their unused space, allowing them to use it for reducing the wearing of the flash memory. What would be the best way to achieve this?

  1. Simply use the whole SSDs for the pool?

  2. Create a 400 GB partition on each SSD and use these for the pool, leaving 80 GB unpartitioned?

  3. Try to change the SSDs' Host Protected Area (HPA) so that only 400 GB of capacity will be visible and then use the "shrunk" SSDs for the pool (as in option #1)?

Or maybe there is no difference at all, and the SSD will automatically make good use of all of its flash cells?

If it matters: I'm assuming that the virtual machine will issue TRIM commands and that they reach the host's ZFS and finally the SSDs themselves.


Solution 1:

All three approaches will yield acceptable results. Personally, I use 1, have autotrim=on on my pools, and my VMs are backed by zvols and use the paravirtualized SCSI driver which understands trim/discard commands. My reasoning is that I will probably never fill the disks above 80% of capacity, but it is nice to be able to if ever necessary.

Options 2 and 3 will yield similar results, assuming you start with a freshly blanked (secure-erased or blkdiscard-ed SSD).

If you use autotrim=on and you never fill up the SSDs above 80% of capacity, there won't be any significant difference between the 3 approaches mentioned.

Solution 2:

Drives are consumable.

I suggest just using them as intended.
RAID them. Monitor their health closely.

Or maybe there is no difference at all, and the SSD will automatically make good use of all of its flash cells?

These datacenter SSDs are already over-provisioned; likely 512GB for the 480GB capacity you've listed. The hardware already accounts for the wear-leveling.