Mount a Remote Drive via NFS

From AwkwardTV
Revision as of 18:41, 27 April 2008 by TonyH (talk | contribs) ("/bin/pause" isn't present on my 1.1 -- I used "sleep 5" instead)
Jump to: navigation, search

Mounting NFS shares on APTV works "out of the box"

First you will want to make a mount point under /mnt for example:

sudo mkdir /mnt/remoteshare

After the AppleTv 1.1 upgrade you will need to copy /sbin/mount_nfs to your AppleTv and put it in /sbin/ otherwise if you are using AppleTv software version 1.0 skip this step

And also ATV v1.1 (not the safe update) seems to ignore /etc/rc.local

now mount the share using 'mount'

sudo mount_nfs ipaddress:/share /mnt/remoteshare/

You may have to add the insecure option to the export on the nfs server. e.g.:

/data/video appletv(rw,async,insecure)

You might want to try adding this to your rc.local file to make it happen every time you reboot. So:

sudo echo "mount_nfs  ipaddress:/share /mnt/remoteshare/">>/etc/rc.local

that adds the first line to the end of the rc.local file which is run everytime the system boots.

For some reason this doesn't always work and in some cases the rc.local file doesn't exist. A way around it is to use su. su is a rather dangerous command as it effectively allows you to log in as root so use it wisely!

Copy /usr/bin/su from your local OS X installation to the same location on the AppleTV.

Then issue these commands

sudo su -

touch /etc/rc.local

echo "mount_nfs  ipaddress:/share /mnt/remoteshare/">>/etc/rc.local

This will log you on as root, create the file (only if it doesn't exist), add the changes to it. You can then check the changes have been made by typing:

cat /etc/rc.local

and checking the last line in the file.

Once you're happy, issue this simple command to exit the root shell:


Note: if you don't have a local OS X machine, you can type

sudo bash

instead of

sudo su -

Note: Recently the automatical mounting stopped to work and I figured out, that a pause of 5 seconds before the mount command in /etc/rc.local helps.

sleep 5