ComTech: IT Support Stirling
TwitterFacebookGoogle

Mounting network shares in Linux

ComTech: IT Support Stirling

Today we are going to learn how to mount network shares using Linux.  There are two ways to do this, either manually or using the fstab file, and we shall cover both.  For this tutorial we will use the following:

Network share at 192.168.1.3/mnt/MyDisk1 which is mounted on a FreeNAS system (nfs)

Network share at 192.168.1.2/share which is on a Linux Mint 16 file server (samba)

Both shares will be accessed from a laptop running Linux Mint 16.


Manually

Lets take the FreeNAS nfs share first.  First thing to do is install the nfs package nfs-common.  Open up a terminal and type:

sudo apt-get install nfs-common

Enter your password when required.  Next thing type:

mount 192.168.1.3:/mnt/MyDisk1 /media/dev/MyDisk1

where:

192.168.1.3 is the ip address of the system where the share is mounted

/media/dev/MyDisk1 is the mount point where you want the share to be mounted

Now lets take a look at the Linux Mint 16 samba share.  Again we need to install the required samba packages so open up a terminal and type:

sudo apt-get install samba

Next type:

mount -t cifs //192.168.1.2/share /mnt -o username=user,password=pass

where:

user and pass are your login details

/mnt is the mount point on the local system

Using FStab

In a terminal type:

sudo nano /etc/fstab 

Add one of the following lines to the file depending on if you are using samba or nfs.

192.168.1.3:/mnt/MyDisk1 /media/dev/MyDisk1 nfs hard,intr 0 0 (NFS)

//192.168.1.2/share /media/dev2/Share cifs username=user,password=pass,user,rw,noatime 0 0 (SAMBA)

About the Author

P1020114

Hi I’m Chris Wakefield the owner of ComTech IT Support. I provide Windows, Mac and Linux based IT Support to small businesses in Stirling, Alloa and Falkirk.

Follow @Comtech247 on Twitter

 

 

8 thoughts on “Mounting network shares in Linux

  1. I simply wished to thank you so much yet again. I am not sure what I might have made to happen without the opinions documented by you regarding this area of interest. It absolutely was the traumatic dilemma for me personally, nevertheless encountering the very specialized manner you handled the issue took me to weep for joy. I’m grateful for the service and as well , sincerely hope you find out what a powerful job you have been providing training others through your site. I’m certain you’ve never met all of us.

  2. I don’t even know the way I finished up right here, but I assumed this put up was once good. I do not know who you’re but definitely you’re going to a famous blogger when you are not already ;) Cheers!

  3. Terrific work! That is the kind of info that are meant to be shared around the net. Shame on the search engines for no longer positioning this submit upper! Come on over and talk over with my website . Thank you =)

  4. We are a group of volunteers and starting a brand new scheme in our community. Your site offered us with helpful information to paintings on. You’ve done an impressive activity and our entire community will probably be grateful to you.

  5. Glad you like the tutorial. Personally I would use samba for sharing between Linux and Windows clients and NFS for Linux clients only. You can share files using samba between Linux clients but NFS is faster.

  6. I have been trying to mount my samba shares for weeks and it was driving me mad. Thank you for this article. As a side question is it better to have samba or nfs shares?

Leave a comment

Your email address will not be published.

CyberChimps
Follow

Get every new post delivered to your Inbox

Join other followers

WordPress SEO fine-tune by Meta SEO Pack from Poradnik Webmastera
WP Like Button Plugin by Free WordPress Templates