Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/etc/fstab vhdx disk fails to mount at boot randomly #11539

Closed
1 of 2 tasks
borjamunozf opened this issue Apr 30, 2024 · 8 comments
Closed
1 of 2 tasks

/etc/fstab vhdx disk fails to mount at boot randomly #11539

borjamunozf opened this issue Apr 30, 2024 · 8 comments

Comments

@borjamunozf
Copy link

Windows Version

Microsoft Windows [22631.3447) 23H2

WSL Version

2.1.5

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.146

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

As mentioned #11281 this is a random error (or it seems so) that I was able to reproduce in my machine, but it affects other developers in my company with slighly different versions of WSL2 and Windows.

I have some issues to get the logs because the script got blocked by the EDR in the company.

  1. External vhdx disk.
  2. To mount it automatically, the disk has a label called "workspace" with tune2fs -L "workspace" /dev/sdd
  3. Modified fstab like this
    LABEL=workspace /home/ubuntu/workspace ext4 defaults 0 2
  4. Created launch config in Windows Terminal for Ubuntu 22 with the following:
    powershell.exe -Command "wsl.exe -d Ubuntu-22.04-abc--mount --vhd C:\vhd\workspace\workspace.vhdx --bare | Out-Null; wsl.exe ~ -d Ubuntu-22.04-abc"
  5. Start distro.

Expected Behavior

Disk is automatically mounted always.

Actual Behavior

Start distro shows ~50-60% of times this error.

Processing fstab mount -a with failed

[Fri Mar 8 14:38:46 2024] mount:
[Fri Mar 8 14:38:46 2024] /home/ubuntu/workspace: can't find LABEL=workspace.
[Fri Mar 8 14:38:46 2024] WSL (1) ERROR: UtilCreateProcessAndWait:687: /bin/mount failed with status 0x2000

Diagnostic Logs

Here the logs meanwhile WslLogs-2024-04-30_12-01-59.zip

  • Issue showing up and happening 3-4 fresh new opened terminals.
  • Shutdown wsl.
  • Start again distro & in this case it did not fail the mount.
Copy link

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Diagnostic information
.wslconfig found
	Custom kernel found: 'C:\Users\SFDXBMU\vmlinux-5.15.146.1.1'
Detected appx version: 2.1.5.0
Detected user visible error: Wsl/Service/AttachDisk/MountVhd/WSL_E_USER_VHD_ALREADY_ATTACHED
Detected user visible error: Wsl/Service/AttachDisk/MountVhd/WSL_E_USER_VHD_ALREADY_ATTACHED
Detected user visible error: Wsl/Service/AttachDisk/MountVhd/WSL_E_USER_VHD_ALREADY_ATTACHED
Detected user visible error: Wsl/Service/AttachDisk/MountVhd/WSL_E_USER_VHD_ALREADY_ATTACHED

@OneBlue
Copy link
Collaborator

OneBlue commented Apr 30, 2024

@borjamunozf: wsl --mount will only be able to mount the disk when running WSL as admininistrator.

Could it be that the failures are when WSL is not started as admin ?

@borjamunozf
Copy link
Author

borjamunozf commented May 1, 2024 via email

@OneBlue
Copy link
Collaborator

OneBlue commented May 1, 2024

Does the mount work if let's say you run wsl --shutdown, and then start WSL as admin ?

@borjamunozf
Copy link
Author

Same behaviour:

  • sometimes it works, sometimes not. As it was executed in a normal terminal

imagen

imagen

@OneBlue
Copy link
Collaborator

OneBlue commented May 3, 2024

Interesting. Could you collect logs of a working and a non working repro when running WSL as administrator (in separate files if possible)?

/logs

@borjamunozf
Copy link
Author

I will try to run again, it's a bit annoying because the EDR of my company blocks it and we have to request specific and temporary approval of the script.

And also as it's a bit random could take a while to get both samples.
Updating this just to avoid the issue to be closed again

Copy link
Contributor

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-file it as a new issue.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants