trewok
Posts: 4
Joined: Thu Nov 23, 2017 5:23 pm

Time Machine not working Raspberry Pi

Thu Nov 23, 2017 5:38 pm

Hello everyone,

I decided recently to repurpose my RPi2 and use it as a Time Capsule/Backup drive for my mac. However I have been encountering problems as it seems like my mac cannot connect to the RPi.

What I did:
1) I flashed my Sd and installed Raspbian on it
2) I formatted an hard drive in HFS+ (I believe this is the same filesystem apple uses for their time capsules)
3) I set up my pi and connected it to my network by connecting it to my router via ethernet (I assigned a static Ip to my pi)
4) I installed hfsplus,hfs utils in order to mount the drive, I also edited fstab in order for it to mount upon booting
5) I compiled the latest version of netatalk and avahi and set them up following instructions that I found on a guide (the instructions seem to be pretty much the same across guides for this step)

After setting up I have tried several times to connect to my pi with no success. The device is visible on my finder shared devices bar, however whenever I click on it I get the following message:
'There was a problem connecting to the server my.ip.address.0.' 'There are no shares available or you are not allowed to access them on the server. Please contact your system administrator to resolve the problem'

I thought that this might have been caused by some permission conflict so I decided to give permissions on the drive. But the problem still persists.
I also read about the need to disable journaling so I also proceeded to do that, but yet no luck with getting it to work.

I have been found some mentions of Apple's to move from the afp protocol to smb3, but I am not sure whether it would be possible to have Time Machine work over smb, in case it is possible could somebody maybe point me in the right direction?

Thanks in advance you all!

ericcooper
Posts: 110
Joined: Sat Apr 08, 2017 6:23 pm

Re: Time Machine not working Raspberry Pi

Thu Nov 23, 2017 7:03 pm

Warning: I haven't tried any of this myself, since I don't use Macs.

This link suggests that you don't need to format the HD as HFS or HFS+; you can set up a native Linux filesystem like ext4 on your Pi, and then share it over the network with samba. Make sure your Mac can access that shared volume, and then the "sparse bundle" stuff puts the burden of dealing with HFS and Time Machine on the Mac itself once it's mounted.

epoch1970
Posts: 2020
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Time Machine not working Raspberry Pi

Thu Nov 23, 2017 9:39 pm

Raspbian has Netatalk 3.0 AFAIK, you don't need to compile your own. For sure you don't need to compile Avahi.
TimeMachine does work on the Pi. Except, it is extremely slow. Writes over the network on Pi will top at something like 4 MB/s (40mbps).
I know this because I did setup and test TM on a Pi3 running Raspbian Jessie. Since it is slow and I have better alternatives I don't use it regularly.

I don't know what "my.ip.address.0." really means but are you sure your configuration is correct?
Are you aware that contrary to Netatalk 2, Netatalk 3 has a "TimeMachine" share option and dynamically does its own mDNS advertisement, meaning you don't need any kind of static Avahi service file?

Since backup is slow, it is impractical to use TM and make a full backup over the network. A full backup contains 150k files at least (the Mac OS) at transferring that over the network takes days. If you want to reinstall a Mac from a TM image across the network, the install would also take days.
TM on Pi is ok for incremental backups (which happen every 15 min.), unless you're editing video files or something like that on the Mac.
Which means:
- Format your USB drive as HFS+, a format the Mac will natively support for the 1st backup and in case of bare metal recovery. Don't use a linux FS, the Mac doesn't know what an ext FS is.
- Connect the drive to the Mac and do a full backup
- Connect the drive to the Pi and restart Netatalk and check an incremental backup works
- Connect the drive to the Mac, reboot it to recovery mode and check you have the option to reinstall from the backup present on the drive.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

trewok
Posts: 4
Joined: Thu Nov 23, 2017 5:23 pm

Re: Time Machine not working Raspberry Pi

Fri Dec 01, 2017 1:33 pm

@ericcooper Thank you very much for your suggestion, I will take a look. The filesystem it's not too much of a problem for me, I am more concerned about the file sharing protocol

@epoch1970 I will try with a fresh install of Raspbian and check if netatalk and avahi are supported natively.
By "my.ip.address.0'' I simply meant my ip address. I think the configuration is correct as I have followed closely the instructions of several guides. What does not seem to work is netatalk. Even though the pi is visible to my mac, I have trouble accessing it as I keep receiving a message saying that the share is either unavailable or I cannot access it.

Regarding the incremental backups, that is definitely a more viable option. I am not sure why TM backups are so slow over the network.
Anyway, I will give it a try now with a fresh install, check whether I can connect successfully to the afp share and in case it doesn't work I will try and see if I find someway to setup TM via samba

epoch1970
Posts: 2020
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Time Machine not working Raspberry Pi

Fri Dec 01, 2017 6:52 pm

trewok wrote:
Fri Dec 01, 2017 1:33 pm
I am not sure why TM backups are so slow over the network.
Because on a Pi the HDD used to backup is behind a USB2 link (bad),
and that link is shared with networking (worse).
Backuping 30GB (at least) at 4MB/s is not a great idea, the longer the operation the higher the chance something will go wrong in the environment (computer goes to sleep, wifi resets...) before the operation completes.
4MB/s is slow... but that's about peak transfer speed for large files. With the +100k small files TM sends for a full backup, your average transfer speed is worse than that.

You'll get the same perf from SMB and AFP, the bottleneck is not in the network protocol, it's in the Pi's hardware. Netatalk 3 itself runs fine (Samba 4 I wouldn't know.)

Edit. Some previous posts of mine re: TM on Pi.
viewtopic.php?f=28&t=174241&p=1112917&h ... k#p1112917
viewtopic.php?f=91&t=176476&p=1126370&h ... k#p1126370
viewtopic.php?f=36&t=166134&p=1071078&h ... k#p1071078
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

trewok
Posts: 4
Joined: Thu Nov 23, 2017 5:23 pm

Re: Time Machine not working Raspberry Pi

Wed Dec 13, 2017 12:04 pm

Edit. Some previous posts of mine re: TM on Pi.
viewtopic.php?f=28&t=174241&p=1112917&h ... k#p1112917
viewtopic.php?f=91&t=176476&p=1126370&h ... k#p1126370
viewtopic.php?f=36&t=166134&p=1071078&h ... k#p1071078
Thanks for your reply. I have just tried to start all over again with a fresh install of Raspbian. However I have noticed that the new raspbian I have installed (2017-11-29) did not come with netatalk 3, and when I tried to install netatalk via apt-get I got netatalk 2.2. How did you manage to get a fresh version of netatalk 3? Every guide I look at says that it needs to be compiled for it to work on raspbian

epoch1970
Posts: 2020
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Time Machine not working Raspberry Pi

Wed Dec 13, 2017 8:59 pm

trewok wrote:
Wed Dec 13, 2017 12:04 pm
However I have noticed that the new raspbian I have installed (2017-11-29) did not come with netatalk 3, and when I tried to install netatalk via apt-get I got netatalk 2.2. How did you manage to get a fresh version of netatalk?
Wow. I'm shocked. I was sure I got it from testing or something like that. My apologies.
Way back to Q4 '2015, then: Then I wrote this foreword in a buildme script:

Code: Select all

This will prepare a debian 8.2 system (jessie) for compiling netatalk 3.1.7:
 - Remove:  libavahi-compat-libdnssd-dev
 - Install: build-essential libevent-dev libssl-dev libgcrypt11-dev
            libkrb5-dev libpam0g-dev libwrap0-dev libdb-dev libtdb-dev
            avahi-daemon libavahi-client-dev libacl1-dev libldap2-dev
            libcrack2-dev libdbus-1-dev libdbus-glib-1-dev libglib2.0-dev
After that, enter the netatalk-debian source dir (or whatever its name is)
and run 'debuild -b -uc -us'

This recipe worked as of dec 2015. Perhaps some libs need updates by now.
In this case, adjust the rules and control files in netatalk-debian/debian
and update this script too.

Hit any key to continue with the installs or hit ctrl-c to break now.
I think kernel headers are needed for compiling, at a point in time getting these for Raspbian was a pain but I think it is easier by now. I have a write-up on that stashed somewhere, too.

FYI, I also have this, obviously I still use those packages today on my Jessie installs:

Code: Select all

-rw-rw-rw- 1 1900 1900 211540 Dec 22  2015 libatalk16_3.1.7-1+local_armhf.deb
-rw-rw-rw- 1 1900 1900 265772 Dec 22  2015 libatalk-dev_3.1.7-1+local_armhf.deb
-rw-rw-rw- 1 1900 1900 286128 Dec 22  2015 netatalk_3.1.7-1+local_armhf.deb
HTH. Frankly I don't understand the prejudice against Netatalk.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

bradbomb
Posts: 3
Joined: Sat May 12, 2018 6:12 pm

Re: Time Machine not working Raspberry Pi

Sat May 12, 2018 6:15 pm

Has anyone figured out how to get the latest Samba installed and working. Every since I installed macOS 10.13.4 High Sierra released at the end of March, I cannot backup my laptop. My desktop that is still on an earlier version of High Sierra works. It seems Apple did depreciate AFP as a protocol for Time Machine

bradbomb
Posts: 3
Joined: Sat May 12, 2018 6:12 pm

Re: Time Machine not working Raspberry Pi

Sat May 12, 2018 8:16 pm

Has anybody figured out how to fix this for macOS 10.13.4. AFP volumes for Time Machine has been blocked now and I cannot backup to my Raspberry Pi that is currently using netatalk

epoch1970
Posts: 2020
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Time Machine not working Raspberry Pi

Sun May 13, 2018 4:23 pm

A quick googling returns this:
https://support.apple.com/en-us/HT207828 wrote:AFP can’t share files on Apple File System (APFS). Apple File System (APFS) is the default file system in macOS High Sierra for Mac computers with all-flash storage. You can't opt out of the transition to APFS when you upgrade a Mac with all-flash storage to macOS High Sierra. Learn more about APFS in macOS High Sierra....
or that: https://apple.stackexchange.com/questio ... upport-afp

Apple deprecates, users appreciate...
You'll need to get Samba working on the Pi, I'm afraid.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

bradbomb
Posts: 3
Joined: Sat May 12, 2018 6:12 pm

Re: Time Machine not working Raspberry Pi

Sun May 13, 2018 5:59 pm

That was my question. Has anybody got Samba to work this way. I have tried installing the latest version, but something is still messed up

Return to “Networking and servers”

Who is online

Users browsing this forum: No registered users and 9 guests