User avatar
Thijxx
Posts: 86
Joined: Mon Oct 22, 2012 1:25 pm
Location: The Netherlands

File sharing with OSX

Tue Dec 25, 2012 3:01 pm

I never really enjoy Samba (who does?) and I do not have Windows machines but I do want easy file sharing with my Mac running OSX Lion. TimeMachine setup is included. The distribution I used this for is Raspbmc, it should work fine on Raspbian but mind the /media directory notes later on.

Updated: 20-06-2013 (ddmmyyyy ofcourse..)
  • - Added Read/Write setting
-----------------------

Netatalk is the file server I use to connect my Mac.
More info: http://netatalk.sourceforge.net/

Installation:

Code: Select all

sudo apt-get update
sudo apt-get install netatalk
Configuration:

Code: Select all

sudo /etc/init.d/netatalk stop
sudo nano /etc/netatalk/AppleVolumes.default
Now go all the way down (ctrl-v) and you see:

Code: Select all

~/ "Home Directory"
That's where you can add an extra path. ~/ is the home directory of the current user, I've added /media to to share all my plugged in USB drives (Raspbmc only). You should add /mnt in stead of /media if you use Raspbian.
Then it looks like this:

Code: Select all

~/ "Home Directory"
/media "Media"
/mnt "Mount"
Read/Write: Add this to the line starting with :DEFAULT:

Code: Select all

rw
TimeMachine (thanks sonvivant!): Add the 'tm' to this line as shown here:

Code: Select all

:DEFAULT: options:upriv,usedots,tm
.

Start Netatalk again with: sudo /etc/init.d/netatalk start
Make sure the user you login with from your Mac has access tot the folder you are sharing on your Pi. Start with just the default Home Directory and take it from there.

The Pi will show up in Finder on your Mac, it usually takes 10 seconds for my Pi to show up after I restart Netatalk.
When you see it in Finder, select it in the Navigation Pane and use the button "Connect As.."
If it doesn't show up, feel free to use the Connect to Server function in finder and use the IP of the Pi. (hihi, funny, the ip of the pi).

You need to use the credentials of an existing user on your Pi. I've used the default user Pi and that's working fine.

That's all folks!

ps. For 'Raspberry to Raspberry' file sharing I use NFS and that's working great.
Last edited by Thijxx on Thu Jun 20, 2013 7:38 am, edited 3 times in total.
Mimi: Where'd you come from?
Doyle: My mom and the authorities are still trying to figure that out.

adream
Posts: 23
Joined: Fri Jul 06, 2012 4:15 pm
Contact: Website

Re: File sharing with OSX

Mon Dec 31, 2012 2:46 am

great, thanks for this simple walkthrough much appreciated
Last edited by ShiftPlusOne on Sun Jan 06, 2013 10:33 am, edited 1 time in total.
Reason: Edited out inappropriate URL.
http://212.159.76.122:81/serendipity/

burakpi
Posts: 6
Joined: Tue Jan 22, 2013 5:41 pm

Re: File sharing with OSX

Fri Feb 01, 2013 4:42 pm

Great tutorial. But I have a question:

I cannot write to my /media/MEDIA usb disk connected to Raspberry from my Mac. Is it about file systems? USB is FAT32.

User avatar
Thijxx
Posts: 86
Joined: Mon Oct 22, 2012 1:25 pm
Location: The Netherlands

Re: File sharing with OSX

Sun Feb 17, 2013 2:21 pm

burakpi wrote:Great tutorial. But I have a question:

I cannot write to my /media/MEDIA usb disk connected to Raspberry from my Mac. Is it about file systems? USB is FAT32.
Hi BurakPi, I might be a 'rights' issue but I always format my drives EXT4 so I cannot recreate your problem.. Try making a single (unimportant) folder completely writeable by anyone using chmod and then try to write to that folder.
Mimi: Where'd you come from?
Doyle: My mom and the authorities are still trying to figure that out.

cudmore
Posts: 3
Joined: Sun Mar 03, 2013 1:14 am

Re: File sharing with OSX

Sun Mar 03, 2013 1:18 am

Thank you so much. Just followed your instructions and now my pi is running afp, I can mount it from my osx machine.

As you say, next step is setting up a time machine backup with the pi as the server. Any pointers?

User avatar
Thijxx
Posts: 86
Joined: Mon Oct 22, 2012 1:25 pm
Location: The Netherlands

Re: File sharing with OSX

Sun Mar 03, 2013 4:32 pm

cudmore wrote:Thank you so much. Just followed your instructions and now my pi is running afp, I can mount it from my osx machine.

As you say, next step is setting up a time machine backup with the pi as the server. Any pointers?
No specific pointers, didn't got to it myself just yet..

This looks like a nice & clean tutorial, this is what I will follow when I get to it: http://blog.stevenlu.com/2012/05/10/tim ... ianubuntu/
Mimi: Where'd you come from?
Doyle: My mom and the authorities are still trying to figure that out.

sonvivant
Posts: 1
Joined: Sun Mar 10, 2013 2:02 am

Re: File sharing with OSX

Sun Mar 10, 2013 2:14 am

It looks like netatalk has native Time Machine support. When I edited AppleVolumes.default I read through the file and there is an option to enable it on drives. I changed the default options line near the bottom of AppleVolumes.default to this:

Code: Select all

:DEFAULT: options:upriv,usedots,tm
Thanks, Thijxx, for the tutorial. I am now sharing files across my home network and have Time Machine access. Unfortunately the HDD that I want to use for TM is only showing about 13GB of storage when there should be almost 2TB available but I think that is a problem with some other service which I will try to figure out another time!

MSDOS4
Posts: 6
Joined: Tue Apr 09, 2013 9:46 pm

Re: File sharing with OSX

Tue Apr 09, 2013 10:19 pm

Thanks for the tutorial! It works just fine except for one problem.

I have a 1TB usb hdd mounted on my pi and I can read/write, but mac's finder reports only 5~ GB available, which is what is left of my Raspi's sd card. I cannot write large files to the hdd or do large batches because of this. Finder will tell me there "isn't enough disk space". Do you know of any ways to fix this?

Zwerge
Posts: 1
Joined: Sun Apr 28, 2013 11:35 am

Re: File sharing with OSX

Sun Apr 28, 2013 11:37 am

I have exactly same problem, fails to recognize my external HD volume and instead sees SD card volume...

User avatar
Thijxx
Posts: 86
Joined: Mon Oct 22, 2012 1:25 pm
Location: The Netherlands

Re: File sharing with OSX

Thu May 09, 2013 8:15 am

sonvivant wrote:It looks like netatalk has native Time Machine support. When I edited AppleVolumes.default I read through the file and there is an option to enable it on drives. I changed the default options line near the bottom of AppleVolumes.default to this:

Code: Select all

:DEFAULT: options:upriv,usedots,tm
Thanks, Thijxx, for the tutorial. I am now sharing files across my home network and have Time Machine access. Unfortunately the HDD that I want to use for TM is only showing about 13GB of storage when there should be almost 2TB available but I think that is a problem with some other service which I will try to figure out another time!
Great stuff! I'll build a TimeMachine myself!

Your HDD problem must have something to do with the format, is it EXT4?
Mimi: Where'd you come from?
Doyle: My mom and the authorities are still trying to figure that out.

User avatar
Thijxx
Posts: 86
Joined: Mon Oct 22, 2012 1:25 pm
Location: The Netherlands

Re: File sharing with OSX

Thu May 09, 2013 8:18 am

MSDOS4 wrote:Thanks for the tutorial! It works just fine except for one problem.

I have a 1TB usb hdd mounted on my pi and I can read/write, but mac's finder reports only 5~ GB available, which is what is left of my Raspi's sd card. I cannot write large files to the hdd or do large batches because of this. Finder will tell me there "isn't enough disk space". Do you know of any ways to fix this?
Hi MSDOS4,

Did you share a directory on your external drive? If the Pi shows to right amount of free space "df -h" then your Max should as well.
If not, there must be something wrong with the format of the HDD, is it EXT4?

And how do you see the free space in Finder? I can't get my Mac to do that when it comes to network shares.
Mimi: Where'd you come from?
Doyle: My mom and the authorities are still trying to figure that out.

MSDOS4
Posts: 6
Joined: Tue Apr 09, 2013 9:46 pm

Re: File sharing with OSX

Thu May 09, 2013 8:45 pm

Thijxx wrote: Hi MSDOS4,

Did you share a directory on your external drive? If the Pi shows to right amount of free space "df -h" then your Max should as well.
If not, there must be something wrong with the format of the HDD, is it EXT4?

And how do you see the free space in Finder? I can't get my Mac to do that when it comes to network shares.
Hello,

Yes, the drive is EXT4.
I made the mistake of sharing only "/media" I fixed the problem by adding my drive's name to that. Now it shows the full amount.

--

Finder should always show free disk space at the bottom of a window, are you sure don't have the window in extended mode?

Image

You can see finder reporting the true free space over the network now that it's been fixed, try clicking that grey button in the corner. If that is not it, then I have no idea! :(

User avatar
Thijxx
Posts: 86
Joined: Mon Oct 22, 2012 1:25 pm
Location: The Netherlands

Re: File sharing with OSX

Thu May 09, 2013 9:17 pm

MSDOS4 wrote:
Thijxx wrote: Hi MSDOS4,

Did you share a directory on your external drive? If the Pi shows to right amount of free space "df -h" then your Max should as well.
If not, there must be something wrong with the format of the HDD, is it EXT4?

And how do you see the free space in Finder? I can't get my Mac to do that when it comes to network shares.
Hello,

Yes, the drive is EXT4.
I made the mistake of sharing only "/media" I fixed the problem by adding my drive's name to that. Now it shows the full amount.

--

Finder should always show free disk space at the bottom of a window, are you sure don't have the window in extended mode?

IMG deleted

You can see finder reporting the true free space over the network now that it's been fixed, try clicking that grey button in the corner. If that is not it, then I have no idea! :(
Great that you solved it!

I had the Status Bar turned off so I didn't see the free space :mrgreen: thanks for the screenshot
Mimi: Where'd you come from?
Doyle: My mom and the authorities are still trying to figure that out.

oberlointment
Posts: 5
Joined: Tue Jun 18, 2013 5:12 pm

Re: File sharing with OSX

Tue Jun 18, 2013 5:17 pm

Hi I hope that this post is still open. I have followed the steps given above and all went well. I can access my Pi and see my attached usb drives. The only issue is that I can not write to the usb drives, I can how ever write to the Pi home drive.

This is obviously a permissions issue can you give me some advice on how to rectify it.

I am running a 250gb seagate drive formatted as osx journaled, and a 16gb usb flash drive formatted at exfat.

MSDOS4
Posts: 6
Joined: Tue Apr 09, 2013 9:46 pm

Re: File sharing with OSX

Tue Jun 18, 2013 5:49 pm

Hello,

I'm not totally sure, but I think you need the partition un-journaled to be able to write.

http://forum.xbmc.org/showthread.php?tid=51626

Here's how to disable journaling:
On your Mac:

Open Disk Utility under Applications -> Utilities
Select the volume to disable journaling on.
Choose Disable Journaling from the File menu. (On later Mac OS versions you'll have to hold down the option button when you click the File menu.

oberlointment
Posts: 5
Joined: Tue Jun 18, 2013 5:12 pm

Re: File sharing with OSX

Tue Jun 18, 2013 6:08 pm

MSDOS4 wrote:Hello,

I'm not totally sure, but I think you need the partition un-journaled to be able to write.

http://forum.xbmc.org/showthread.php?tid=51626

Here's how to disable journaling:
On your Mac:

Open Disk Utility under Applications -> Utilities
Select the volume to disable journaling on.
Choose Disable Journaling from the File menu. (On later Mac OS versions you'll have to hold down the option button when you click the File menu.
Hi Thanks so much for your quick reply. I disabled journaling but sadly I still can not write to the drive. I formatted the smaller 16gb flash drive to fat32 but could not write to this either. Any more ideas would be appreciated.

MSDOS4
Posts: 6
Joined: Tue Apr 09, 2013 9:46 pm

Re: File sharing with OSX

Tue Jun 18, 2013 6:36 pm

Hmm... I hear you're not supposed to do this, but you might try:

Code: Select all

sudo chmod -R 777 /media/DriveNameHere

oberlointment
Posts: 5
Joined: Tue Jun 18, 2013 5:12 pm

Re: File sharing with OSX

Wed Jun 19, 2013 12:05 am

thank you very much that worked great! It is not showing the right file size tho, shows that I have 2gb free when I know I have 50gb any ideas?

MSDOS4
Posts: 6
Joined: Tue Apr 09, 2013 9:46 pm

Re: File sharing with OSX

Wed Jun 19, 2013 12:27 am

Right, I had that issue too.

Do these commands:

Code: Select all

sudo /etc/init.d/netatalk stop
sudo nano /etc/netatalk/AppleVolumes.default
In the document, scroll all the way down where you tell Netatalk the directory. I assume you just have it set to just "/media". You need to add the name of the drive as well, for example my external HDD is named CJ, so it looks like this:

Image

I think that's all you need to do, just save the document and

Code: Select all

sudo /etc/init.d/netatalk start

oberlointment
Posts: 5
Joined: Tue Jun 18, 2013 5:12 pm

Re: File sharing with OSX

Wed Jun 19, 2013 8:12 pm

thanks for your reply, I do have just
/media

so I added my external HDD so it looks like this

/media/matman_backup

but now all I get is a folder called matman_backup with nothing inside. So it would seem that it is no longer mounting the drive, could it have something to do with the name of my HDD drive?

MSDOS4
Posts: 6
Joined: Tue Apr 09, 2013 9:46 pm

Re: File sharing with OSX

Wed Jun 19, 2013 8:31 pm

Strange, I think it might be the "_". Also, maybe keep the name no more than 8 characters long.

Don't forget to update fstab and AppleVolumes.default respectively!

User avatar
Thijxx
Posts: 86
Joined: Mon Oct 22, 2012 1:25 pm
Location: The Netherlands

Re: File sharing with OSX

Thu Jun 20, 2013 7:34 am

oberlointment wrote:thanks for your reply, I do have just
/media

so I added my external HDD so it looks like this

/media/matman_backup

but now all I get is a folder called matman_backup with nothing inside. So it would seem that it is no longer mounting the drive, could it have something to do with the name of my HDD drive?
Hi oberlointment,

To re-mount everything type

Code: Select all

sudo mount -a
To enable writing, don't forget to add

Code: Select all

,rw
at the end of the line starting with

Code: Select all

:DEFAULT:
You can use long names for the shares but you need to use quotes just like the "Home Directory".

Cheers, Thijs
Mimi: Where'd you come from?
Doyle: My mom and the authorities are still trying to figure that out.

danb35
Posts: 27
Joined: Thu Feb 07, 2013 6:00 pm

Re: File sharing with OSX

Thu Jun 20, 2013 10:45 am

oberlointment wrote:so I added my external HDD so it looks like this

/media/matman_backup
How did you do that? If you only changed AppleVolumes.default, that won't do it. What are the contents of /etc/fstab? What's the output of running "mount"? And do you in fact have a subdirectory in /media/ called matman_backup?

oberlointment
Posts: 5
Joined: Tue Jun 18, 2013 5:12 pm

Re: File sharing with OSX

Thu Jun 20, 2013 6:44 pm

the contents of applevolumes.default is
# The line below sets some DEFAULT, starting with Netatalk 2.1.
:DEFAULT: options:upriv,usedots,tm,rw

# By default all users have access to their home directories.
~/ "Home Directory"
/media/matman "matman"
/mnt "mount"
# End of File

and

here is the output of running mount

/dev/mmcblk0p2 on / type ext4 (rw,noatime)
proc on /proc type proc (rw)
devpts on /dev/pts type devpts (rw,noexec,nosuid,relatime,gid=5,mode=620)
/dev/mmcblk0p1 on /boot type vfat (rw,noatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
/dev/sda1 on /media/ matman type hfsplus (rw,nosuid,nodev,uhelper=udisks)


I am doing something wrong but can not work out what. you help greatly appreciated.

BroxZaphod
Posts: 2
Joined: Sun Oct 13, 2013 11:18 am

Re: File sharing with OSX

Sun Oct 13, 2013 11:26 am

Thank you sir,

just what i needed! :D

Return to “Networking and servers”

Who is online

Users browsing this forum: asavah and 18 guests