TRIM and Storage Spaces


It is known that filesystems that you will probably use on Storage Spaces, namely NTFS and ReFS, support TRIM. We have no information about FAT but it is unlikely that someone will use FAT in conjunction with Storage Spaces.
So, if you delete a file on a volume located on a virtual Storage Spaces disk, the filesystem driver sends a TRIM command to the Storage Spaces driver. The latter uses the same mechanism as TRIM uses in order to free slabs, i.e. to return slabs that are marked as unused by the filesystem to the pool of free slabs. Returning slabs to the pool of free slabs will take place if:
  • a file being deleted fully occupies one or several slabs;
  • a file being deleted is a single file in the slab meaning that after its deletion this slab would contain no data at all.
Once a slab is withdrawn back to the pool of free slabs, it is impossible to easily identify the slab - what volume it belonged to, what location it had in the volume. Therefore, regular data recovery from the filesystem side will not work because of some slabs just are absent. In this case you need to do a full-size Storage Spaces recovery aiming to match virtual and physical slabs.

Note that all the above applies to the virtual disks which use thin provisioning, rather than to the fixed ones. When creating a fixed virtual disk, the Storage Spaces driver assigns physical slabs to the virtual disk and then never takes them away.

Comments

Popular posts from this blog

QNAP revisited

APFS Data Recovery