3

I currently use rsync with --link-dest to get an incremental Time Machine-ish backup of few sources with a variety of operating systems to a single Linux box. I swap out the backup drive to an external site every so often. One of these sources is a mac and while rsyncing from the Linux box to the mac appears to work, it believe it isn't catching all the details of the HFS+ filesystem so I couldn't really do a full restore from an OS DVD if I need to. Also, it takes an awful long time to backup the mac compared to other sources with similar amounts of data and number of files. So, I thought I would use Time Machine for the macs and continue using rsync for the other sources. Is Time Machine the best way to do this? If so, what do I need to do on my Linux server to have it be a valid Time Machine target? If not, what do you suggest?

I know there are several (Time Machine to Linux) pages on the Net, but I thought ServerFault could use one.

kbyrd
  • 3,604
  • 2
  • 23
  • 34

4 Answers4

4

Do it via a NAS share (samba or NFS).

I use Time Machine to back up to a ReadyNAS (which runs Linux under the hood). Here are my notes on how to do so.

Enable NAS backups:

 - defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

Find MAC address of the machine to be backed up:

 - ifconfig en0 | grep ether | sed s/://g | sed s/ether//

Command to create sparsebundle to copy over to NAS:

 - sudo hdiutil create -nospotlight -library SPUD -size 160g -fs "Case-sensitive Journaled HFS+" -type SPARSEBUNDLE -volname "hostname Backup" ./<hostname>_<macaddress>.sparsebundle

You need to insert your hostname and mac address to fit. This setup has been working with no major issues for quite a while now.

PS. You need to adjust the size of the volume. I have it set to 160GB as it's only backing up a Mac Mini.

kbyrd
  • 3,604
  • 2
  • 23
  • 34
Jauder Ho
  • 5,337
  • 2
  • 18
  • 17
  • Ok, so the sparsebundle is an HFS+ image in a file? Have you actually tried restoring from it? Is there a way to do this and be able to access the mac files from the Linux box? I've heard of AFP for Linux. – kbyrd Jun 20 '09 at 23:22
  • Yup, it is an image. I have had no issues with restoring but YMMV. I have no need to access the files from Linux so have not investigated. Looking at it from the Mac, it looks like a regular volume. – Jauder Ho Jun 21 '09 at 07:53
  • If you want to use time machine, you also could set up an iSCSI target on the linux box, install an initiator on the mac side and use this combination. If the target is not active (not mounted on the mac side), you could try to mount it directly on linux with mount -t hfsplus. – Sven Jun 21 '09 at 12:12
  • I've been doing this for a week now, works great! – kbyrd Jul 06 '09 at 16:35
  • Snow Leopard may also need com.apple.TimeMachine.MachineID.plist to be inside the sparsebundle. [ http://www.lone-gunman.be/2009/12/19/time-machine-network-drive-snow-leopard-update/ ] – TonyUser Feb 13 '10 at 00:38
  • Is that the hostname and MAC address of the Samba server or of the machine being backed up? – Mark E. Haase Nov 16 '14 at 18:02
  • The machine to be backed up, I just updated my answer. – kbyrd Nov 17 '14 at 23:42
1

You can configure to store the extended attributes of HFS+ in xattrs on the Linux fileserver with the -X and -A switches and the "fake super" functionality. This is working quite well, but you can use these xattrs only for restore to hsf+, especially ACLs are not usable on the linux side.

I recommend to compile your own rsync though, or use DarwinPorts version, as the apple supplied version was never working really well (and I am not sure if things got better recently).

see man rsync for the fake-super mode.

I can't comment on the speed issue, but maybe a locally built version works better.

Sven
  • 97,248
  • 13
  • 177
  • 225
  • I do have a locally built version from macports. I'll try the -X/-A flags and see. I think the time spent feels like it's doing a full file checksum on each file instead of just passing up a file based on size/time like it does from other systems. – kbyrd Jun 21 '09 at 01:15
  • You'll need fake super mode. If the filesize/timestamp check doesn't work, is the time exactly the same on the mac and the linux box? I tested this check extensively here before going live with my backup solution, and it's working great. – Sven Jun 21 '09 at 12:07
1

I have been successfully backing up my Macs to a Linux Server running CentOS via Samba by using SuperDuper! on the Mac. It has a smart update feature which allows incremental backups. The file it creates is not proprietary and can be used with Apple's Disk Utility.

SuperDuper! - Can be downloaded and installed for free, and only need to purchase it if you want to use the smart update features: http://www.shirt-pocket.com/SuperDuper/SuperDuperDescription.html

Edward_178118
  • 895
  • 4
  • 14
  • 30
-1

There is a step-by-step guide using avahi and netatalk at http://www.kremalicious.com/2008/06/ubuntu-as-mac-file-server-and-time-machine-volume/

As far as I understand, compiling is not necessary. You can just do this:

sudo apt-get install netatalk avahi
fukawi2
  • 5,327
  • 3
  • 30
  • 51
  • 1
    Welcome to Server Fault! While this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – freiheit Dec 30 '12 at 06:18