At times, we require to transfer contents to or from the pendrive from WSL(Windows Subsystem for Linux). So, in this tutorial we will learn How to Access Pen-drive in Windows Sub-System for Linux
To access Pen-drive in Windows Sub-System for Linux, we have to mount the pendrive. So, follow the below mentioned steps:
Step1: Plugin the pendrive
Step2: Check what is the drive symbol (E or F etc). Let’s suppose the symbol allocated to the pendrive is ‘E’
Step3: Create a directory in your current working directory to mount the pendrive. Mount means you will be able to view the contents in this particular directory
Step4: Mount the pendrive using the command
#mount -t drvfs E: pen_content
Note: you have be root user to execute the mount command
Step5: View/Access the contents from the pen_content directory
How to Access ‘C’ drive in WSL (Windows Subsystem for Linux)
To access any of the drives like C or D or E, simple access the /mnt directory in Linux.
Now, you know the location of all the drives, so, use any of the command as desired like
$cp f1 /mnt/c/Users/Baljit/Desktop
will copy file f1 from current working directory to Desktop in Windows.