61

I am unable to map a Windows network drive in Ubuntu. I executed the following command in the terminal:

karthick@karthick:~$ sudo mount -t cifs -o username=raghu //172.29.32.184 /media/Data/
Password: 
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

But it returned an error. I hope someone can sort this out.

2

6 Answers 6

101

I think you need to also pass the windows share name as well as confirm that you've created /media/Data

sudo mkdir /media/Data

Use something like

smbclient -L //172.29.32.184 

to list the shares, then append the share name to your mount

sudo mount -t cifs -o username=raghu //172.29.32.184/sharename /media/Data/
  • Note- If you receive the error: wrong fs type, bad option, bad superblock on... make sure you have cifs-utils installed, it may not be installed on your distro by default.

    sudo apt-get install cifs-utils

If you need to mount your windows share permanently then there is an excellent HowTo by dmizer UbuntuForums Staff (scroll to the permanent mount section)- I wont reproduce the advice here because its got some excellent debugging hints and tips and other workarounds that you may encounter.

8
  • 3
    Spot on. In order to map a share (even using Windows as the client) you have to point directly at a share. You can't mount the entire computer and you can't [directly] mount a subdirectory of the share.
    – Oli
    May 31, 2011 at 9:55
  • I have followed your instruction, but i am getting the following error.mount error(11): Resource temporarily unavailable Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
    – karthick87
    May 31, 2011 at 23:25
  • @karthick87 - thats a new one on me - maybe worth posting that one on that active forum thread. The only google search on this error that I found that vaguely might be related is this one: linuxquestions.org/questions/linux-server-73/…
    – fossfreedom
    Jun 1, 2011 at 20:23
  • 2
    The following did the trick: mount -t cifs -o 'username=domain\uname' '\\machine\folder' /mnt/folder. Worked on Redhat as well. Jul 2, 2015 at 7:32
  • 1
    unix.stackexchange.com/questions/34742/…? sounds like that article is wrong.
    – Shayan
    Aug 28, 2019 at 23:20
33
  • open a Nautilus window
  • click Go in the menu, or alternatively press Ctrl+L
  • enter smb://remote_host/share_name
  • Go to Bookmarks and click add
5
  • 10
    @DavidCole-GrammarPolice I'd disagree: as long as this answer is offering a different solution, it does have value and use. (didn't check the meta for an official take on these issues...) Sep 1, 2016 at 16:27
  • This way works on Ubuntu 16.04 - the other way has stopped working for me since I upgraded Mar 6, 2017 at 18:15
  • I think this way will work as long as you are using Nautilus. I am not sure if it works when you use another Gnome file manager
    – houss
    Mar 7, 2017 at 22:37
  • Thank you for posting an alternative that's more user-friendly and doesn't require sudo for normal users! I can confirm that the above works for Kubuntu's Dolphin on Ubuntu 17.04 .
    – Ray
    Oct 4, 2017 at 2:26
  • 1
    This solution did not have the smb mounted share name appear in my file system. I did however help me get past copying files back and forth so it did help me. The other solutions are giving me permission denied errors (I'm trying to track that down).
    – PatS
    Feb 1, 2021 at 5:15
2

I use @fossfreedom's answer in one line command use this :

echo '<your su pasword>' | sudo -S mkdir /mnt/sharedfolder/ | sudo -S mount -t cifs -w -o username=nabed -o password=nabed //192.168.0.58/sharedfolder /mnt/sharedfolder/
2

Download VisiPics and install it with Wine.

Mount the shared folder if it exists:

sudo -S mkdir /mnt/sharedfolder/ 
sudo -S mount -t cifs -w -o username=nabed -o password=nabed //192.168.0.58/sharedfolder /mnt/sharedfolder/

Then go to VisiPics and open Z: drive and folder /mnt. Inside you will find the network data.

Geeqie does great job too and has an Ubuntu version.

1

As of 2020 this is what works for me on Ubuntu 18.04:

  • open the Nautilus file manager
  • press Ctrl+l to write into the address bar
  • insert sftp://your_user_name@target_ip_address where target_ip_address should have the form 102.69.35.384 , then just press Enter to confirm

Now you will be asked for the log-in user name and password. That's it, you should now have a graphical connection in Nautilus to the drive

3
  • 3
    That will work, but technically it's not mounting a share. You mount a share by it's name, without knowing the path to it's location on disk. Your solution mounts a users homedir and emulates a filesystem via sftp protocol.
    – Soren A
    Jan 17, 2020 at 11:54
  • @SorenA I guess you are right, I am a newbie and not really aware of the terminology. What is then my suggestion doing - "mapping" a drive? Where is the difference in use to "mounting"? Thanks
    – NeStack
    Jan 17, 2020 at 12:48
  • This works great when Samba does not work due to a version mismatch Jan 27, 2022 at 9:27
0

Another way is to use the file browser to connect to a network location. Then it is mounted under ~/.gvfs

From there, you can mkdir ~/winbox and then ln -s ~/.gvfs/blahblahblah ~/winbox.

I recall there being some permanence to this, but I forget the details. :P I was developing php/odbc app for Quickbooks which needs to be run on the Quickbooks computer.

Edit for 2018 and beyond: After 14.04, ubuntu seems to no longer use .gvfs, so the above might not work for you. Some folks got really mad that something changed and my old answer didn't work.

Check out this comment: ~/.gvfs moved to /run/user/[UID]/gvfs/blahblah. After using Nautilus to make a location using sftp://host:port, the remote server's file system showed up there.

2
  • .gvfs folder is empty for me, even after connecting with the file browser...
    – Keith M
    Dec 12, 2017 at 23:42
  • 1
    @KeithM it sounds like your situation is different than Ubuntu/Gnome from 3 years ago. You should start a new question with your setup asking for advice and also link to this question saying you tried the things here.
    – Krista K
    Dec 13, 2017 at 15:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .