gsuberland,
@gsuberland@chaos.social avatar

if you're using Hyper-V & WSL2 your distro state virtual disk image might be wasting 100GB+ of storage space. by default the VHDX grows dynamically but does not shrink if stuff is deleted.

to fix, launch powershell as admin, then:

wsl --shutdown

cd %LOCALAPPDATA%\Packages\CanonicalGroupLimited.UbuntuOnWindows_....\LocalState

optimize-vhd -Path .\ext4.vhdx -Mode full

afterward, you can also update wsl to the pre-release version and enable sparse disks:

wsl --manage Ubuntu --set-sparse true

  • @jpm@aus.social avatar
    jpm
  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • cisconetworking
  • DreamBathrooms
  • mdbf
  • Durango
  • ngwrru68w68
  • magazineikmin
  • thenastyranch
  • InstantRegret
  • Youngstown
  • slotface
  • everett
  • kavyap
  • modclub
  • ethstaker
  • megavids
  • tacticalgear
  • GTA5RPClips
  • osvaldo12
  • khanakhh
  • rosin
  • Leos
  • normalnudes
  • anitta
  • cubers
  • tester
  • provamag3
  • JUstTest
  • lostlight
  • All magazines