microsoft / WSL

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

Wsl/Service/CreateInstance/WSL_E_DISK_CORRUPTED #12271

Open arthurmluz opened 1 week ago

arthurmluz commented 1 week ago

Windows Version

icrosoft Windows [versão 10.0.22631.4460]

WSL Version

2.2.4.0

Are you using WSL 1 or WSL 2?

Kernel Version

5.15.153.1-2

Distro Version

Ubuntu

Other Software

No response

Repro Steps

My notebook abruptly went into bluescreen while having vscode with the WSL open.

Got the BIOS message saying my HD got problems and it was being repaired.

When I got back, I tried to open WSL and got the following message;

Wsl/Service/CreateInstance/WSL_E_DISK_CORRUPTED

Expected Behavior

WSL to start

Actual Behavior

I get error and it wont open

Diagnostic Logs

WslLogs-2024-11-14_20-02-12.zip

I have tried following these instructions, but I can't perform wsl.exe lsblk and after I mount the vhd using the mount flag, I get an error saying the file is being used by another process Wsl/Service/AttachDisk/MountVhd/HCS/ERROR_SHARING_VIOLATION.

I had a project with commits that I didn't push, so I really need to get the files back,

Thanks.

github-actions[bot] commented 1 week ago

The logs shows that a disk mount error occured. Try to follow these repair instructions and see if that solves the issue.

Diagnostic information ``` Detected appx version: 2.2.4.0 Detected user visible error: Wsl/Service/CreateInstance/WSL_E_DISK_CORRUPTED Found evidence of ext4 error: [ 4.082459] EXT4-fs (sdc): VFS: Can't find ext4 filesystem ```
OneBlue commented 1 week ago

@arthurmluz: This might be because the disk was in use by WSL. Can you try to run wsl --shutdownbecause trying to mount the disk ?

arthurmluz commented 1 week ago

@arthurmluz: This might be because the disk was in use by WSL. Can you try to run wsl --shutdownbecause trying to mount the disk ?

Yes I have tried the following:

> wsl --shutdown > wsl.exe --mount .\ext4.vhdx --vhd --bare A operação foi concluída com êxito. (Translation: the operation completed sucessfully) > wsl.exe lsblk Falha ao anexar o disco '**\ext4.vhdx' ao WSL2: O arquivo já está sendo usado por outro processo. (Translation: Failed to attach the disc '....' File already in use by another process) Error code: Wsl/Service/CreateInstance/MountVhd/HCS/ERROR_SHARING_VIOLATION > wsl --shutdown > wsl.exe lsblk A distribuição não pôde ser iniciada porque seu disco virtual está corrompido. Translation: (The distribution can't start because your virtual disk is corrupted) Error code: Wsl/Service/CreateInstance/WSL_E_DISK_CORRUPTED

I also tried the following things to remount it:

Finally, I used DMDE to restore my files manually