5 ms·
I recently used https://github.com/okibcn/wslcompact https://github.com/okibcn/wslcompact to shrink a couple of WSL VHDX files, and it worked great. Looking at
by acemarke 1y ago
I recently used https://github.com/okibcn/wslcompact https://github.com/okibcn/wslcompact to shrink a couple of WSL VHDX files, and it worked great.
Looking at the source, it seems to use a `wsl --export` option rather than `diskpart`.
- twilight-code 1y agoExporting and re-importing the WSL distro is simpler and usually preferred. The tutorial and script are based on this conversation: https://superuser.com/questions/1606213/how-do-i-get-back-unused-disk-space-from-ubuntu-on-wsl2#1612289 https://superuser.com/questions/1606213/how-do-i-get-back-un... which mentions some issues with the re-import that includes the need to reset the default username.