SSD Optimize not working inside Windows 2022 server

Humay

Renowned Member
Feb 19, 2017
17
5
68
50
After execution
Optimize-Volume -DriveLetter S - Retrim -Verbose
error:
Neither slab consolidation nor slab analysis can run if slabs less than 8 MB

in eventvwr:
Slab size too small 0x89000002D


Disk Optimizer shows "Thin Provisioned disk" and status OK, Optimize not clickable (does nothing)
physical underlying storage on ssd is LVM-Thin nvmedata scsi1
rpool is ZFS pool is scsi0 and scsi2 with cache and zil and its working optimize ok

1780266101397.png

1780265806214.png
 
Last edited:
Since the slab size is 4 KB, Windows appears to stop defragmenting the slabs.

It does indeed seem to be 4 KB.

Code:
Optimize-Volume -DriveLetter C -SlabConsolidate -WhatIf -Verbose

I think it’s always been that way…

As far as I recall, if the size is 8 MB or less, the storage device manages space efficiently, so slab consolidation doesn’t seem to occur at all.

Slab consolidation will fail, but I believe the TRIM operation itself will succeed when TRIM is re-executed afterward.

edit

https://support.microsoft.com/en-us...ned-luns-b6f87710-272e-430a-f194-9a74a697133f

Code:
There's no need to run Storage Optimizer on thin provisioned LUNs that use an allocation size (also known as slab size) of less than 8 MB. Thin provisioned LUNs that have a smaller slab size manage space more efficiently, and the benefits of defragmenting them are not as great.
 
Last edited:
Yes. A detailed explanation is on the alldiscoveries.com site linked in that thread, which suggests 2M since it's the Hyper-V default, though that post you quoted suggests the 8M. YMMV I guess. 2M solved the issue for us.