How Much Disk Space is WSL Using On Windows?

How much disk space is WSL using on Windows?

I found that you can go into Windows' Apps & Features and it will display disk usage for the WSL2 "Ubuntu", but this does not seem to include WSL Legacy or maybe it does since it seems to report more than I expect?


Solution 1:

Determine Disk Usage From Linux

Using a tool like ncdu can make determining disk usage easy with a nice cli interface to it as well.

Install ncdu

sudo apt install ncdu  

Running ncdu

So we do not get all of Windows' directories along for the ride we'll need to exclude the /mnt directory.

ncdu --exclude /mnt

Determining From Windows

Under Windows' Apps & Features it lists Ubuntu as taking up 1.92 GB

ncdu reports 1.7 GiB (~1.82GB) which is pretty close to what Windows reports.

WSL Legacy "Bash on Ubuntu on Linux"

I was not able to find how much room Bash on Ubuntu on Linux was occupying through Windows, but I was able to see how much it was using by running ncdu --exclude /mnt.

Related Research

  • What size does basic Bash/WSL subsystem on Windows occupy?

  • Why is `du` on WSL acting giving a directory size greater than machine memory?

  • https://askubuntu.com/questions/1042285/reduce-size-of-a-wsl-installation-ubuntu-18-on-windows-10

    • https://github.com/RoliSoft/WSL-Distribution-Switcher