Mounting USB-drives in WSL
A quick at how to mount a Drive in the Windows Subsystem for Linux, along with some useful links.
Ever since I heard about WSL, no not the World Surf League, I mean the Windows Subsystem for Linux I've found it pretty exciting. Who would have thought that one day Microsoft would offer Linux Distributions in their own Store? Apparently it even got some pretty good developer-support in Visual Studio Code.
Here's the official guide on how to install it.
A while ago I wanted to read some data off a USB-Stick within WSL and it turns out that it works out-of-the-box for drives that are already available in Windows itself.
# Say you want to acces drive G from the WSL
# Create a mouting point.
mkdir /mnt/g
sudo mount -t drvfs G: /mnt/gAdditional Ressources
- The original stackexchange post that contained the command.
- A blog-post about the WSL File System Supportfrom 2016 (no longer updated).
- Official WSL learning resources page.
- Documentation about the (exciting) upcoming version of the WSL; the WSL2.
- Quick-link on how to reset your password in WSL.