6 ms·
More: - WSL2 sometime corrupt .zsh_history and git https://github.com/microsoft/WSL/issues/5026 https://github.com/microsoft/WSL/issues/5026 - WSL2 corrupts e
by delduca 6y ago
More:
- WSL2 sometime corrupt .zsh_history and git https://github.com/microsoft/WSL/issues/5026 https://github.com/microsoft/WSL/issues/5026
- WSL2 corrupts ext4 filesystem https://github.com/microsoft/WSL/issues/5895 https://github.com/microsoft/WSL/issues/5895
- tutfbhuf 6y agoBut why? WSL1 was something like wine but reverse, but WSL2 is actually linux.
- temac 6y agoWild guesses: * the kernel is not properly shutdown (and sometimes some buffers are not flushed) * the virtual block device and/or its linux driver has bugs
- cesarb 6y agoThat's probably the cause. WSL2 being Linux means that, unlike WSL1 which directly uses the host NTFS filesystem, it's probably using an emulated block device to hold its filesystem. If that emulated block device doesn't correctly honor write barrier requests from the Linux kernel, it could explain the corruption.
- tremon 6y agoThe problem is likely not in the Ext4 code, but in the block I/O driver (which is Hyper-V specific, IIRC) or even in Hyper-V itself. Several reports mention Windows shutdowns, sleep or hibernation, so it may be a simple unclean shutdown of the VM. A bigger problem would be if Hyper-V is either ignoring memory barriers, or caching writes to the disk and losing them when the Hyper-V service is shutdown. But that would likely affect more than just WSL, so we'd have seen the problem sooner (or so I vehemently hope).
- magicalhippo 6y agoI recall ext4 had[1] some issues[2] with data loss due to unclean shutdowns. I assumed that had all been fixed by now, but yeah, these things can get tricky fast. [1]: https://lwn.net/Articles/322823/ https://lwn.net/Articles/322823/ [2]: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/317781/comments/45 https://bugs.launchpad.net/ubuntu/+source/linux/+bug/317781/...
- bmurphy1976 6y agoHuh, interesting. I run a variety of linux based services at home. For years I ran them on a Hyper-V VM (because my computer was technically my gaming machine). I only recently migrated everything to a cluster of Raspberry Pi devices. I used to have occasional problems with this setup, and it was always some kind of drive corruption or mounting issue. I wonder if this is related?
- the8472 6y agoVirtualbox has (had?) similar issues in certain configurations where it maintains a small write cache and doesn't honor IO barriers which lead to journaled/cow filesystems reporting an inconsistent state that should have been prevented by journaling.
- merb 6y ago> Hyper-V service is shutdown as far as I know when wsl2 is actiavted, hyper-v runs as type-1 and linux, windows are virtual after activating it. thus if it crashes, you get a bsod
- dehrmann 6y agoFreeBSD has native support for Linux binaries by mapping system calls, and it's fairly reliable when it works. What's nice is that when it works, it works, adding support for system calls improves coverage, and since underlying things like the FS aren't virtualized, it tends to be pretty reliable.
- loeg 6y agoYeah; Windows had something like that, too. It was WSL1 (or just "WSL"). I also tend to think that was the better approach.
- bonzini 6y agoIt didn't extend to use cases like containers, that would have basically required MS to rewrite large parts of the Linux kernel's core code for namespaces, mount points etc.
- loeg 6y agoSure. Running a Linux VM (WSL2) just to use containers seems to kind of defeat the point, though. You might as well just run your containers in VMs.
- bonzini 6y agoThe use case is for developers to use their Linux tools with Windows integration. WSL1 only did the latter half well, "traditional" VMs only did the former. WSL2 does both, however that brings both advantages and disadvantages of VMs.
- kurare 6y agoI use arch linux.
- uncledave 6y agoThis is probably HyperV. I’ve seen exactly this ext4 corruption in production on windows server 2012R2 with CentOS 7. Even to the point that the machine remounts root read only. Unfortunately our windows operations guys are severely lacking in diagnostic savvy and just reboot the machine over and over again or blast it and provision a new one and don’t analyse the problem. From what I’ve seen it’s a combination of the storage drivers and the storage virtualisation in HyperV rather than a specific issue. I imagine it’s something similar in WSL. I really don’t trust it as a platform at all. It’s barely better with windows guests.
- ncphil 6y agoHad a serious talk a Unix manager over a decade ago who was convinced Windows ops didn't require as much expertise as Unix/Linux. It was a common misconception that MS seemed to encourage. As someone who came over from Windows, I knew better. That attitude continues to influence standard practices, hiring and, most importantly, training and education opportunities for Windows admins -- to the detriment of all. I've also had my collisions with Hyper V, and have come away with the same impressions as you have.
- uncledave 6y agoAgreed. I've done both and if you ask me Windows ops is vastly more difficult because everything is brittle, inconsistent and unreliable and rarely repeatable almost all of the time. It requires great skill, determination and persistence to navigate issues like this. Unfortunately as you suggest, the outcome is hiring as cheap as possible and fixing all issues by not changing anything other than replacing everything every few years. There is rarely any day to day admin I see other than planning the next major rollout with some vain hope it'll have less problems than the last one.
- oblio 6y agoI don't know if I'd call it brittle, I would call it super complex (when you get into wmic & friends) and harder to get info online, compared to Linux, because everyone has to tinker with Linux while only a minority of power sysadmins dig that deep into Windows.
- 29athrowaway 6y agoExecute order 66.