ComTech: IT Support Stirling
TwitterFacebookGoogle

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

 

 

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