Home > Storage > PowerStore > Virtualization and Cloud > Dell PowerStore: Microsoft Hyper-V Best Practices > TRIM/UNMAP and disk space recovery
When a file is deleted on a Windows Server, the file pointer is deleted, and Windows shows the recovered space as free capacity. However, the old data remains on the disk. Over time, the operating system overwrites the old data with new data.
The host also passes a TRIM/UNMAP command to external storage when files are deleted. If the external storage supports TRIM/UNMAP, the space is also reclaimed on the external storage, and the recovered space is shown as free space on the external storage.
Recovery of deleted disk space on PowerStore using TRIM/UNMAP is a key benefit of thinly provisioned volumes.
PowerStore supports TRIM/UNMAP with Windows Server and Hyper-V given the following conditions:
Disabling TRIM/UNMAP in Windows is not recommended. It might be necessary to temporarily disable TRIM/UNMAP under these conditions:
When TRIM/UNMAP is enabled, internal testing demonstrates that format time for a 500 GB NTFS or ReFS volume on PowerStoreOS 3.x 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 about eight minutes.
With TRIM/UNMAP temporarily disabled, format wait times for large NTFS or ReFS volumes are typically less than five seconds.
To avoid long format wait times when formatting large volumes, temporarily disable TRIM/UNMAP in Windows using 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 using 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 using PowerShell, follow these steps:
Note: on Windows Server 2012, changing the state of DisableDeleteNotification 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
A reboot is not required to apply these changes.
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 are running Windows Server 2008 in your environment.
Note: Windows Server 2008/R2 is not supported with PowerStore.