12

I'm using Ubuntu 16.04 over the Windows 10 Linux subsystem. When I plug in an NTFS external hard drive (D:) I cannot access it over the bash, when I run ls -la /mnt I get the following output:

rwxr-xr-x 1 root    root    512 Sep 21 19:04 .
drwxr-xr-x 1 root    root    512 Jan  1  1970 ..
drwxrwxrwx 1 <myusername> <myusername> 512 Sep 21 13:06 c
d????????? ? ?       ?         ?            ? d
drwxrwxrwx 1 <myusername> <myusername> 512 Sep 21 13:06 q

I also tried to mount the drive manually following this solution but the result is the same. The disk is accessible from PowerShell and from the file explorer.

2
  • I'm using Windows 10 and the HDD is NTFS – Vasilis Sep 21 '18 at 17:07
  • @Biswapriyo USB – Vasilis Sep 21 '18 at 23:51
17

So I found the problem, I had to unmount it first and the mount it again:

sudo umount /mnt/d
sudo mount -t drvfs D: /mnt/d

This happened because it wasn't the first time I had connected this USB drive. The first time WSL (Windows Linux Subsystem) recognized and mounted the device automatically. But then I unplugged it without "Safe Remove" and without unmounting it through the command line. So, next time I re-connected the disk D: appears to be mounted in /mnt/d but not properly.

1
  • How can we make this permenant ? I'm trying to call a shell script directly from explorer or through another app. Mounting the share as the first line of the script wouldn't even do anything because WSL doesn't even see the file – hmedia1 Oct 1 '20 at 14:54
0

In my case, this was my first time trying to access the external drive on WSL. The solution that worked for me is from this SO post which I post below:

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

Notice I did not have to unmount it as WSL did not mount the unit when I connected it for the first time. To safetely unmount the unit:

$ sudo umount /mnt/d

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.