All Projects → mr-bt → Raspberrypi Timemachine

mr-bt / Raspberrypi Timemachine

Licence: mit
Apple Time Machine with raspberry Pi

Projects that are alternatives of or similar to Raspberrypi Timemachine

Chromium os Raspberry pi
Build your Chromium OS for Raspberry Pi 3B/3B+/4B and Pi400
Stars: ✭ 1,156 (+564.37%)
Mutual labels:  raspberry-pi, raspberry-pi-3
Iotpos
IotPOS, an open source Point of Sale software.
Stars: ✭ 99 (-43.1%)
Mutual labels:  raspberry-pi, raspberry-pi-3
Homekitcam
A project to make a Raspberry Pi driven, HomeKit Enabled camera.
Stars: ✭ 69 (-60.34%)
Mutual labels:  raspberry-pi, raspberry-pi-3
Raspberrypi tempmon
Raspberry pi CPU temperature monitor with many functions such as logging, GPIO output, graphing, email, alarm, notifications and stress testing. Python 3.
Stars: ✭ 52 (-70.11%)
Mutual labels:  raspberry-pi, raspberry-pi-3
Lib Python
Blynk IoT library for Python and Micropython
Stars: ✭ 140 (-19.54%)
Mutual labels:  raspberry-pi, raspberry-pi-3
Openvoiceos
OpenVoiceOS is a minimalistic linux OS bringing the open source voice assistant Mycroft A.I. to embbeded, low-spec headless and/or small (touch)screen devices.
Stars: ✭ 64 (-63.22%)
Mutual labels:  raspberry-pi, raspberry-pi-3
Stratuxhud
Heads Up Display for use with Stratux. Designed for reflective HUD screens, intended for traffic call outs.
Stars: ✭ 76 (-56.32%)
Mutual labels:  raspberry-pi, raspberry-pi-3
Fiscalberry
[JSON ↔ HW] Connect things using JSON API with the fiscalberry websocket server interact easily with any kind of Hardware. Another IoT solution...
Stars: ✭ 44 (-74.71%)
Mutual labels:  raspberry-pi, raspberry-pi-3
Sshdeploy
A command-line tool that enables quick build and run deployments over SSH.
Stars: ✭ 131 (-24.71%)
Mutual labels:  raspberry-pi, raspberry-pi-3
Rpi3
Raspberry Pi 3 UEFI Firmware Images
Stars: ✭ 117 (-32.76%)
Mutual labels:  raspberry-pi, raspberry-pi-3
Aasdk
Library to build AndroidAuto headunit emulator
Stars: ✭ 167 (-4.02%)
Mutual labels:  raspberry-pi, raspberry-pi-3
Spypi
An (un-)ethical hacking-station based on Raspberry Pi and Python
Stars: ✭ 167 (-4.02%)
Mutual labels:  raspberry-pi, raspberry-pi-3
Rpi Battery Monitor
Monitor battery voltage from a Raspberry Pi
Stars: ✭ 51 (-70.69%)
Mutual labels:  raspberry-pi, raspberry-pi-3
Opencv 3.2.0 Compiling On Raspberry Pi
Download, Compile, Build, and Install OpenCV 3.2.0 with Extra Modules on RPI running Jessie
Stars: ✭ 65 (-62.64%)
Mutual labels:  raspberry-pi, raspberry-pi-3
Pi Camera In A Box
Stream your Raspberry Pi Camera Module directly to your web browser
Stars: ✭ 49 (-71.84%)
Mutual labels:  raspberry-pi, raspberry-pi-3
Tortipi
Tor based Raspberry π hotspot
Stars: ✭ 76 (-56.32%)
Mutual labels:  raspberry-pi, raspberry-pi-3
Gassistpi
Google Assistant for Single Board Computers
Stars: ✭ 911 (+423.56%)
Mutual labels:  raspberry-pi, raspberry-pi-3
Embedio
A tiny, cross-platform, module based web server for .NET
Stars: ✭ 1,007 (+478.74%)
Mutual labels:  raspberry-pi, raspberry-pi-3
Raspberry Pi Os
Learning operating system development using Linux kernel and Raspberry Pi
Stars: ✭ 11,000 (+6221.84%)
Mutual labels:  raspberry-pi, raspberry-pi-3
Openauto
AndroidAuto headunit emulator
Stars: ✭ 1,926 (+1006.9%)
Mutual labels:  raspberry-pi, raspberry-pi-3

Apple Time machine on RaspberryPI

The following step are the ones that enable Time Machine backups with Raspberry Pi plus a bit of polishing to my taste.

1. Format the hard drive

I had a hard-drive serving as Time Machine disk. However, I couldn't mount the disk due to Apple Core Storage:

Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: DE07BD84-C4E1-4229-81CD-E146E04D46C6

Device         Start        End   Sectors   Size Type
/dev/sda1         40     409639    409600   200M EFI System
/dev/sda2     409640  975539735 975130096   465G Apple Core storage
/dev/sda3  975539736  975801879    262144   128M Apple boot
/dev/sda4  975802368 1953523711 977721344 466.2G Microsoft basic data

StackOverflow thread mounting hfs partition on arch linux didn't work for me. Since the backups on that disk were a bit outdated I decided to format the partition and give it a go. Another alternative would be to use Disk Utility to get rid of Apple Core Storage but in my case not worth the effort.

So, format the HD on your Mac using Disk Utility. Settings used:

  • Name: Time Machine
  • Format: Mac OS Extended (Journaled)
  • Scheme: GUID Partition Map

2. Ensure Pi has permissions to control the drive

Go to the Finder, then right-click the drive in the sidebar. Click “Get Info”.

Click the lock at bottom right, then enter your password. Next, check Ignore ownership on this volume. and give Read & Writepermissions to everyone.

Linux cannot write data into journaled hfs+ file system, so you also need to disable that:

diskutil list

Then find your drive and partition identifier (like: disk*s*), and run:

 diskutil disableJournal /dev/disk*s*

Dont forget to replace the asterisks. You'll see:

Journaling has been disabled for volume MyTimeMachine on disk*s*

3. Install tools for Apple-formatted drives

Go to Pi (ssh'ed it!) and run:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get --assume-yes install hfsprogs hfsplus

4. Mount the drive

Find the drive:

$ sudo fdisk -l

...

Device         Boot   Start      End  Sectors  Size Id Type
/dev/mmcblk0p1         8192  3292968  3284777  1.6G  e W95 FAT16 (LBA)
/dev/mmcblk0p2      3292969 62333951 59040983 28.2G  5 Extended
/dev/mmcblk0p5      3293184  3358717    65534   32M 83 Linux
/dev/mmcblk0p6      3358720  3500031   141312   69M  c W95 FAT32 (LBA)
/dev/mmcblk0p7      3506176 62333951 58827776 28.1G 83 Linux


Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: DE07BD84-C4E1-4229-81CD-E146E04D46C6

Device         Start        End   Sectors   Size Type
/dev/sda1         40     409639    409600   200M EFI System
/dev/sda2     409640  975539735 975130096   465G Apple HFS/HFS+
/dev/sda3  975802368 1953523711 977721344 466.2G Microsoft basic data

In my case my HD is connected to USB and the device is /dev/sda2. A good hint is the fs type Apple HFS/HFS+ or on other tools hfsx.

Create your mounting point:

$ sudo mkdir -p /media/time_machine

Check if Pi already auto-mounted your drive:

$ sudo mount

If it's mounted, you need to un-mount it or give it write permissions. In my case I didn't want to have it mounted on /media/pi/Time\ Machine so I un-mounted it:

$ sudo umount /dev/sda2

Mount drive using your editor of choice:

$ sudo nano /etc/fstab

Add to the end of the file:

/dev/sda2 /media/time_machine hfsplus force,rw,user,noauto,x-systemd.automount 0 0

Mount the drive

$ sudo mount -a

Check if it's mounted by finding the line like the bellow:

$ sudo mount
...
/dev/sda2 on /media/time_machine type hfsplus (rw,nosuid,nodev,noexec,relatime,umask=22,uid=0,gid=0,nls=utf8,user)

Install Netatalk

Netatalk simulates AFP, the network protocol Apple currently users for Time Machine backups.

Install dependencies

sudo aptitude 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 systemtap-sdt-dev libdbus-1-dev libdbus-glib-1-dev libglib2.0-dev libio-socket-inet6-perl tracker libtracker-sparql-1.0-dev libtracker-miner-1.0-dev

Install Netatalk via apt-get

apt-get install netatalk
whereis netatalk

6. Configure Netatalk

First let's set up nsswitch.conf by adding to the end of hosts: files mdns4_minimal [NOTFOUND=return] dns line mdns4 mdns.

$ sudo nano /etc/nsswitch.conf

It should look like this:

# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat
gshadow:        files

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

This means your Time Machine drive will show up in Finder’s sidebar.

Next set up afp.conf

$ sudo nano /usr/local/etc/afp.conf

add to the end

[Global]
  mimic model = TimeCapsule6,106

[Time Machine]
  path = /media/time_machine
  time machine = yes

At last set AppleVolumes.default (might not be necessary)! I did it anyway...

$ sudo nano /etc/netatalk/AppleVolumes.default

and add to the end of the file

/media/time_machine "Time Machine" 	options:tm

7. Launch network services

$ sudo service avahi-daemon start
$ sudo service netatalk start
$ sudo systemctl enable avahi-daemon
$ sudo systemctl enable netatalk

8. Give your Pi a static IP

Go to your router and assign a static IP to your Pi.

9. Connect to time machine

Go to your Mac Finder you should see your Raspberry Pi there. Click on Connect as and insert your credentials (user: timemachine). If doesn't work, connect to your Pi through its static IP. Open Finder, then hit Command+K on your keyboard and insert:

afp://<you Pi ip>

10. Configure your Mac Time Machine

Go to System Preferences > Time Machine and clik on Select Disk.... Your Pi should show on the list. Select and use the settings that work best.

Notice

  • Make sure that erveryone has permissions to read & write your disk drive.

  • If aptitude install ... at the last of step 5 shows an eror like Package 'libmysqlclient-dev' has no installation candidate, please try default-libmysqlclient-dev.

Reference Articles

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].