Live data from Hacker News

WSL2 corrupting Git repositories and shell history

github.com

31–40 of 423 posts

Re: WSL2 corrupting Git repositories and shell history

#31
post #2

More: - WSL2 sometime corrupt .zsh_history and git https://github.com/microsoft/WSL/issues/5026 - WSL2 corrupts ext4 filesystem https://github.com/microsoft/WSL/issues/5895

This 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.

Re: WSL2 corrupting Git repositories and shell history

#33

I think calling it WSL2 was a mistake. The predecessor, WSL, "just worked" and it was more a less a linux experience for most practical purposes-- and certainly better than hoary old cygwin. This caused a lot of people to believe they could just transition to WSL2, lead on by the promise of an even more performant linux experience. The documentation didn't say anything about complications from attempting this, so a l…

Wasn't the main purpose of WSL2 to make WSL finally usable because before v2 it had really bad IO perf?

Re: WSL2 corrupting Git repositories and shell history

#34
post #22
post #4

Earlier quoted context omitted.

But why? WSL1 was something like wine but reverse, but WSL2 is actually linux.

The 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…

I 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/

[2]: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/317781/...

Re: WSL2 corrupting Git repositories and shell history

#35

MS is ridiculous, corrupting the filesystem is an OS mistake of the first order. Any systems developer should view corruption of a persistent storage system of any kind as totally unacceptable. And in this case the whole filesystem is open source! Meanwhile the open source people built a decent NTFS driver for linux years ago, I haven't seen what specs are released but I assume they needed to fill a few doc gaps to m…

Yes, let's pretend that the 4.19 EXT4 corruption issue in 2018 never happened.

Re: WSL2 corrupting Git repositories and shell history

#36
post #11
post #3

I don't really understand the use case for WSL. What are the advantages? You could run a full Linux VM and do everything on it on any machine these days. Which is what I do, but I'm just an old school hack. Anyone who uses WSL care to enlighten me? Thanks!

It's very useful for projects that require (or work better in) a linux environment. I don't want to start up a full linux VM, that sounds like a lot of overhead and I'm more likely to not bother at all. WSL is much lighter than that (we're not talking virtualbox here), if I open windows terminal its up and running, there's almost-zero start up cost. With VSCode I can switch between working in WSL and windows easily,…

You've not explained why you would not run a native Linux system in the first place…

Re: WSL2 corrupting Git repositories and shell history

#37

MS is ridiculous, corrupting the filesystem is an OS mistake of the first order. Any systems developer should view corruption of a persistent storage system of any kind as totally unacceptable. And in this case the whole filesystem is open source! Meanwhile the open source people built a decent NTFS driver for linux years ago, I haven't seen what specs are released but I assume they needed to fill a few doc gaps to m…

Not sure how an issue like this doesn’t make it into the test suite.

Probably another symptom of them firing their QA team [1].

https://www.ghacks.net/2019/09/23/former-microsoft-employee-...

Re: WSL2 corrupting Git repositories and shell history

#38

I will need to monitor this more closely. I have switched to a WIN/WSL2 setup recently from Mac and have not had this problem happen to me. Nonetheless I hope this gets fixed before it hits me.

Keep the Mac handy. I just went the other way to you because of a thousand paper cuts.

Re: WSL2 corrupting Git repositories and shell history

#39
post #20

Earlier quoted context omitted.

I have been teaching computer related classes to uni students for some time. Most of them run Windows. Running a virtual machine often means accessing the UEFI to be sure they have virtualization extensions enabled. And many of them have shitty personal laptops, which means running a VM will really slow the "Linux" experience. Sharing files between the host and the guest is also sometimes tricky, and I don't want to…

> Running a virtual machine often means accessing the UEFI to be sure they have virtualization extensions enabled. Likewise for WSL2. I hope modern computers with a capable processor are all shipped with virtualization enable at firmware level, because Hyper-V can be used for tons of things in recent Windows.

Enabling hardware virtualisation opens up a significant and deep attack surface. Considering the vanishingly small percentage of users which benefit from it, I hope it stays off by default.

Re: WSL2 corrupting Git repositories and shell history

#40

I will need to monitor this more closely. I have switched to a WIN/WSL2 setup recently from Mac and have not had this problem happen to me. Nonetheless I hope this gets fixed before it hits me.

Keep the Mac handy. I just went the other way to you because of a thousand paper cuts.

Same here. I want to like Windows but MS just makes it impossible.

The MBP M1 has blown me away, I don't think I'll try to go back any time soon.

Post reply on HN