When I go into WSL the C
drive is automatically mounted at /mnt/c
. I would further like to mount a folder C:\D
to the mount point /mnt/d
.
The contents of /etc/fstab
:
LABEL=cloudimg-rootfs / ext4 defaults 0 0
/mnt/c/D /mnt/d none bind
The contents of /etc/wsl.conf
:
# Enable extra metadata options by default
[automount]
enabled = true
root = /mnt/
options = "metadata,umask=22,fmask=11"
mountFsTab = true
# Enable DNS – even though these are turned on by default, we’ll specify here just to be explicit.
[network]
generateHosts = true
generateResolvConf = true
When I do sudo mount -a
then it mounts correctly. However it is not mounted at startup and running mount -a
reports "mount: only root can use "--all" option".
ln -s /mnt/c/D /mnt/d
. However I'd not recommend this because you create the impression that it's a mount point while it's not.