microsoft / WSL

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

Please support drives mounted to a folder #5993

Closed alamp1360 closed 9 months ago

alamp1360 commented 4 years ago

Hi!

I have mounted my data disk as a folder to c:\data using the procedure described here:

https://docs.microsoft.com/en-us/windows-server/storage/disk-management/assign-a-mount-point-folder-path-to-a-drive

When trying to access this folder from within WSL by changing directory to /mnt/host/c/data, i get an input/output error.

When i do an "ls" in /mnt/host/c, the data is shown as a symlink, i guess (it's light blue), but when i do a "ls -l", it says: cannot read link: I/O error.

It would be really helpful if you could support such type of "windows symlinks" in WSL, too...

Greetings Andreas

pcbeard commented 3 years ago

I just noticed this too. The workaround is to also give the drive its own letter. Grudgingly I assigned Z to this folder mounted SSD. Please fix. Ideally, give us a way to mount drives wherever we want according to fstab.

Leffe108 commented 3 years ago

I run into this too.

I have all my code projects sitting on a separate disk mounted into my user folder in Windows. Due to this bug, I cannot access it from wsl2 to for example use php-cli installed via apt in debian to execute a script than uses extra modules that is much easier to install in debian than on windows.

It is on a separate disk because my C:\ become full many years ago and had to buy a separate disk and move some files to it and the easiest way to do than without breaking paths is to mount it into a folder.

Biswa96 commented 3 years ago

If it is a separate disk it will appear mounted with that drive letter in /mnt, just like /mnt/c for C:\ drive.

Leffe108 commented 3 years ago

If it is a separate disk it will appear mounted with that drive letter in /mnt, just like /mnt/c for C:\ drive.

Unfortunately that is only the case for disks that are mounted as a drive letter.

bild

bild

But my intel SSD disk mounted to C:\Users\Leif\Programmering folder is not listed in /mnt.` And accessing it via its path gives the input/output error as mentioned in OP

bild

I'm not quite sure where the disk management tool has gone in Windows 10, but here is a screenshot of the defrag tool that lists the folder mounted disk: bild

Biswa96 commented 3 years ago

It is possible to make a little program to do that. But I am not sure if it will actually work 🤓 The idea is like this - Mount the path with HcsModifyComputeSystem function from Windows side using plan9 server. Then mount it in WSL side with that as plan9 client.

Leffe108 commented 3 years ago

I found a workaround:

Side note: If you use Windows in English the disk management tool can also be found in the search bar by searching for words like partion and possible also disk. But in Windows for Swedish that is simply not possible. You have to know to right click on start menu or know its name to use in the run dialog. :-/

microsoft-github-policy-service[bot] commented 9 months ago

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

Thank you!