Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

3 Answers 3

up vote 3 down vote accepted

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

 - 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.

share|improve this answer
    
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 7: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. –  SvW Jun 21 '09 at 12:12
    
I've been doing this for a week now, works great! –  kbyrd Jul 6 '09 at 16:35
    
Snow Leopard may also need com.apple.TimeMachine.MachineID.plist to be inside the sparsebundle. [ lone-gunman.be/2009/12/19/… ] –  TonyUser Feb 13 '10 at 0:38
add comment

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.

share|improve this answer
    
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 1: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. –  SvW Jun 21 '09 at 12:07
add comment

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
share|improve this answer
    
Welcome to Server Fault! While this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. –  freiheit Dec 30 '12 at 6:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.