Home > Storage > PowerStore > Virtualization and Cloud > Dell PowerStore: Microsoft Hyper-V Best Practices > TRIM/UNMAP and disk space recovery
When you delete a file on a Windows Server, the server deletes the file pointer, and Windows shows the recovered space as free capacity. However, the old data remains on the disk. Over time, the server operating system overwrites the old data with new data.
When deleting files, the host server also passes a TRIM/UNMAP command to the external storage appliance. If the external storage supports TRIM/UNMAP, the external storage will reclaim the space in the storage pool.
Recovery of deleted disk space on PowerStore with TRIM/UNMAP is a key benefit of thinly provisioned volumes.
PowerStore supports TRIM/UNMAP with Windows Server and Hyper-V given the following conditions:
By default, TRIM/UNMAP is enabled. Do not disable TRIM/UNMAP, unless it is necessary. It might be necessary to temporarily disable TRIM/UNMAP under these conditions:
When TRIM/UNMAP is enabled, internal tests demonstrate that the format time for a 500 GB NTFS or ReFS volume on PowerStoreOS is less than one minute. Format time for a 1 TB volume is less than two minutes. Format time for a 5 TB volume is less than seven minutes.
With TRIM/UNMAP temporarily disabled, formatting a large NTFS or ReFS volume completes in a few seconds.
To avoid a long wait when formatting a large volume, temporarily disable TRIM/UNMAP in Windows with the Registry Editor, fsutil, or PowerShell. For more information, see the next two sections, Manage TRIM/UNMAP with fsutil and Manage TRIM/UNMAP with PowerShell.
To temporarily disable TRIM/UNMAP with fsutil, follow these steps:
fsutil behavior query DisableDeleteNotify
If DisableDeleteNotify = 0, TRIM/UNMAP is enabled. This attribute is configurable for NTFS and ReFS volumes.
Note: For Windows Server 2012, DisableDeleteNotify does not differentiate between NTFS and ReFS; the attribute setting applies to both format types.
fsutil behavior set disabledeletenotify NTFS 1
fsutil behavior set disabledeletenotify REFS 1
Windows Server 2012 and later supports the use of PowerShell to manage TRIM/UNMAP. To temporarily disable TRIM/UNMAP with PowerShell, follow these steps:
Note: on Windows Server 2012, the DisableDeleteNotification attribute applies to NTFS and ReFS volumes.
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem\" -Name DisableDeleteNotification
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem\" -Name RefsDisableDeleteNotification
A result of 0 means TRIM/UNMAP is enabled.
DisableDeleteNotification : 0
RefsDisableDeleteNotification : 0
Changes do not require a reboot.
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem\" -Name DisableDeleteNotification -Value 1
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem\" -Name RefsDisableDeleteNotification -Value 1
Microsoft provides a Sysinternals command-line tool named sDelete to recover disk space on Windows Server 2008/R2. See the Microsoft Sysinternals documentation library for more information about sDelete if you have Windows Server 2008 in your environment.
Note: PowerStore does not support Windows Server 2008/R2.