In order to overcome issues of space reclamation with SCSI LUNs, most modern OSs can utilize SCSI UNMAP. If you notice that space freed up on your OS does not appear to be freed up on the underlaying VPSA Block Volume, you may need to manually run an SCSI UNMAP operation.
Note: some file systems like ReFS lack this capability, making it essential to manage large delete operations carefully or to utilize third-party tooling.
Windows ServerIn recent Windows Server versions, the
Optimize-VolumePowerShell cmdlet provides the option to manually trigger SCSI UNMAP and TRIM hints for all unused sectors of a volume.
For example, this can be run on C with:
> Optimize-Volume C -Defrag -Verbose
For additional guidance, please refer to Microsoft's documentation here: Microsoft Storage Space Reclamation.
While the process may differ depending on your distribution and configuration,
sg_unmap provides the underlying SCSI UNMAP functionality and systems that include support for
sg_unmap can use
fstrim to send the requisite UNMAP hints for all unused blocks.
For example, running the following command would send SCSI UNMAP hints for all unused blocks on all mounted SCSI volumes:
# fstrim --all
Please refer to the official documentation for your OS for guidance on these commands.