How to map a network drive?

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.


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/