Note: this wiki is now retired and will no longer be updated!
The static final versions of the pages are left as a convenience for readers. Note that meta-pages such as "discussion," "history," etc., will not work.
Preparing a Time Machine volume
A recipe for preparing a disk to serve one or more Time Machine volumes over a network, using afpd from the netatalk package on a GNU/Linux fileserver. This recipe requires a working netatalk afpd configuration, with user accounts on the GNU/Linux system for all Mac users who'll be using the service for Time Machine backups.
Contents |
Create the filesystem(s)
I store my Time Machine filesystems on an encrypted LVM volume. Storing them on an LVM volume makes it possible to snapshot your Time Machine backups for offsite storage of backup backups. Storing them on an encrypted volume provides a modicum of security against theft. (If the drive that you're backing up is stolen, you're still out of luck without encryption on that drive, of course.)
See Creating an encrypted filesystem on a partition for details on how to do this, but skip the part near the end that describes how to create the filesystem, as we want to do that a bit differently for a Time Machine filesystem.
One filesystem per system backed up
You should create one filesystem per system backed up, and export each filesystem across the network via afpd. If you're using an encrypted LVM system per above, you only need to create one encrypted LVM volume group, after which you can create multiple filesystems on that single volume group.
Assuming your LVM volume group is named tm and you want to create a 500GB, Time Machine-optimized filesystem for a Mac named wolverine:
# lvcreate --name wolverine --size 500GB tm Logical volume "wolverine" created
# mke2fs -t ext4 -T largefile -L wolverine /dev/tm/wolverine
Network Time Machine volumes store their backups as "sparsebundles" with large stripes of data, each stripe several MB in size. The mke2fs largefile option creates fewer inodes than the default filesystem configuration, so that we can save a little space.
Mount the filesystem
Note that if you're using an encrypted LVM volume to host your Time Machine filesystems, you'll either have to do this step manually each time you reboot your filesserver, or you'll have to enter the encrypted volume's passphrase during the boot process.
Here the mount point is /backup/tm/wolverine, but you should change it to fit your own filesystem hierarchy.
# mount /dev/tm/wolverine /backup/tm/wolverine/
Make the FS writable
Make sure the new filesystem is writable by the user who'll be logged into the Mac most often. I do this on my systems by adding the GNU/Linux logins for all of the Mac users to a UNIX group named backups, and then making the filesystem writable (and group-sticky) by that group, like so:
# chgrp backups /backup/tm/wolverine
# chmod 775 /backup/tm/wolverine
# chmod g+s /backup/tm/wolverine
Add the volume to your afpd configuration
Add a line like this to the afpd configuration in /etc/netatalk/AppleVolumes.default:
/backup/tm/wolverine "Time Machine (wolverine)" options:usedots,upriv,tm
The tm option is new as of netatalk 2.1, and obviates any need to hack defaults files or the like on your Mac OS X system in order to get it to recognize network Time Machine volumes.
Restart netatalk so that it'll see the new volume and create the .AppleDB directory.
Mount the volume from your Mac
On the Mac with which you want to use the Time Machine volume, mount the volume first, then configure Time Machine to back up to that disk. If you don't mount the volume first, Time Machine may not see it and won't be able to use it as a Time Machine target. You only need to do this the first time you configure Time Machine for use with this volume; subsequent backups or restores will automatically mount the correct volume first, assuming the afpd service is running on the fileserver.
If the volume doesn't show up in the list of available disks, make sure it's mounted, and make sure you have permission to write to the volume on the GNU/Linux side.