20090123

Quick Mac OS X hack: Time Machine

I have two macs in my house. One has a 750GB drive on it for backups, plus its normal disk. It had been setup for Time Machine before and was working well. I also have a MacBook Pro that needs to be backed up. I didn't want to swap the disk back and forth between the two, since that would significantly erode the value of Time Machine's automatic backups. I didn't see any place where this was well documented, so I thought a quick note would be helpful to people. Most of the references I've seen have talked about different hacks to make this happen, or that it is only on a specialized Apple product that I didn't have.

I'm running Mac OS X 10.5.6 on both machines.

First, I went to the store and bought a 750GB drive. I plugged it into the mac mini that I have sitting on my desk. I configured it for Time Machine on the Mac Mini. I did a couple of time machine backups.

Next, I exported 750GB disk using the 'Sharing.' I clicked on 'File Sharing' tab to enable it. I clicked on the '+' button under the "Shared Folders" menus. I selected the volume that I had setup for Time Machine. I made sure that I was sharing via "AFP" in the "Options..." dialog.

Once I had things shared this way, I went to the other mac. I went to "Finder" and selected "Go->Connet to Server.." tab. Here I explicitly typed "afp://ipaddr/" and connected. Once I was connected this way, I proceeded to enable Time Machine. The remote disk appeared on the list of choices, so I just selected it and started it up.

I discovered that I have a 100Mbps switch, rather than a GigE switch. This made the initial backup very slow, on the order of 10GB/hr, which means I'm looking at a 10 hour backup time. Maybe it makes sense to head off to staples/best buy to get a GigE switch to plug them both into.

I've not tried to do this wirelessly, so I don't know how painful that will be. I've also not tried to connect this to the Samba server that I have running FreeBSD. I can normally see that volume on the macs without needing to do the manual step.

UPDATE: A GigE switch does help quite a bit. It was more like 6GB/hr with the 100Mbps switch, but with GigE I'm getting about 22GB/hr... So I have about 3 hours left in the backup now... 22GB/hr is about 6MB/s which seems way too slow (the hard disks are limited to about 15MB/s on each side, and the network to 125MB/s, so why the fall off in speed).

7 comments:

Anonymous said...

Hi,
Have you seen http://blogs.freebsdish.org/rpaulo/2008/10/04/apple-time-machine-freebsd-in-14-steps/ ?

Warner Losh said...

No I hadn't.... thanks for the pointer...

Anonymous said...

Hi Warner,

The problem with slowness is with OS X most likely. Research SMB slow on OSX and you should see the issue. So far, the "fix" is to set delayed_ack to zero.

It appears that the issue is a regression from NetBSD as FreeBSD, obviously, doesn't suffer any slowdowns with Samba, CIFS, AFP.

Right now I'm suffering the pain myself with OSX 10.1 which does not have the tunable sysctls like NetBSD or later versions of OS X. Let's just say I've bought a retail disc of Tiger for my G3 off of ebay and I can't wait!

PS,
Is it possible to communicate with AFP using a FreeBSD client??

Regards,
Brodey

Anonymous said...

Did my comment not post? Try setting delayed_ack to 0 (disabled...).

Is it possible to browse with AFP using a FreeBSD client?

Rgds,
Brodey

Warner Losh said...

OS X 10.5.6 is better about things. The GIGE connection helped a lot, but now that I've seen Rui Paulo's tips, I'll have to setup a FreeBSD server with afp to see if that's faster or not.

doverosx said...

Back again. I have my machine all setup and even with the DD-WRT client bridge (wireless) between two Linksys Routers I have obtained peak transfers of 2.25MB/sec.

Something seems odd on your end. I have adjusted a few things though:

In the GUI, I have the NICs manually wired to Full-Duplex...this affected my built-in on the G3 but not on my Leopard machine.

In my /etc/sysctl.conf I have:
net.inet.tcp.sendspace=65536 (You would want larger...for jumbo frames)
net.inet.tcp.recvspace=65536 (same)
net.inet.tcp.delayed_ack=0

I did some router tweaks, but that doesn't apply to your situation ;).

Server: OSX 10.4.11
Client: OSX 10.5.5 (hackintosh)
or
FreeBSD 7.1-RELEASE-i386

doverosx said...

My sysctls:

net.inet.tcp.sendspace=65536 (you'd want 'jumbo' sizes of course)
net.inet.tcp.recvspace=65536
net.inet.tcp.delayed_ack=0

This is with:

Client->wired Router->wireless bridge->wired router->server

I achieve a little over 2.0MB/sec, painful for the initial backup, but not far off of your results with Gigabit. There is definitely something "wrong".