vhdx files becoming corrupted since 2.0.4.0 pre-release install
- Dominant language
- C++
- Stars
- 33.7k
- Forks
- 1.8k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 116
Description
### Windows Version
Microsoft Windows [Version 10.0.22621.2361]
### WSL Version
2.0.4.0
### Are you using WSL 1 or WSL 2?
- [X] WSL 2
- [ ] WSL 1
### 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` and `sparseVhd=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 with `e2fsck` 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_
Contributor guide
Research direction
Start by reproducing the report with WSL 2.0.4.0, Ubuntu 22.04, and the sparseVhd and autoMemoryReclaim settings described in the issue. Compare behavior with sparseVhd disabled and inspect the resulting filesystem errors; done means identifying a reliable corruption trigger and documenting or resolving it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100