Skip to content

Instantly share code, notes, and snippets.

@harmandeep-singh
Created August 25, 2022 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harmandeep-singh/0e180e445d9cb9e42ae2219116d9abb5 to your computer and use it in GitHub Desktop.
Save harmandeep-singh/0e180e445d9cb9e42ae2219116d9abb5 to your computer and use it in GitHub Desktop.
WSL 2 disk space Cleanup
// Run powershell as admin
Go inside "wsl2" cmd
install ncdu : sudo apt-get install ncdu
run : sudo ncdu --exclude mnt //--exclude mnt Ignore windows drive like - c: d: etc...
wsl --shudown
Optimize-VHD -Path %userprofile%\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\ext4.vhdx -Mode Full
Optimize-VHD -Path %userprofile%\AppData\Local\Docker\wsl\data\ext4.vhdx -Mode Full
// Use Windirstat like program to find .vhdx file , generally those are large in size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment