Skip to content

Instantly share code, notes, and snippets.

@e88y
e88y / WSL2 - Reclaim disk space and move distributions.md
Last active November 29, 2023 21:13
WSL2 - Reclaim disk space and move distributions

WSL2 – Reclaim Disk Space

You may notice that your system drive runs out of space when using WSL-Distibutions. So you might ask how to move these stuff to another hard drive or get some space back from your precious drive. Warning: Some commands here might be destructive - I take no responsibilities for any lost data. Read, understand and then decide to follow instructions or not.

How to get space back from WSL virtual disks

https://superuser.com/questions/1606213/how-do-i-get-back-unused-disk-space-from-ubuntu-on-wsl2

The Problem: WSL will dynamically grow the virtual disk (ext4.vhdx) but never shrink it to reclaim unused space. (See also