Mounting (or linking to) an NTFS SD card in “Bash on Ubuntu on Windows”

11,710

Summary

In the latest Windows Insider build [16176], the Windows Subsystem for Linux (WSL) now allows you to manually mount Windows drives using the DrvFs file system. Previously, WSL would automatically mount all fixed NTFS drives when you launch Bash, but there was no support for mounting additional storage like removable drives or network locations.

Now, not only can you manually mount any drives on your system, we’ve also added support for other file systems such as FAT, as well as mounting network locations. This enables you to access any drive, including removable USB sticks or CDs, and any network location you can reach in Windows all from within WSL.

Mounting DrvFs

In order to mount a Windows drive using DrvFs, you can use the regular Linux mount command. For example, to mount a removable drive D: as /mnt/d directory, run the following commands:

$ sudo mkdir /mnt/d
$ sudo mount -t drvfs D: /mnt/d

Now, you will be able to access the files of your D: drive under /mnt/d. When you wish to unmount the drive, for example so you can safely remove it, run the following command:

$ sudo umount /mnt/d

Source: File System Improvements to the Windows Subsystem for Linux

Share:
11,710

Related videos on Youtube

jov14
Author by

jov14

Updated on September 18, 2022

Comments

  • jov14
    jov14 over 1 year

    I like to use the Ubuntu Bash that has been added to windows 10 since the Anniversary Update. It generally works fine and allows me to continue working when I switch between my Linux workstation and my Windows laptop. I usually share/sync my files via Dropbox, which (on my laptop) I can access from my Windows filesystem from the windows bash via /mnt/c/Users/Me/Dropbox.

    However, I want to be able to do the same from my tablet/netbook hybrid (Windows 10). Here, the original disk space is limited, so I added an NTFS formatted 128GB SD card (as drive "D:"), and set the Dropbox folder in Windows to sync there. This is not being recognized by Bash on Windows (I only see drive "c" in /mnt), even though I read this should be possible as long as the card is NTFS-formatted.

    I also tried to create soft links (junctions) from the SD card to C: in Windows (as I read these are supported by Bash on Windows now too), but they do not show up in /mnt/c when searching for them from Bash.

    Can this be fixed without relocating the Dropbox folder to C:?

  • Balkyto
    Balkyto over 6 years
    In theory this should work, but I'm getting: wrong fs type, bad option, bad superblock on F:, missing codepage or helper program, or other error (for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program)
  • Victor Torres
    Victor Torres about 6 years
    I'm afraid NFS and similar filesystems are not directly supported now as they're not a Windows Network Location.