Select Page

How to mount network share in Ubuntu

by | 1 December 2014 | Linux | 0 comments

I bought a new NAS server (Synology DS415+). Very small and silent NAS. I configured it without any problems. Every workstation with Widows had access to network shares. But I had a problem when I wanted to get access from my Ubuntu.

 

Of course I did it when I tried several times via Places -> Connect to a server but I had some errors while configuring the new connection and I don’t understand how “Connect to a server” works with windows shares. I didn’t want to transfer files using NFS protocol because it has some disadvantages.

Finally I decided to mount the network share using this command:

sudo mount -t cifs //10.10.5.201/Folder -o username=username,password=mypassword /mnt/my_share/

and I see it’s working out pretty well. Without any problems.

So one after the other:

1. First make a directory the mount point:

sudo mkdir /mnt/my_share

 

2. Mount the network share:

sudo mount -t cifs //10.10.5.201/Folder -o username=fredek,password=mypassword /mnt/my_share/

3. Go to the directory:

cd /mnt/my_share; ls -l

 

Your network share is visible as normal directory in file system.

Let’s see our options:

  • -t smbfs : this is the file system type to be mount (smbfs is outdated, you should use cifs)
  • -t cifs : this is the file system type to be mount
  • -o : here we have options passed to mount command, in this example I used two options (username and password). First argument is password (fredek) and second argument is password (mypassword) to connect remote network share
  • //10.10.5.201/Folder : IP address of my server and share name (Folder in this case)
  • /mnt/my_share : Linux mount point (to access share after mounting)

 


I had the second problem connected with mounting network shares. I have a small computer with Ubuntu 12.04 and I treat it like a Media Center (Plex, Minidlna). I configured there a samba and I got an access from other computer but only via Places -> Connect to a server etc. But I wanted to get it by a normal folder. The method I described above didn’t work. So I found that there is mount.cifs app.

So first I installed it:

sudo apt-get install mount.cifs

Next I mounted network share:

sudo mount.cifs //192.168.1.99/public /mnt/MediaCenter

without any username and password.

Follow us

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *