microsoft / WSL

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

wsl 2 can not use the mount path from dev drive #10792

Open leolcao opened 11 months ago

leolcao commented 11 months ago

Windows Version

Microsoft Windows [Version 10.0.22621.2715]

WSL Version

1.2.5.0

Are you using WSL 1 or WSL 2?

Kernel Version

5.15.90.1

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

  1. create the dev drive from dev home preview app, also from https://learn.microsoft.com/en-us/windows/dev-drive/
  2. the dev drive is set to E:, and path is set to D:\packages
  3. shutdown wsl by wsl --shutdown
  4. open the WSL2 Ubuntu 22.04 distro, input ls /mnt/d/packages
  5. error: ls: cannot access '/mnt/d/packages': Input/output error

This error affects the usage of wsl docker command from windows host directly, like:

wsl docker compose up

if there is volume binding in docker-compose.yml file from the path mount from dev drive, also failed, like: d:\packages\workdir:/opt/workdir, In before, it works and d:\packages\workdir will be converted to /mnt/d/packages/workdir in wsl distro

Besides, in the windows terminal setting, if I set the default startingDirectory to "d:\packages", the wsl terminall will failed also, but in before, wsl terminal can tell the startingDirectory, and convert to '/mnt/d/packages'

Expected Behavior

wsl 2 can use the path mount from dev drive like before.

Actual Behavior

leo@LeoCao-OMEN8Pro:~$ ls /mnt/d/packages/ ls: cannot access '/mnt/d/packages/': Input/output error

Diagnostic Logs

image

WslLogs-2023-11-22_22-03-38.zip

github-actions[bot] commented 11 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

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. Thank you!

Open similar issues:

Closed similar issues:

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

OneBlue commented 11 months ago

/logs

leolcao commented 11 months ago

/logs

Hi I uploaded the logs~

OneBlue commented 11 months ago

Thank you @leolcao. Looking at the logs I can see that you have a custom kernel. Can you see if you can reproduce the issue with the official kernel ? If so, please collect /logs again

leolcao commented 11 months ago

I just updated the wsl to 2.0.9, and remove the custom kernel, unlucky, this issue still there~

> wsl -v
WSL 版本: 2.0.9.0
内核版本: 5.15.133.1-1
WSLg 版本: 1.0.59
MSRDC 版本: 1.2.4677
Direct3D 版本: 1.611.1-81528511
DXCore 版本: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows 版本: 10.0.22621.2715
[wsl2]
processors=10
memory=16GB
swap=0
localhostForwarding=true
kernelCommandLine=systemd.unified_cgroup_hierarchy=1 cgroup_no_v1=all
leo@LeoCao-OMEN8Pro:~$ ls /mnd/d/packages
ls: cannot access '/mnd/d/packages': No such file or directory

btw, the dev-drive is mount to F:, and it is no error if I use command like ls /mnt/e ls /mnt/f in the wsl ubuntu distro. This error is only for the mount path in the ntfs drive from one dev drive.

Actually, I have 2 dev drives: E:(dev drive) --> D:\LeoCao\Projects F:(dev drive) --> D:\packages(mount path in ntfs drive)

Both them has same issue.

WslLogs-2023-11-24_08-38-15.zip

OneBlue commented 11 months ago

@craigloewen-msft: Looks like we need to update p9rdr.sys to follow dev-drive mounts.

GF-Huang commented 7 months ago

Same issue. Dev Drive mount at D:\Dev\

>wsl --version
WSL 版本: 2.0.14.0
内核版本: 5.15.133.1-1
WSLg 版本: 1.0.59
MSRDC 版本: 1.2.4677
Direct3D 版本: 1.611.1-81528511
DXCore 版本: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows 版本: 10.0.22631.3296

image

image

OneBlue commented 5 months ago

The issue is fixed with Windows 11 24H2 (the root cause of the issue is in the Windows image so the fix cannot be part of the WSL package).

pengweiqhca commented 4 months ago

The issue is fixed with Windows 11 24H2 (the root cause of the issue is in the Windows image so the fix cannot be part of the WSL package).

Dev drive must have "Drive Letter".

codekaizen commented 2 months ago

The issue is fixed with Windows 11 24H2 (the root cause of the issue is in the Windows image so the fix cannot be part of the WSL package).

I tried the 24H2 release candidate Win11 build but the fsync error continues to appear on a Dev Drive.

GF-Huang commented 1 week ago

This issue is still present with 24H2, could you please reopen it :

Agree. Issue still.

版本  Windows 11 专业版
版本号 24H2
安装日期    ‎2024/‎10/‎2
操作系统版本  26100.2033
体验  Windows Feature Experience Pack 1000.26100.23.0
juchom commented 1 week ago

This issue is still present with 24H2, could you please reopen it :

Windows information

nu> wsl -v
WSL version: 2.3.24.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.65
MSRDC version: 1.2.5620
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26100.2033

Docker information

nu> docker -v
Docker version 27.2.0, build 3ab4256

DevDrive information

nu> fsutil devdrv query d:
This is a trusted developer volume.

Developer volumes are protected by antivirus filter.

Filters currently attached to this developer volume:
    WdFilter

If you run this command :

docker run --rm --name pg-test -e POSTGRES_PASSWORD=Pwd12345! -v d:/dev/pgtest:/var/lib/postgresql/data -p 5432:5432 postgres:15.8

You will have this output

chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data ... initdb: error: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted

I also tried this according to this doc : https://learn.microsoft.com/en-us/windows/dev-drive/#filters-for-common-scenarios

Adding filters for Docker: Running containers out of Dev Drive bindFlt, wcifs

fsutil devdrv setfiltersallowed /f /volume D: "bindFlt, wcifs"

Make sure they are present

nu> fsutil devdrv query d:
This is a trusted developer volume.

Developer volumes are protected by antivirus filter.

Filters allowed on this developer volume:
    bindFlt, wcifs

Filters currently attached to this developer volume:
    WdFilter

Full reboot of the system and same issue.

kirk-marple commented 1 week ago

This may have broken with a recent Win11 update; this had been working perfectly for months, and last night my system installed a Windows Update and now I can't access anything from my Dev Drive using WSL2.

WSL version: 2.3.24.0 Kernel version: 5.15.153.1-2 WSLg version: 1.0.65 MSRDC version: 1.2.5620 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.26100.1-240331-1435.ge-release Windows version: 10.0.26100.2152

PhiliaTheCat commented 1 week ago

Same issue on my system after a recent system update. Seems that update breaks the compatibility. I think this worth a reopening.

OneBlue commented 1 week ago

Reopening due to reports of the issue not being resolved.

@juchom / @kirk-marple, can you capture /logs of the issues you're seeing ?

theAeon commented 1 week ago

another +1 on the pile

Edition Windows 11 Education Version 24H2 Installed on ‎5/‎23/‎2024 OS build 26100.2152 Experience Windows Feature Experience Pack 1000.26100.32.0

juchom commented 1 week ago

Here are the logs for my case

Reopening due to reports of the issue not being resolved.

@juchom / @kirk-marple, can you capture /logs of the issues you're seeing ?

WslLogs-2024-10-16_10-57-38.zip

Tony763 commented 1 week ago

Same issue on linux. (Ubuntu 24.10)

/var/lib/postgresql/14 is mounted volume.

chown -R postgres:postgres /var/lib/postgresql/14/main 
chown: cannot read directory '/var/lib/postgresql/14/main/pg_serial': Permission denied
chown: changing ownership of '/var/lib/postgresql/14/main/postmaster.pid': Operation not permitted
...
ishpagin commented 1 week ago

+1

Image

kirk-marple commented 5 days ago

Reopening due to reports of the issue not being resolved.

@juchom / @kirk-marple, can you capture /logs of the issues you're seeing ?

My logs are linked to my report of this issue: https://github.com/microsoft/WSL/issues/12156