This post shows students and new users steps to mount and unmount a removable USB or thumb drive in the Windows Systems for Linux (WSL) environment. Windows 11 allows users to mount removable drives with ease. Simply insert a removable drive, and Windows will recognize and mount it.
However, when running WSL, mounting removable drives inside the WSL environment isn’t that easy.
Windows Subsystem for Linux allows you to mount drives manually using the mount command. WSL will automatically mount all fixed NTFS drives. So, if you have internal fixed C: and E: drives, you’ll see them mounted at /mnt/c and /mnt/e in your WSL environment.
You’ll have to mount external, removable drives in WSL manually. Davis also allows you to mount external drives like USBs, CDs, and DVDs. These devices must be formatted using a Windows file system like NTFS or FAT.
Similarly to internal drives, external drives will remain accessible in Windows 11 when mounted within the Windows Subsystem for the Linux environment.
Below is how one can mount an external drive in a WSL environment.
How to mount an external drive in WSL
As mentioned above, one can mount external drives like USB, CD, and other devices in Windows System for Linux.
For example, if you have an external drive attached to your Windows 11 computer using the drive letter F: you can mount it in WSL using the commands below.
sudo mkdir /mnt/f sudo mount -t drvfs F: /mnt/f
You can now access the drive content in Linux at the mount point /mnt/f.
To unmount the drive, simply run the commands below.
sudo umount /mnt/f/
That should do it!
Conclusion:
- Mounting external drives in the WSL environment provides easy access to USBs, CDs, and other removable devices.
- The mount command is required for external drives, while internal drives are automatically mounted in WSL.
- Using drive letters, like F:, allows you to specify which external drive to mount.
- Unmounting is straightforward with the
umount
command. - Following these steps ensures seamless integration of WSL with your Windows file systems.
Leave a Reply