Tuesday, September 15, 2020

Mounting USB drives in Windows Subsystem for Linux

Windows Subsystem for Linux can use (mount):

  1. SD card
  2. USB drives
  3. CD drives (CDFS)
  4. Network drives
  5. UNC paths

Local storage / drives

Drives formatted as FAT, ExFAT or NTFS can be mounted in WSL. For this example, we assume the drive shows in Windows as F:\ If Windows changes the USB drive letter on a subsequent session, you need to repeat this process.

The commands are typed into the Windows Subsystem for Linux Terminal.

Create a mount location in WSL:

mkdir /mnt/f

Mount the drive in WSL:

mount -t drvfs f: /mnt/f

After this one-time setup, one can create and manipulate files from both Windows and WSL on the same drive.

Network storage

Here we assume:

networked storage is already showing in Windows under \\server\share

we want to access this network storage from WSL as /mnt/share

Create a mount location in WSL:

mkdir /mnt/share

Mount the network share in WSL:

mount -t drvfs '\\server\share' /mnt/share

***Note: the above text is copied from [1]. It belongs to the author who has published it on that website. 

References

1. https://www.scivision.co/mount-usb-drives-windows-subsystem-for-linux/

2. https://docs.microsoft.com/en-us/archive/blogs/wsl/file-system-improvements-to-the-windows-subsystem-for-linux

No comments:

Post a Comment

Mounting USB drives in Windows Subsystem for Linux

Windows Subsystem for Linux can use (mount): SD card USB drives CD drives (CDFS) Network drives UNC paths Local storage / drives Drives form...