Posts

Showing posts from March, 2026

How to reclaim the space in WSL after folder deletion

Image
 Deleting files inside WSL is like throwing trash away inside a house—the house (the .vhdx file) doesn't actually get smaller on the outside until you "move the walls back in." To reclaim that space on your C: drive immediately , follow these steps. In powershell run the below command wsl --shutdown Restart your windows system. Run below command , replace the DistroName with your WSL Distro Name. wsl --manage <DistroName> --set-sparse true How to find the Distro Name: Run the below command in Powershell wsl -l -v Normally ubuntu will be the distro name.

How to know the path of ext4.vhdx in windows

Image
 Finding this file can be a bit of a scavenger hunt because the folder names are often long strings of random characters. The easiest way to find it is to use PowerShell to tell you exactly where it's hiding. Method 1: The "Automatic" Way (PowerShell) Copy and paste this command into a PowerShell window. It will spit out the exact path to your virtual disk: In powershell, run the command  Get-ChildItem -Path "$env:LOCALAPPDATA\Packages" -Filter "ext4.vhdx" -Recurse -ErrorAction SilentlyContinue | Select-Object FullName, @{Name="SizeGB";Expression={$_.Length / 1GB}}

How to see exactly which subfolders are the "space hogs" inside a specific directory in WSL

Image
 If you want to navigate through your folders and delete things on the fly, ncdu is the gold standard for WSL users. It feels like a simplified, terminal version of WizTree. Install it:  sudo apt update && sudo apt install ncdu Run it on your suspect folder: ncdu /path/to/your/folder You can see the space of each folder like this.