Tip: Use NFS instead of Samba for Time Machine Backups

I recently converted my Time Machine backup to use NFS instead of Samba. All in all, it was a pretty simple procedure. By using NFS, I dropped userspace CPU usage from a maximum of 40% with Samba to no more than 7-8% with NFS. This is on an AMD 4800+ X2, so the performance gains will be even bigger on slower machines. This means that my media server can now play HDTV h264 files without lagging during backups - a huge win for the elusive "WAF"!

A few notes about OS X and Time Machine compatibility:

  • Enable the 'insecure' option on the NFS share, as OS X will use non-privlidged ports to connect.
  • Use the anonuid and anonguid parameters as I don't have the same UID mappings on my laptop.
  • Mount the NFS share via the Finder. This is better than using Directory Services to automount the share, as you will get a proper icon in the Finder with this method. Time Machine is smart enough to mount the NFS share if needed during a backup, and unmount it when done.
  • Open Time Machine, and choose the new share as your target disk. Backups will resume as if nothing has changed!

This worked fine for a few days, until I accidentally knocked out my network cable during a backup. This caused my disk image to become slightly corrupted and irrepairable by Disk Utility. It still worked, but I didn't want to risk further corruption. Unfortunately, OS X didn't seem to want to create a new backup image via NFS. With Samba, it will initialize all of the appropriate files to mark the share as a Time Machine backup, but fail when creating the image. NFS didn't even get that far. So, I mounted the share with Samba, stopped it as soon as it started "Preparing backup...", and then re-pointed with NFS.

The first backup took nearly 2 days for 50 GB of data. There was no real load on the network, the client, or the server, but Time Machine is usually pretty slow the first time even with a normal hard drive. Subsequent backups take around 10-20 minutes, which is pretty reasonable.

Comments

nfs/osx time machine problems

Hi, i'm trying to use an NFS share to backup my mac with time machine.
I can see/mount the NFS share(that is on an Ubuntu machine) with Finder and/or via Terminal but when i try to start the backup i get this message:

Jan 4 23:39:50 icirpo /System/Library/CoreServices/backupd[739]: Backup requested by user
Jan 4 23:39:50 icirpo /System/Library/CoreServices/backupd[739]: Starting standard backup
Jan 4 23:39:50 icirpo /System/Library/CoreServices/backupd[739]: Error -35 while resolving alias to backup target
Jan 4 23:39:55 icirpo /System/Library/CoreServices/backupd[739]: Backup failed with error: 19

any suggestions?

thanks

cirpo

It sounds like it's still

It sounds like it's still trying to mount via Samba, and perhaps you've disabled the Samba share on the server? Or is this with a completely new setup?

Check your server's logs and see if your Mac is even trying to mount the share. I've definitely encountered the above error before, but but it was on older versions of 10.5 and I haven't had any issues the last few times I've moved things around.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <blockquote> <cite> <q> <code> <ul> <ol> <li> <dl> <dt> <dd> <strike>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Lines and paragraphs break automatically.

More information about formatting options

Refresh Type the characters you see in this picture. Type the characters you see in the picture; if you can't read them, submit the form and a new image will be generated. Not case sensitive.  Switch to audio verification.