WSL can't access disk mounted *below* a drive letter
A Win10 host, with WSL 2 running Ubuntu 18.04,
has an SSD mounted as drive path (C:) \2
in Disk Management. (This was to quickly "grow" my C: SSD for software that insists on being installed on C: rather than the roomier but slower D: HDD.)
But from the Ubuntu shell, at /mnt/c
, I can't cd 2
, ls 2
, etc. Most commands fail with
cannot read symbolic link '2': Input/output error
.
WSL commands can access the rest of /mnt/c and /mnt/d.
Of course Windows can access C: and C:\2 and D:.
How can I get WSL to access /mnt/c/2
?
(subst f: c:\2
makes f:
, slightly differently in powershell than cmd.exe, but in neither case does WSL show a corresponding /mnt/f.)
It's a bug in WSL.
You can remount problematic mount point as a different dir in WSL, outside of /mnt/c
:
sudo mkdir /mnt/2
sudo mount -t drvfs C:\\2 /mnt/2
(note the escaped backslash)
It can be inconvenient, since relative paths stop working. But at least you can access files.