Mounting AFP Shares To a Mac Over Local Network
If you want to connect your RPi to a file share on your Mac over a network, this tutorial may help. It took me a while to figure out as I am new to Linux. You there is a better way, please revise this wiki.
This tutorial is based on the following forum post [1]
Perquisites:
- On you Mac your file sharing is set up - Raspberry Pi is running on "wheezy".
1. Login as root:
pi@raspberrypi ~ $
2. Make a directory for your shared drive:
sudo mkdir myshare
3. In order to mount the share, you need some packages from afpfs-ng:
sudo apt-get install afpfs-ng
4. After it is installed, you need to find the location of your mac on the network.
System Preferences>Network>
On my network it is located at 192.168.1.14. Yours may be different
5. Find the name of your share on your mac
System Preferences>Sharing>
Find the folder you want to mount, or create. Note the name of the folder. You'll need it later. My is called "Mame"
6. Type the following in your RPi Terminal
cd myshare
7. The mounting instructions require the following arguments
sudo mount_afp afp://[username]:[password]@[ipAddressOfMac]/[sharename] [locationToMountTo]
username = you mac id
password = your mac password
sharename = is the shared folder from step 5
ipAddressOfMac = From Step 4
locationToMountTo = From step 6
Your command should look something like this when you type it into the terminal:
sudo mount_afp afp://yourMacName:yourMacPassword@192.168.1.14/Mame /home/pi/myshare
You should see this:
The afpfs daemon does not appear to be running for uid 0, let me start it for you
Mounting 192.168.1.14 from Mame on ./
Mounting of volume Mame of server Philly's iMac succeeded.
8. Type "mount" to you all your mounted shares
mount
Look for your share. There is a lot if info return so you'll have to search for it. Should look something like this:
Philly's iMac:Mame on /home/pi/myshare
9. Ok, the tricky part. Its mounted, but for some reason permissions are denied. Back out of the directory.
cd ..
cd /home/pi/myshare
You get:
-bash: cd: /home/pi/myshare: Permission denied
So try su
su
You get:
su: Authentication failure
Hmmm whats the issue? I read there is a bug somewhere and to fix this. I found this post in the form which was a big help [2] type:
sudo gconftool-2 --type bool --set /apps/gksu/sudo-mode true
10. Also, changes the permissions on myshare:
sudo chmod 777 myshare
11. Login in as a the superuser
sudo su
12. Your prompt will change:
root@raspberrypi:/home/pi/myshare#
cd myshare
Thats it! Good Luck