Mounting network shares in Linux

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 10 server (samba)

Both shares will be accessed from a Asus Eeepc 701 running Linux Mint 11.


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 10 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

Hi I am Chris Wakefield the owner of ComTech IT Support. I provide Windows and Linux based IT Support, laptop repairs and computer repairs to both business and personal clients in and around Stirling.

For a list of what I can offer you why not visit my website www.comtech247.net where you will find a list of my services, testimonials, blog and much more.

 

This entry was posted in Blog and tagged linux, mount, network, nfs, samba, shares. Bookmark the permalink.

8 comments on “Mounting network shares in Linux

  1. Super submit, I actually count on posts of your stuff.

  2. Could be difficult to find skilled persons about this topic, you sound like you know exactly what you are writing on! Thanks a lot

  3. 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.

  4. 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!

  5. 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 =)

  6. 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.

  7. 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.

  8. wotnot23 on said:

    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 Reply

Your email address will not be published.

50,728 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>