Update for MacOS X Lion : it is necessary to download the latest version of the Netatalk service that supports the AFP protocol from the following link. Without this, Time Machine will no longer work on MacOS X Lion.
Following the acquisition of a server at Protuts.net, here is a tutorial to learn how to use Time Machine to perform your backups to a local server not using MacOS X. Thanks to Linux Ubuntu, this tower is easily achievable!
First of all, be aware that this tutorial is not intended for all our readers. Not because it is more difficult than others but because you have to be in a situation similar to ours.
You will therefore need the following elements to follow this tutorial:
- Have 1 or more networked computers (PC/Mac);
- 1 classic server running on Linux Ubuntu 10.10;
- The operating systems installed on each of the machines;
- All your machines must belong to the same network domain;
- The machines are connected to each other by Ethernet cable — WIFI is not suitable for this type of situation;
From there, here is the problem to solve: how to ensure that each machine in the network can benefit from the storage capabilities — and thus backup, of the server (2 TB) while knowing that some use Windows systems (XP and 7) and others MacOS systems?
Several operating systems, this also means several types of partitions: NTFS for Windows and HFS+ for MacOS. The server must therefore be able to manage the 2 types of partitions to perform the backups correctly.
And that’s all the advantage of using Ubuntu!It handles these 2 types of partitions very well... but we'll go further by creating Ext4 partitions (Linux format) to perform our TimeMachine backups on MacOS X.
Moreover, given that Linux Ubuntu and MacOS X are based on UNIX, we will see that these two are perfectly interoperable — understand that they know how to collaborate.
For Windows, we will have to create NTFS partitions on the server... but we'll get back to it in a future tutorial.
In the end, MacOS X systems will save on Ext4 partitions and PCs on NTFS partitions.
Sources of departure
To carry out this mission, we relied on 2 English tutorials... we combined the 2 techniques while adapting them for Ubuntu 10.10.
- Making Time Machine Works With Ubuntu 10.10 Using AFP ;
- HOWTO: Make Ubuntu A Perfect Mac File Server And Time Machine Volume [Update6] ;
The most advanced, note that many steps have been removed since the previous distributions of Ubuntu.
Configuration of the Ubuntu Linux server
As I said in the introduction, I am starting from the principle that you have already installed Ubuntu 10.10 on your server machine. For info, a server is nothing different from a traditional client post in our case.
Step 1 — Installation of netatalk
So start by logging in and launch a Terminal.
Often you will be asked for your session password. Enter it while knowing that it does not appear on the screen.
Paste this first command:
sudo apt-get install aptitude
Wait a few moments then enter this second command:
sudo aptitude install netatalk
You have just installed netatalk to communicate between your computers.
Step 2 — Specification of Backup Authorisations
Let’s now edit the file AppleVolumes.default to configure backups. To do this enter this command to automate the process:
Here we will indicate who has the right to save on a particular partition. You should not create backup conflicts between your machines.
So we need to specify an IP address whose associated machine will have write rights on a dedicated partition.
Go to the end of the file, just after the line:
Then insert a line for each of your network machines in this form:
/media/TimeMachineAD allow:@anoste options:usedots,upriv,tm allowed_hosts:192.168.1.11
The beginning indicates the partition of the server that will host the backup — in this case, /media/TimeMachineAD while the end of the line indicates the IP address of the client machine — here, 192.168.1.11.
You must also specify the authorised domain. In my case, it is a matter of @anoste. This is the famous Workgroup Windows.
Save the file and close it. Note this file editing command, as you will need to add a line for each of your machines wishing to perform automatic network backups.
Let’s now restart the AFP service — AppleTalk Filing Protocol via the command:
Step 3 — Settings of Avahi Daemon
To continue the tutorial, you must have Avahi Daemon and libns-mdns on your Ubuntu.
Normally, they are installed by default but let’s check through the command:
sudo aptitude install avahi-daemon libnss-mdns
That’s done, we need to modify the file nsswitch.conf via the following command:
Then locate the line:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
Then add the word mDNS just at the end of the line like this:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns
Save and close this configuration file.
Step 4 — AFP Configuration
Let’s now make TimeMachine capable of identifying the backup partition we assigned to it.
Open the folder /etc/Avahi/services/ and create a new file afpd.service using a text editor.
Then paste the following code:
%h _afpovertcp._tcp 548 _device-info._tcp 0 model=iMac
At the antipenultith line, modify the Mac type model by indicating one of the following names: Macbookpro, MacMini, iMac, MacPro, Xserve, MacBook or MacBook Air.
Step 5 — Restarting services
Go back to a Terminal then enter the following order:
Then restart your Ubuntu and your backup machine — a Mac so.
We are now finished for the Ubuntu server configuration.
MacOS X client configuration
Now switch to your Mac to save. Run Time Machine and then do Choose a Disc.
You should see the network partition present on your Ubuntu server.
So select the latter and launch the backup.
Of course, the first backup will take several hours as transfers will take place over the network via Ethernet (cable). Thereafter, only incremental backups will be operated, which will take much less time — in the order of a few minutes knowing that a standard 5th class Ethernet cable transmits at 10-12 MB per second.
If by case, the network partition does not appear, use the function Connect to the server... present in the menu Go of Finder.
Then enter the following command by replacing this example with the IP address of your server:
You now have a network backup system running with Time Machine from MacOS X and Linux Ubuntu. Soon, the same for Windows PCs with a Ubuntu server!