Cannot mount remote drive. I get the error: mount.cifs: bad UNC (/servername//data.xxx.xxx.ac.uk/)

43,700

Solution 1

UNC syntax is //server/share, not /server//share/. Note double slash before the server name, one slash between the server name and the share name.

Solution 2

You have to use double slash for mounting command. Like this

sudo mount -t cifs //xxx.xxx.xxx.xxx/Folder_1/ /media/usb/ -o user=admin
Share:
43,700

Related videos on Youtube

Ahmet Ozturk
Author by

Ahmet Ozturk

Updated on September 18, 2022

Comments

  • Ahmet Ozturk
    Ahmet Ozturk almost 2 years

    I am trying to access a remote drive from my PC using fstab but I get an error:

    $ sudo mount -a
    mount.cifs: bad UNC (/servername//data.xxx.xxx.ac.uk/)
    

    This is how my fstab looks:

    /servername//data.xxx.xxx.ac.uk/ /media/windowsshare cifs iud=myuserid,password=mypassword,iocharset=utf8,sec=ntlm  0  0
    

    How can I fix it?

  • Ahmet Ozturk
    Ahmet Ozturk over 7 years
    Instead of that error, I now get this. "mount error: could not resolve address for servername: Unknown error
  • AlexP
    AlexP over 7 years
    You should of course use the actual name of the server and not "servername". Before trying sudo mount -a check that the name is resolvable, using for example host servername (of couse, with the actual name instead of "servername").
  • Hubro
    Hubro over 5 years
    Another note, I've always used \\server\share (backslash rather than forward slash) and it has always worked when just using fstab and mount, but it doesn't work when systemd tried to perform the mount. It throws the error "Invalid UNC path: \server\share".