The command wsl --unregister ubuntu22.04 deletes ext4.vhdx permanently
My WSL info Win10:22H2,19045,6466 WSL: WSL 版本: 2.6.3.0 内核版本: 6.6.87.2-1 WSLg 版本: 1.0.71 MSRDC 版本: 1.2.6353 Direct3D 版本: 1.611.1-81528511 DXCore 版本: 10.0.26100.1-240331-1435.ge-release Windows: 10.0.19045.6466
I import ubuntu22.04 by using import command, and accidently use
wsl --unregister ubuntu22.04
and found my 100G ext4.vhdx is deleted permamently from my hard disk, and can't recovered by any data recoverty software Is there any remedy to recover my 100G ext4.vhdx data? I think this is a bug of WSL2
Logs are required for review from WSL team
If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise, please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.
How to collect WSL logs
Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1
The script will output the path of the log file once done.
If this is a networking issue, please use .\collect-wsl-logs.ps1 -LogProfile networking instead, following the instructions in Collect WSL logs for networking issues
Once completed please upload the output files to this GitHub issue.
See Collect WSL logs (recommended method).
If you choose to email these logs instead of attaching them to the bug, please send them to [email protected] with the GitHub issue number in the subject, and include a link to your GitHub issue comment in the message body, and reply with '/emailed-logs'.
The log file doesn't contain any WSL traces. Please make sure that you reproduced the issue while the log collection was running.
Diagnostic information
Detected appx version: 2.6.3.0
Found no WSL traces in the logs
The file was deleted permanently, I can't reproduce the event
The log file doesn't contain any WSL traces. Please make sure that you reproduced the issue while the log collection was running.
Diagnostic information
I think this is intentional
This is by design. See the help message:
--unregister <Distro>
Unregisters the distribution and deletes the root filesystem.
Which fking genius programmer think it is a good ideal to include the meaning of DELETE in --unregister command?
13. Which fking genius programmer think it is a good ideal to include the meaning of DELETE in --unregister command?
I think this is real BUG, but the WSL don't recognize it. Don't use WSL to process your important data
14. > 13. Which fking genius programmer think it is a good ideal to include the meaning of DELETE in --unregister command?
I think this is real BUG, but the WSL don't recognize it. Don't use WSL to process your important data
There are many other issues regarding this brilliant design. https://github.com/wslkit/wslkit/issues/29
I have accepted the loss and move on. :)