okibcn/wslcompact

wslcompact doesn't release space, despite available space

Closed this issue · 1 comments

While WSL has a lot of available free space, wslcompact doesn't identify it for removal (see below). Changing the temp file as suggested didn't help either. For what's it worth I tried to also compact it with diskpart, but while it said it compacted the disk nothing happened. So perhaps the issue is related to diskpart rather than wslcompact.
image

okibcn commented

According to wslcompact, you only have 5.4GB free in your C drive, not enough for generating the compacted vhdx image that would be ~110GB in size.

You can check the available free space in your C drive by typing in powershell:

Get-PSDrive C

Other than that, it seems that your vhdx image is already compacted. it has 106GB of data according to df, so 110GB seems the minimum you can achieve. There is about 2-5% of additional space required for additional metadata in the ext4 filesystem and vhdx image.

I am afraid that according to all this, wslcompact is working as expected.