-
Notifications
You must be signed in to change notification settings - Fork 815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WSL2 distro rapidly expands to fill drive without using space and cannot be shrunk #8226
Comments
Hi @sjshamsi. Do you have free space on the linux filesystem ? What's the output of |
Hi @OneBlue, thansk for the comment. So in this meantime I reimaged my machine but it does exhibit the same problem. Currently Windows displays 33.1GB free of 186GB C drive, and On WSL,
I am quite new to Linux filesystems but I was concerned with |
Interesting. Does running |
Oh wow that totally worked! Running
I wonder if there anything in particular that might have caused this. At any rate, thanks so much for your help! |
Happy to hear that, closing. |
Those methods are not very effective as both are designed to optimize NTFS partitions and their performance in ext4 filesystems is far from good. In some cases, they can even increase the size. You can try wslcompact utility. It leaves images about 2-3% larger than the used space reported by |
In case you're using Win 10 Home, you may not have Opimize-Vhd available. Alternative way of compacting the virtual drive is described here: |
Unfortunately I am having this issue and the If I run
First of all, I don't really understand how 321/336 = 100%, but that's not really important. What's important is that I literally have almost nothing in here and it makes no sense that it's taking up 300+ GB of space. The contents of my /home directory (where I save everything) is only 17GB. I just cannot figure out what is going on here. I don't have |
@ryanjlind I had this same issue in WSL2 Ubuntu, and all defragmentation, For me, it ended up being a docker issue; I finally narrowed my Hope this helps. Cheers! |
Holy cow dude. That did it. That was the problem. Docker. Thank you soooo much! It took like 15 minutes to clear all the junk out of Docker, and freed up 200GB. Man! Thanks again. Really appreciate it. |
I had the same issue PS: Commenting, so others can find it easier with search👍🏻 |
If wsl --shutdown
diskpart
# open window Diskpart
select vdisk file="C:\...\ext4.vhdx"
attach vdisk readonly
compact vdisk
detach vdisk
exit |
Version
Microsoft Windows [Version 10.0.22000.593]
WSL Version
Kernel Version
5.10.16
Distro Version
Ubuntu 20.04
Other Software
No response
Repro Steps
I am running a Python script calculating some values which are then put in a dictionary and pickled on the disk.
python script_saving_dictionaries
.
.
.
input/output error
Expected Behavior
Expected disk usage by WSL distro to increase by the amount occupied by my saved files (7MB at point of failure)
Actual Behavior
I got to saving ~400 dictionaries with a total size of 7MB, which was what I expected.
However soon I encounter an input/output error due to low disk space. The Ubuntu
ext4.vhdx
seems to occupy 103GB now from the original ~40GB. This occupies all my disk space and my task fails.I tried my best to confirm if I was saving some junk somewhere prompting this behaviour but cannot find it. Using
du -hs --exclude mnt/
on path~/../../
(in an effort to see all disk space usage by Ubuntu) returns a size of ~39GB, and I am unable to find what's occupying the rest of the space.I uninstalled and reinstalled Ubuntu to the same result.
Using
optimize-vhd -Path ...\ext4.vhdx -Mode full
or usingdiskpart
does not reclaim the space.Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: