Difference between revisions of "Accessing Network Shares"

From SingletonMillerWiki
Jump to: navigation, search
(Problem)
(Problem)
Line 78: Line 78:
 
</pre>
 
</pre>
  
To run <code>rpcbind </code> at startup.
+
The preferred methid is to run <code>rpcbind </code> at startup.
  
 
<pre>
 
<pre>

Revision as of 02:54, 27 May 2013

Network shares some in two main forms. NFS[en.wikipedia.org/wiki/Network_File_System] and CIFS[www.samba.org/cifs/].

AutoFS

AutoFS is a simple means of mounting an external network share automatically when its required.

This method means that hard mounting in the fstab can be avoided such that if a share is not availalble at boot no errors are thrown.

Installing autoFS

sudo apt-get install autofs

Configure autoFS

Installation will create a configuration file /etc/auto.master. Edit this file and add a link to a seperate file.

sudo nano /etc/auto.master

add the following at the end of the file.

/media/nfsshares /etc/auto.<fileservername> --ghost

where <fileservername> is then name of your fileshare server. make sure there's a return at the end of the line.

Create /etc/auto.<fileservername>

sudo nano /etc/auto.<fileservername>

add the local share folder name and the remote server address and location in the form

<localfolder> <server address>:/<server folder>

if you have numerous shares in the same tree, you can add something like this * 192.168.0.8:/myshareroot/&

Test autoFS

first we need to restart the service

sudo service autofs restart

You should see

Stopping automount: done.
Starting automount: done.

Navigate to the local share location, for example cd /media/nfsshares/music

List the contents of the directory to check its mounted, a brief delay as the folder is mounted may be expected depending on you network configuration.

cd /media/nfsshares/music
ls

You should see a list of all the remote files.

If you get errors like 'directory not found', check your auto.master config.

Raspbian / Raspbmc

Problem

After installation and setup autofs doesn't work and access to an NFS directory results in

No such file or directory

this can be fixed by starting rpcbind . To start rpcbind manually.

sudo service rpcbind start
[sudo] password for jack: 
[ ok ] Starting rpcbind daemon....

The preferred methid is to run rpcbind at startup.

sudo update-rc.d rpcbind defaults
sudo update-rc.d rpcbind enable

Re-boot the RPi and test.