0

The command mkdir creates a file rather than a directory on a mounted network drive on a windows 10 system operating under the Windows sub-system for linux, using the Ubuntu app.

After installing the ubuntu app and putting the windows machine into developer mode I successfully mounted a remote network drive using the command:

sudo mount -t drvfs '\networkdrive\sharename' /mnt/U

which successfully mounts the network drive at the mount point. I can see the files on the remote drive. However when looking at a directory on the remote machine and issuing the command

mkdir Source

a file called Source is created on the remote drive rather than a directory.

I tried this on two completely different laptops running windows 10, which I set up in exactly the same way and the same problem happens. The windows 10 machines are in developer mode and running the latest version of the ubuntu app. This is a pretty fundamental thing to have go wrong so I'm guessing it's a bug of some sort, or some flag that I haven't set somewhere.

The snippet below is the terminal output which illustrates the problem.

username@~$ pwd
/home/username
username@~$ sudo mount -t drvfs '\\networkdrive.host\sharename\' /mnt/U
[sudo] password for username:
username@~$ cd /mnt/U/People/username/projects/Vesiform
username@Vesiform$ ls -al
total 0
drwxrwxrwx 0 root root 512 Mar 29  2018 .
drwxrwxrwx 0 root root 512 Mar 28 12:04 ..
drwxrwxrwx 0 root root 512 Mar 28 11:12 Builder
drwxrwxrwx 0 root root 512 Mar 28 11:42 Library
drwxrwxrwx 0 root root 512 Mar 28 11:42 NPack
drwxrwxrwx 0 root root 512 Mar 28 11:42 PDBProc
drwxrwxrwx 0 root root 512 Mar 28 11:55 Projects
drwxrwxrwx 0 root root 512 Mar 28 11:55 SpacePack
drwxrwxrwx 0 root root 512 Mar 28 11:55 Utilities
username@Vesiform$ mkdir Source
username@Vesiform$ ls -al
total 0
drwxrwxrwx 0 root root 512 Mar 29  2018 .
drwxrwxrwx 0 root root 512 Mar 28 12:04 ..
drwxrwxrwx 0 root root 512 Mar 28 11:12 Builder
drwxrwxrwx 0 root root 512 Mar 28 11:42 Library
drwxrwxrwx 0 root root 512 Mar 28 11:42 NPack
drwxrwxrwx 0 root root 512 Mar 28 11:42 PDBProc
drwxrwxrwx 0 root root 512 Mar 28 11:55 Projects
-rwxrwxrwx 1 root root   0 Mar 29  2018 Source
drwxrwxrwx 0 root root 512 Mar 28 11:55 SpacePack
drwxrwxrwx 0 root root 512 Mar 28 11:55 Utilities
username@Vesiform$ cd Source
-bash: cd: Source: Not a directory
username@Vesiform$
6
  • Why are you using the Beta version of WSL, the current versions, has many advantages. I suspect upgrading to 1709 will be required. The fact you enable Developer Mode indicates your using the legacy version of WSL, the current version of WSL, does not require developer mode to be enabled and the current version of the Ubuntu WSL is installed from the Windows Store. The legacy Ubuntu WSL cannot be updated to the current version
    – Ramhound
    Mar 30 '18 at 1:47
  • I was unable to reproduce the mkdir behavior you describe on the current version of WSL on 1709 or 1803
    – Ramhound
    Mar 30 '18 at 1:51
  • @ramhound Thanks for checking it out. My windows ver is 16299.309. I think substantial changes to WSL are in ver 17903. I installed ubuntu from the windows app store so it's the latest version asfaik: 16.04.3. I joined the windows insider program on the slow ring to get a more recent version of windows. Hopefully that will fix the issue. I'll check back in after updating. Is there a way to update just WSL to the current version? That's probably all I need here. I switched off developer mode and it all still seems to work. I'd followed old instructions without knowing better. Thanks. Mar 31 '18 at 20:53
  • I should have said i'm using windows version 1709 and build 16299.309. Mar 31 '18 at 21:03
  • “I think substantial changes to WSL are in ver 17903” - Nope; I am not aware of any major WSL changes in 1803 Insider Preview builds. If you installed it from the Windows Store then your using the current version.
    – Ramhound
    Mar 31 '18 at 21:53

Your Answer

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

Browse other questions tagged or ask your own question.