-
Notifications
You must be signed in to change notification settings - Fork 840
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
vhdx files becoming corrupted since 2.0.4.0 pre-release install #10609
Comments
@jtabox - is it possible your distro vhd is full? |
/logs |
No, I don't think so. As I said, this happened with fresh installs of the Ubuntu 22.04 directly from the Store, so I hadn't installed many things. Maybe a miniconda installation at most, the vhdx files were never above 2 Gb. In regard to logs, I have actually not had a similar issue ever since I deactivated |
Thank you @jtabox. Can you try to reproduce the issue under log collection ? We'd need to to see logs from when the disk becomes normal to corrupt to root cause the issue. /logs |
I've also had this issue when enabling
These issues started from the very first Edit: My drive got corrupted again, although this time I had disabled |
This is a clean Win11 install today, fully updated and running 2.0.4 with sparseVhd in my .wslconfig and --set-sparse against Ubuntu I run WslLogs-2023-10-11_22-06-43.zip This is chkdsk straight after:
|
@NGRhodes So you're getting similar errors I assume? With @ASleepyCat Luckily I haven't had any issues with anything else outside the vhdx file getting corrupted. Gotta admit it sounds a bit far-fetched, I'd assume ´sparseVhd´ only affects the vhdx files, though I might be totally wrong here. |
@jtabox - I have tried with Kaspersky and Windows Defender and the drive goes readonly in both cases. |
I had a similar issue Context:
Then I started to got random problems, did a few shutdown/restart of WSL, until I figured out that the file system was locking into read-only after less than minute of use after each "reboot" of the WSL distro. Attempts to fix:
I ended up copying most of my data/config files from the the first to second distro (Ubuntu22.04 as well), re-installed what I needed, and deleted the first one. It was simply broken. I've used the second distro every day for over a week and its working totally fine under WSL 2.0.3. I strongly suspect |
This also causes to make the areas of the C: drive dirty! In my case setting sparse would not only cause read only errors on the distro filesystem everywhere but also causes minor filesystem corruption which I managed however to fix read only file system errors by running |
I experimented with pre-release versions of WSL2 and sparseVhd option too. And I run fstrim in wsl2 too. And it seems that my host Windows 11 23H2 NTFS system is quite corrupted now (and vhd ext4 too, btw), so sfc and dism cannot repair it. |
I enabled sparseVhd a few months ago, for the last month my filesystem in ubuntu started getting corrupted every other programming session, especially when running docker desktop. |
I love WSL as a concept and for the amazing utility it offers for free, and I truly appreciate the work being poured into it. But honestly, I'm staying as far away from Since I opened this issue a few months ago, every one of the 3-4 times I changed my mind and decided to give There surely must be some kind of interaction between |
Just chiming in here, that I've observed exactly what's being described here as well. |
Same problem, both with WSL2 corruption and the host drive. |
I am also experiencing the same WSL and host corruption as everyone else since switching to |
unfortunately, my vhdx file gets corrupted after hours when I enable |
run a chkdsk on your host fs while you still can, and delete any vhds that were in sparse mode. |
So I've managed to somewhat curb the corruption
|
My VHDXs are showing 0 bytes also, can the data be recovered? |
It has been almost a year since this feature has been released and for what it looks like we have no fix to the corruption problem yet? The recommendation at MicrosoftDocs/WSL#1855 should at least be changed. |
Ever since I opened this thread, I've been consistently and periodically getting notifications of a new post here, so I'm really curious what the cause might be. Still, we're a small minority that's getting the corruption issue, so I assume there must be something specific in our PCs that interacts with WSL in such a catastrophic way. There would be way more open issues if this was a widespread problem. At this point I've just given up the So as long as |
This is still an experimental feature for which you need to go out of your way to set a flag. For me, on multiple systems, turning on the sparseVhd feature very reliably corrupts the filesystem of both guest and host, so I highly doubt it's system dependent. |
Just FYI. I was also facing this issue and gave up using sparseVhd. |
Yes, I've noticed this issue while playing with docker and fstrim commands. |
docker probably just creates and deletes A LOT of files, so it gives the sparse stuff a lot more work to do and a lot more chances to make a mess. |
Same issue here. I set the VHD to sparse, got filesystem read-only errors in WSL, fixed them with e2fsck. Then Win11 reported a hard drive issue, and after the automatic repair, I couldn’t boot into it anymore🥲. |
+1 After setting While WSL has saved me a lot of time, this option has cost me a lot of time again 😇 |
This issue had been open and almost heated issue almost a year and none of the WSL developers looks after this issue |
Reproduced it again on Win 11 WSL2 setup with host corruption. Currently, sparse vhd is critically dangerous feature! |
I'm working on finding a reliable way to recover lost data as a result of this. If you've lost data you want to recover please don't use the drive. Also, did anyone else find reliable ways to recover the data stored on their VHDX? |
Another related issue is that due to hard shutdowns, sudden reboots and other issues WSL2 ext4 filesystem inside *.vhdx could gradually get corrupted over time, so |
Windows Version
Microsoft Windows [Version 10.0.22621.2361]
WSL Version
2.0.4.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.123.1-1
Distro Version
Ubuntu 22.04
Other Software
No response
Repro Steps
I can't really reproduce this, I was mostly wondering if anyone else has had their virtual hd's gradually becoming corrupted with the pre-release version of WSL2.
I installed v2.0.4.0 two days ago, had an Ubuntu 22.04 (the standard distro from the store) already installed. After some time I suddenly started getting
filesystem read-only
errors. I've had this distro installed (same vhdx file) for almost a year now, never had similar issue (or any other for that matter). Only things that had changed now is the pre-release version and 2 settings activated in.wslconf
,autoMemoryReclaim=gradual
andsparseVhd=true
(I also ran--manage --set-sparse true
for my already existing image).Google said it's probably a corrupted disk image,
e2fsck
found errors and supposedly repaired them, but the read-only errors persisted. I loaded a copy of the vhdx file that I had from before the pre-release install, soon enough it also started throwing read-only errors. Debug console showed the root filesystem was being mounted with errors, I would correct them withe2fsck
but they persisted.I ended up nuking both files, and did a fresh distro install. Went fine but at some point it started throwing corruption errors too, this time
dpkg
wouldn't run because of corrupted files.I've now spent the last two days uninstalling and reinstalling WSL and testing out distros, but have been having the same issue. I wonder if it could be the
sparseVhd
option. Has anyone else had any similar issues? I've deactivated the option for now and watching if I get a corrupted file again, if I do I'll probably revert to the previous release version.Expected Behavior
Mainly I'd expect my vhdx files not becoming corrupted 😅
Actual Behavior
They became corrupted.
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: