Closed FoliageOwO closed 2 months ago
Hi @FoliageOwO, I’m not sure if you still need help, but I recently faced the same issue, so I thought I'd share my solution for anyone else encountering it.
My distro was set to sparse for a while, which caused some complications. I resolved it by running:
wsl --manage <distro> --set-sparse false
After doing this, I was able to use optimize-vhd
without any issues. Once you're done, you can re-enable sparse mode if you like, but I recommend running this process periodically—especially if you notice an unusually large disk usage.
For reference, I’m using the default Ubuntu distro, but this solution should also work for ArchWSL and others.
@lucasacoutinho Thanks, this really does work! :)
Hi. I'm new to playing with a WSL. I've used the
ArchWSL
for a while, but I found my disk almost full when installing stuff.After running
gdu -i /mnt
in theArchWSL
, it told me the WSL only used 18.4 GiB:But the disk file occupies 50+ GiB:
Environment:
Additional context Seemed to have a connection with this issue WSL#8226, for which I did
Optimize-Vhd /path/to/the/ext4.vhdx
on my PowerShell, and it threw me an error:I followed the instructions of the reply on the issue WSL#4103, which did nothing.
Is the space the disk file takes normal, or my settings for ArchWSL is wrong?