# \[Tutorial\] Time Machine backup system with DietPi

**URL:** https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58
**Category:** Community Tutorials
**Created:** [20 August 2015 08:58 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58 "2015-08-20T08:58:25Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![sarmisak](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@sarmisak](https://dietpi.com/forum/u/sarmisak)
#### Post date: [20 August 2015 08:58 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/1 "2015-08-20T08:58:25Z")

</div>

Hi all;

Since I use a Macbook I use Time Machine for my regular backups, but backup is a time and CPU consuming process so I prefer doing it overnight at home. For remote backups Apple has a marvelous Time Capsule system, but it is expensive and it can be reproduced by a simple DietPi server.

First make a regular installation of a DietPi server, then install neccessary tools;

```nohighlight
apt-get install netatalk

```

In a regular DietPi install we don’t have a normal user, we have to create a new user so that we can use it to login to our time machine server. There are some workarounds, but this is far simpler.

```nohighlight
mkdir /home
useradd -s /bin/bash -m -d /home/sarmisak sarmisak
passwd sarmisak

```

Now we have to tell where time machine should keep our time machine folders. I would recommend using an external disk with an external power supply since it does not rely on the power of the RPi USB, I use a WD Essentials 2 TB disk for this job. After you plugin your disk, at the command prompt using **blkid** list your available disks;

```nohighlight
root@timemachine ~ # blkid
/dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="boot" UUID="CB99-4C7E" TYPE="vfat" 
/dev/mmcblk0p2: UUID="1263ae8d-aaf3-41b6-9ac0-03e7fecb5d6a" TYPE="ext4" 
/dev/sda1: UUID="2a96a3dd-2c08-4cfe-90ee-fbfeabf779ec" TYPE="ext4"

```

/dev/sda1 is what we are looking for, so let’s add it to our /etc/fstab file, copy your UUID from this output and in your /etc/fstab remove these lines;

```nohighlight
#External Drives---------------------------------------------------
# - Try and use only ext4 for USB drives
# - Faster performance than NTFS, espically on RPi v1
/dev/sda1 /mnt/usb_1 ext4 defaults,noatime 0 0
/dev/sda1 /mnt/usb_1 ntfs-3g defaults 0 0

```

with;

```nohighlight
#/dev/sda1 // Should be on one line
UUID="2a96a3dd-2c08-4cfe-90ee-fbfeabf779ec" /mnt/timemachine ext4 defaults,noatime 0 0

```

You will have to change your UUID when your disk changes, try not to change it and if you must change your disk you must change the UUID in here, too. I try to use UUIDs instead of /dev/sdaX, because if you plugin more than one disk the locations might change and you can overwrite on other files by fault.

Now, let’s create the mount point and give privileges to our user;

```nohighlight
mkdir /mnt/timemachine
chown -R sarmisak:sarmisak /mnt/timemachine

```

Edit /etc/netatalk/AppleVolumes.default and add this line at the end of the file;

```nohighlight
/mnt/timemachine/ "Time Machine" options:tm

```

Let’s mount the disk and restart the netatalk server;

```nohighlight
mount -a
service netatalk restart

```

In your Finder window press Command + K combination, a “Connect to Server” window should appear, in the address line write afp:// and your DietPi IP address;

```nohighlight
afp://192.168.xxx.yyy

```

It should ask you your username and password, fill in the neccessary fields and connect. You should be able to read and write in your Time Machine folder. Now, let’s add this disk to your Time Machine on your Mac. Click Time Machine in your System Preferences. Turn it on and click “Add or Remove Backup Disk…” button. You should be able to see your Time Machine server as “Time Machine” in the list, click and fill in the user information again. If you leave your Macbook connected to a power source, it should backup your computer to this Time Machine system automatically whenever you get connected at your home network.

---

<div class="post-metadata">

### Author: ![Fourdee](https://dietpi.com/forum/user_avatar/dietpi.com/fourdee/32/11_2.png) [@Fourdee](https://dietpi.com/forum/u/Fourdee)
#### Post date: [20 August 2015 12:25 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/2 "2015-08-20T12:25:30Z")

</div>

Hi sarmisak,

Many thanks for posting this guide. I will give it a spin on my RPi when i can.

I’ve also changed this post to a sticky.

---

<div class="post-metadata">

### Author: ![Munich77](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/m/edb3f5/32.png) [@Munich77](https://dietpi.com/forum/u/Munich77)
#### Post date: [13 September 2018 11:45 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/3 "2018-09-13T11:45:11Z")

</div>

Thank you for the great tutorial. Can i use Netatalk together with Pi-Hole? Or are there problems here?

---

<div class="post-metadata">

### Author: ![WarHawk](https://dietpi.com/forum/user_avatar/dietpi.com/warhawk/32/21_2.png) [@WarHawk](https://dietpi.com/forum/u/WarHawk)
#### Post date: [14 September 2018 03:38 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/4 "2018-09-14T03:38:27Z")

</div>

Cool howto

Easy way to create user that autocreated directory in /home is

```nohighlight
# adduser user

```

Quick howto on creating a sudoer user as well  
[https://www.digitalocean.com/community/tutorials/how-to-create-a-sudo-user-on-ubuntu-quickstart](https://www.digitalocean.com/community/tutorials/how-to-create-a-sudo-user-on-ubuntu-quickstart)

---

<div class="post-metadata">

### Author: ![fcupdt](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/f/3be4f8/32.png) [@fcupdt](https://dietpi.com/forum/u/fcupdt)
#### Post date: [29 November 2020 15:15 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/5 "2020-11-29T15:15:05Z")

</div>

Sorry for the silly question, is this tutorial still working after 5 years?  
I’ve tried but I almost bricked my system 😢 I’m a newbie and seems like I’m having troubles with netatalk

If someone is willing to help me I’ll post some details

---

<div class="post-metadata">

### Author: ![Wishmaster.dj](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/w/96bed5/32.png) [@Wishmaster.dj](https://dietpi.com/forum/u/Wishmaster.dj)
#### Post date: [29 November 2020 16:43 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/6 "2020-11-29T16:43:33Z")

</div>

Following. Would love to make this happen. TIA!

---

<div class="post-metadata">

### Author: ![fcupdt](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/f/3be4f8/32.png) [@fcupdt](https://dietpi.com/forum/u/fcupdt)
#### Post date: [6 December 2020 14:45 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/7 "2020-12-06T14:45:21Z")

</div>

Tried this - [https://saschaeggi.medium.com/use-a-raspberry-pi-4-for-time-machine-works-with-big-sur-1e66a9650789](https://saschaeggi.medium.com/use-a-raspberry-pi-4-for-time-machine-works-with-big-sur-1e66a9650789)  
with no luck 🤔

---

<div class="post-metadata">

### Author: ![mrbungle](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@mrbungle](https://dietpi.com/forum/u/mrbungle)
#### Post date: [30 December 2021 20:21 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/8 "2021-12-30T20:21:50Z")

</div>

> [@](#):
>
> Tried this - [Use a Raspberry Pi 4 for Time Machine Backups (works with macOS 13 Ventura) | by Sascha Eggenberger | Medium](https://saschaeggi.medium.com/use-a-raspberry-pi-4-for-time-machine-works-with-big-sur-1e66a9650789)  
> with no luck 🤔

Worked nicely for me after installing samba-vfs-modules. Thanks for posting. Maybe check /var/log/samba if that wasn’t it.

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [1 January 2022 13:15 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/9 "2022-01-01T13:15:02Z")

</div>

Here some more background/info at the feature request on GitHub: [https://github.com/MichaIng/DietPi/issues/4507](https://github.com/MichaIng/DietPi/issues/4507)

Happy new year all together 🙂.

---

<div class="post-metadata">

### Author: ![brtravel](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/b/50afbb/32.png) [@brtravel](https://dietpi.com/forum/u/brtravel)
#### Post date: [28 January 2022 03:07 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/10 "2022-01-28T03:07:35Z")

</div>

This simple Samba based writeup is working fine for me: [https://manjaro.site/how-to-configure-time-machine-to-backup-to-samba-shared-folder/](https://manjaro.site/how-to-configure-time-machine-to-backup-to-samba-shared-folder/)

---

<div class="post-metadata">

### Author: ![fcupdt2022](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/f/d2c977/32.png) [@fcupdt2022](https://dietpi.com/forum/u/fcupdt2022)
#### Post date: [29 October 2022 18:26 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/11 "2022-10-29T18:26:18Z")

</div>

Hey everybody - I changed user as I couldn’t access the previous one.

So, I’m willing to solve this issue but no skills - somebody willing to help me sort this out?

At this point, for some reason I can access the dietpi folder but not the pimachine folder (the one that I’ll be using for this Time Machine thing)

Where to start?

Edit: typos

 ![Pic](https://dietpi.com/forum/uploads/default/original/2X/0/09a29b68a5a3aea5eaf00d6d0146e09ab6f63d4e.png)

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [29 October 2022 19:21 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/12 "2022-10-29T19:21:23Z")

</div>

> [@fcupdt2022](#):
>
> Where to start?

You could start sharing some more information on your system.

How do you access the system?  
Which user you are using?  
Which file system you are trying to access?  
How does file system permission looks like for that folder you are trying to access?

---

<div class="post-metadata">

### Author: ![fcupdt2022](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/f/d2c977/32.png) [@fcupdt2022](https://dietpi.com/forum/u/fcupdt2022)
#### Post date: [29 October 2022 20:34 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/13 "2022-10-29T20:34:00Z")

</div>

After installing the samba-vfs-modules, I’ve went through the last steps of the tutorial and now Time Machine is working fine.  
And the problem reported above was because I was trying the access without using the Time Machine user.  
So, everything works now 🥳

---

<div class="post-metadata">

### Author: ![fcupdt2022](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/f/d2c977/32.png) [@fcupdt2022](https://dietpi.com/forum/u/fcupdt2022)
#### Post date: [29 October 2022 20:52 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/14 "2022-10-29T20:52:08Z")

</div>

But I have a final question - what is considered to be a normal write speed?  
My Raspberry is cabled to the router through a Gigabit switch and my Mac (Air M1 2020) is connecting to the router on the 5G network.

I think I’m getting around ~10Mb/s (80gb to go and 6h estimated to finish)

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [29 October 2022 21:37 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/15 "2022-10-29T21:37:54Z")

</div>

speed hight depends on used SBC, SD card, attached USB or SSD.

---

<div class="post-metadata">

### Author: ![fcupdt2022](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/f/d2c977/32.png) [@fcupdt2022](https://dietpi.com/forum/u/fcupdt2022)
#### Post date: [29 October 2022 23:39 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/16 "2022-10-29T23:39:27Z")

</div>

Raspberry Pi 4 with a 4TB WESTERN DIGITAL Elements (2.5’’ - 4 TB - USB 3.0) non SSD.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [30 October 2022 19:19 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/17 "2022-10-30T19:19:20Z")

</div>

what is the performance if you do a Benchmark test?

1. `dietpi-config`
2. 10 : Tools
3. Benchmarks
4. Custom Filesystem
5. select your HDD
6. set `100` and OK

what is the result? Does the drive has an own PSU? Or is it connected to USB port only?

---

<div class="post-metadata">

### Author: ![StephanStS](https://dietpi.com/forum/user_avatar/dietpi.com/stephansts/32/2522_2.png) [@StephanStS](https://dietpi.com/forum/u/StephanStS)
#### Post date: [6 November 2022 21:47 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/18 "2022-11-06T21:47:45Z")

</div>

@fcupdt2022: This description could be a good option for an own blog post in our DietPi blog ([DietPi Blog – …discover interesting topics](https://dietpi.com/blog/)).  
Would you be able to write the text and supply additional screenshots? Then we could generate together a blog post, I could takeover the manual work of entering your post contents.

---

<div class="post-metadata">

### Author: ![fcupdt2022](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/f/d2c977/32.png) [@fcupdt2022](https://dietpi.com/forum/u/fcupdt2022)
#### Post date: [6 November 2022 22:42 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/19 "2022-11-06T22:42:21Z")

</div>

│ - Test size = 100 MiB │  
│ - WRITE = 78 MiB/s │  
│ - READ = 112 MiB/s

It’s USB powered. I have a spare SSD and in the next days I plan to check if it is worth using it for the Time Machine backups

---

<div class="post-metadata">

### Author: ![fcupdt2022](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/f/d2c977/32.png) [@fcupdt2022](https://dietpi.com/forum/u/fcupdt2022)
#### Post date: [6 November 2022 22:44 UTC](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58/20 "2022-11-06T22:44:53Z")

</div>

Do you mean for the writing speed or setting up the Time Machine thing?

[Next page](https://dietpi.com/forum/t/tutorial-time-machine-backup-system-with-dietpi/58.md?page=2)
