trewok
Posts: 2
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: 63
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: 1153
Joined: Thu May 05, 2016 9:33 am

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: 2
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: 1153
Joined: Thu May 05, 2016 9:33 am

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

Return to “Networking and servers”

Who is online

Users browsing this forum: No registered users and 17 guests