A couple of years ago, I had a backup solution for the Macs in the house that would allow me to do my Apple Time Machine backup via a Linux-based server’s Samba share. However, Snow Leopard updates eliminated that unsafe storage method working, leaving me stuck again with proprietary Apple technology.
I stumbled across something by accident last night that’s incredibly cool for my situation and incredibly simple.
Why fight the system? Just buy an Apple product!
First of all, I’ve owned a Time Capsule. It’s pretty cool at what it does and I’ve enjoyed it. Lately, I’ve been stocking up on hard drives for a large home network-attached-storage (NAS) server. This server holds my personal files, music, home videos, memories, etc. Additionally, I do a redundant backup copy of the large drive, making a safe and redundant backup.
Recently, I was happy to have made so many redundant copies. My 4-year-old 1TB drives started failing one at a time (including my 1GB Time Capsule drive), forcing me to replace and rebuild the setup while I still had at least 2 copies of it all. In doing so, I started wondering why I’d replace the failed hard drive for exclusive use in the Time Capsule backup. Certainly, there’s a way to have one large storage array that the Mac can use?
I stumbled across a package in the Fedora repository. I’m a Gnome 2 snob, so I am running Fedora 14 on my server (the last good OS ever made). The package: netatalk allows compatibility for Apple’s proprietary file sharing protocol (AFP). As it turns out, you can remotely attach to an AFP share on a Linux server and use it as a Time Machine backup.
The command to install all of these on Fedora 14 is:
yum install fuse-afp netatalk
This installed these packages:
fuse-afp-0.8.1-6.fc12.i686 afpfs-ng-0.8.1-6.fc12.i686 netatalk-2.1.3-1.fc14.i686
I installed the above packages. Then, I created a user account just for this purpose (mostly because the AFP wants to connect to that user’s home directory). From the MacBook, I pulled up Finder and typed flower-key (option) + K. That’s the remote server connection dialogue. I connected to a share as so:
The MacBook connected wonderfully and opened up a Finder window (the home directory on the Linux server). The only real modification I had to do was configure the Linux home path for the backup user, placing him on a specific directory in my big pool of NAS HDD. Opening the Time Machine dialogue, I chose this remotely mounted AFP share to use as the Time Machine backup.
It worked well — and allowed me to have one giant file share pool. The big benefit of this is that I can just do an rsync copy from one drive to the other. Since both drives are ext3, even the underlying Apple data will remain intact. I really did not want to pay $300 for an additional 2tb Time Capsule… or $100 for a SATA drive specifically dedicated to a few hundred gigs in backup. And like I said, my Linux solution also gives me a redundant copy of me Time Machine backup.
I don’t know how many people have already accomplished this cool Linux / AFP method, but I couldn’t find much online about it. As simple as this setup is, I’m excited to have accidentally discovered it.
Update — I had a problem connecting a second mac to the same share in the same way. The problem didn’t seem related to simultaneous logins. It was an older white MacBook with a fully updated Snow Leopard. I was able to connect via AFP and mount the drive. I could write files to it and had all the access I needed. It would, however, not allow me to use this as a Time Machine drive. This was solved by adding the following file into my home directory on the server:
Literally, just mount the AFP volume you want to use and create an empty text file. From the command-line, type: