Closed luckyho closed 3 months ago
The win system already supports the trim function, but I'm not sure if it works with rbd-wnbd?
DisableDeleteNotify = 0
means that Windows is configured to use TRIM, if supported by the disk.
WNBD offers partial TRIM support. One easy way of checking is by using sg3_utils. Note that the most recent sg3_utils
releases seem to be broken on Windows, but 1.44 works fine.
PS E:\tools\sg3_utils_144\sg3ut_mgw64\bin> .\sg_vpd.exe --page=0xb2 \\.\physicaldrive3
Logical block provisioning VPD page (SBC):
Unmap command supported (LBPU): 1
Write same (16) with unmap bit supported (LBPWS): 0
Write same (10) with unmap bit supported (LBPWS10): 0
Logical block provisioning read zeros (LBPRZ): 0
Anchored LBAs supported (ANC_SUP): 0
Threshold exponent: 0 [threshold sets not supported]
Descriptor present (DP): 0
Minimum percentage: 0 [not reported]
Provisioning type: 2 (thin provisioned)
Threshold percentage: 0 [percentages not supported]
You can even check individual SCSI requests by increasing the WNBD log level:
rbd-wnbd map -f test_1g --wnbd-log-level=10
2024-06-26T09:34:16.139+0000 25 0 libwnbd.dll!WnbdHandleRequest DEBUG Dispatching UNMAP # b0.
2024-06-26T09:34:16.139+0000 1d 0 libwnbd.dll!WnbdSendResponseEx DEBUG Sending response: [UNMAP] : (SS:0, SK:0, ASC:0, I:0) # b0 @ 0000000000000000~0x0.
Windows will use UNMAP/TRIM when quick formatting or when using the following command to unmap deleted blocks.
Optimize-Volume -DriveLetter f -ReTrim
For what is worth, wnbd-client
also reports if UNMAP
support is enabled.
wnbd-client show rbd/test_1g
Connection info
InstanceName : rbd/test_1g
SerialNumber : rbd/test_1g
Owner : ceph-rbd-wnbd
ReadOnly : 0
FlushSupported : 0
FUASupported : 0
UnmapSupported : 1
UnmapAnchorSupported : 0
UseUserspaceNbd : 0
BlockCount : 2097152
BlockSize : 512
MaxUnmapDescCount : 1
Pid : 2068
DiskNumber : 3
PNPDeviceID : SCSI\Disk&Ven_WNBD&Prod_WNBD_DISK\1&2afd7d61&60&000000
BusNumber : 0
TargetId : 0
Lun : 0
MaxIOReqPerLun : 255
MaxIOReqPerAdapter : 1000
Thanks for the help, recently, we found out in our tests that rbd-wnbd seems to support trim
Does rbd-wnbd device support fstrim? How to check it in the win client?