How to map a network drive?

624,340

Solution 1

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.

Solution 2

  • 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

Solution 3

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/

Solution 4

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.

Solution 5

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

Share:
624,340

Related videos on Youtube

karthick87
Author by

karthick87

Updated on September 18, 2022

Comments

  • karthick87
    karthick87 over 1 year

    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.

  • Oli
    Oli almost 13 years
    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.
  • nilsonneto
    nilsonneto almost 13 years
    @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/…
  • AlikElzin-kilaka
    AlikElzin-kilaka almost 9 years
    The following did the trick: mount -t cifs -o 'username=domain\uname' '\\machine\folder' /mnt/folder. Worked on Redhat as well.
  • nutty about natty
    nutty about natty over 7 years
    @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...)
  • eigenjohnson
    eigenjohnson about 7 years
    This way works on Ubuntu 16.04 - the other way has stopped working for me since I upgraded
  • houss
    houss about 7 years
    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
  • Ray
    Ray over 6 years
    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 .
  • Keith M
    Keith M over 6 years
    .gvfs folder is empty for me, even after connecting with the file browser...
  • Krista K
    Krista K over 6 years
    @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.
  • Shayan
    Shayan over 4 years
    smbclient -U <username> -L //IP_Address is required in case it reports a wrong username on authentication.
  • Shayan
    Shayan over 4 years
    @fossfreedom cifs is outdated as I've read on here: Any way to use smb2 or smb3?
  • Shayan
    Shayan over 4 years
    unix.stackexchange.com/questions/34742/…? sounds like that article is wrong.
  • Soren A
    Soren A over 4 years
    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.
  • NeStack
    NeStack over 4 years
    @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
  • PatS
    PatS over 3 years
    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).
  • L.A. Rabida
    L.A. Rabida over 2 years
    This works great when Samba does not work due to a version mismatch