WSL: WSL2 drive too full, wont start.
Windows Build Number
10.0.21387.1
WSL Version
- WSL 2
- WSL 1
Kernel Version
5.10.16
Distro Version
Ubuntu 20.04
Other Software
No response
Repro Steps
- fill up the WSL system image with whatever data. I used a python script to save matrix data, which ended up exceeding the available space on the drive.
- when its full, the saving process will crash
I have WSL installed on a 120 GB SSD if thats relevant. Theres nothing other than ubuntu 20.04 on the drive.
Expected Behavior
I want to be able to start WSL again and recover my work
Actual Behavior
After the saving process which exceeds drive capacity crashes, all subsequent commands give an input/output error. I tried even simple commands like ls but they werent working. I was still able to browse the mounted drive in explorer.exe but was not able to delete the file I had saved that way.
After doing wsl.exe --shutdown, WSL no longer starts. It gives the message: An error occurred mountiong one of your file systems. Please run 'dmesg' for details. and then exits with code 1. I cant run dmesg because the command prompt doesnt come up at any point. Trying wsl.exe -e dmesg in cmd hangs for a long time then times out because response was not received.
I also cannot browse the drive in explorer.exe either, as the drive is no longer mounted.
Diagnostic Logs
No response
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 22 (1 by maintainers)
@OneBlue , I worked around it for now by emptying the drive a little. I will save the logs when it happens again. I can inform you that this happens only when there is no more diskspace left and wsl can’t expand anymore. The work around here is to empty any files in the same drive or try to open the \wsl$ (may require few restarts/tries to open) and delete large files.
@therealkenc Thanks for those, but I havent been able to get them to work. I converted the ext4.vhdx to a .raw image using
qemu-imgas per suggestion, but I have not been able to mount it. When attached to a loop device, no partitions are recognized.There was another suggestion to initialize a new WSL and replace the fresh ext4.vhdx with my old one, but I have not been able to replace the ext4 as it is in use by System… I’ve tried
wsl --shutdown,wsl -t Ubuntu-20.04, multiple system restarts, but the ext4.vhdx is always mounted as a network drive on startup.