In the Windows Subsystem for Linux, I can access the C: drive as /mnt/c.
How can I access other drive letters, such as optical discs and network mounts? They do not show up under /mnt for me.
In the Windows Subsystem for Linux, I can access the C: drive as /mnt/c.
How can I access other drive letters, such as optical discs and network mounts? They do not show up under /mnt for me.
Update to DavidPostill's answer:
Issue Drives other than C: are not mounted in /mnt #1079 and related issue Update /mnt #2237 now marked as closed, solutions below.
You will need to be on Windows 11 Build 22000 or higher to access this feature
Microsoft WSL2 docs Get started mounting a Linux disk in WSL 2 describes how this can be done in PowerShell terminal (PS) and WSL bash linux terminal ($).
PS wmic diskdrive list briefPS wsl --mount <DiskPath> --bare$ lsblk$ sudo blkid <DevicePath>PS wsl --mount <DiskPath> --partition <PartitionNumber> --type <Filesystem>PS wsl --mount <DiskPath> --type <Filesystem>Microsoft blog post File System Improvements to the Windows Subsystem for Linux describes how this can be done in the WSL bash terminal to mount using DrvFS.
e.g. for drive D
Mount: $ sudo mkdir /mnt/d$ sudo mount -t drvfs D: /mnt/d
Unmount: $ sudo umount /mnt/d
At the moment there are limitations on what drives are mounted:
In order for a drive to show up under /mnt/ it must meet the following criteria:
- The drive must be a fixed drive
- The drive must be formatted to NTFS.
This has been raised as an issue: Drives other than C: are not mounted in /mnt #1079. It is still marked as "Open".