microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.46k stars 822 forks source link

Reinstallation deletes home directory without warning #5380

Open NiklasBr opened 4 years ago

NiklasBr commented 4 years ago

Environment

Windows build number: 10.0.19041.0
Your Distribution version: 18.04
Whether the issue is on WSL 2 and/or WSL 1: Linux version 4.4.0-19041-Microsoft (Microsoft@Microsoft.com) (gcc version 5.4.0 (GCC) ) #1-Microsoft Fri Dec 06 14:06:00 PST 2019

Steps to reproduce

  1. Right-click the Ubuntu icon in the start menu, choose uninstall.
  2. Choose OK if you really want to remove it.
  3. Re-install the same distribution from Microsoft Store.
  4. Lanuch again and check your ~ directory for your files.

Unbutu had crashed adn refused to start with the error message

The exception s (0xPress any key to continue...

The only way forward was to re-install the distribution.

Expected behavior

To delete the application should never delete the data in the user directory. That's like deleting Word and having Users\My Documents deleted

Actual behavior

It appers that the file system gets nulled when uninstalling the distribution. Information like this shoud:

A. Be preserved when the application is deleted. or at the absolute minimum: B. A warning saying that uninstalling an application will also format the file system.

rescenic commented 4 years ago

Yeah, the first lesson of WSL about uninstalling wsl distro. Haha

Alonski commented 4 years ago

This is quite ridiculous :( This just happened to me. I have been using WSL as a main and integral part of my dev environment.

Today my machine crashed. When it started up WSL wouldn't start. I was getting this error: the system cannot find the file specified

I tried unregistering Ubuntu thinking I could register it again. This seemed to delete it though and I had to reinstall Ubuntu...

When I then started WSL up everything was gone :(

I am guessing there is no way to get things back.

tombohub commented 3 years ago

I agree

easherma-truth commented 3 years ago

This is crazy, can't believe it just wiped my home directory.

bseidlit commented 2 years ago

This has happened to me on windows 11 with wsl 2...devastating.

wsl2 had issue running when I opened ubuntu. I am not sure if there were any error messages. I did not re-install ubuntu but only restarted my computer. The program was definitely having issues. Then when I open ubuntu again it was wipped clean and there was a new .bashrc which was unlike the originally installed one.

yungifez commented 2 years ago

Damn this is so annoying

I had a project which was forming up quite well

And I hadn't published on github because I had no Internet for sometime

Well let's just say I lost around 4 days of work

owlstead commented 1 year ago

Also happens when you "reset" Windows 11 by the way. It says it saves your data, but it doesn't.