Time Capsule / Time Machine through Raspberry Pi

I’ve followed multiple tutorials on how to setup time capsule through raspberry pi. There’s one that’s by far the simplest & it works: https://www.raspberrypi.org/forums/viewtopic.php?f=36&t=47029

In fact, the others are so much more complicated that I thought this wouldn’t work and tried it last: What a mistake.

Here’s a short re-write with a few minor changes, also covering the formatting of the storage drive.

Format the Storage Drive

On the PI:

Run lsblk -o KNAME,TYPE,SIZE,MODEL in order to find your drive. Then run:

mkfs.ext4 /dev/sda

Replace sda with the corresponding drive.

In case you want a partitioned drive: Tutorial: http://askubuntu.com/questions/517354/terminal-method-of-formatting-storage-drive

Getting the required Packages

The communication between Mac and PI will go through netatalk:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install netatalk

Setting up

Find the device number using lsblk -o KNAME,TYPE,SIZE,MODEL as above, then:

sudo mkdir /mnt/TimeMachine
sudo chmod 777 /mnt/TimeMachine
sudo echo "/dev/sda<device number> /mnt/TimeMachine auto defaults 0 2" >> /etc/fstab
sudo mount /dev/sda<device number>

then

sudo echo "/mnt/TimeMachine \"Time Machine\" options:tm" >> /etc/netatalk/AppleVolumes.default
sudo service netatalk restart

Now restart the pi.

Select the Disk on the Mac

Now you’ll automatically discover the new Disk in the Time Machine Preferences. If you get permission errors, run sudo chmod 777 /mnt/TimeMachine again on the PI. I don’t know yet why, but this seems to get lost on reboot.

Note: If you get an error like

The backup disk image “/Volumes/backups-1/<your computer name>.sparsebundle” could not be created

it’s probably because you plugged out the drive from the running pi and then plugged it back in. Just restart the pi and it should work again. It also might be necessary to run the following command in the terminal first:

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

– the end –

One Reply to “Time Capsule / Time Machine through Raspberry Pi”

  1. Any way of making a partition of a hdd, one for time machine and other for data trough pi ? I have follow so many tutorials and none talks about this

Leave a Reply

Your email address will not be published.