12th Apr 2008
Setup Time Machine to backup to a Linux Server
Since the new version of Leopard that came with this amazing application, Time machine, I was trying to get it to work on the network; especially having a laptop that moves around the house, I didn’t want to drag an external hard drive along with me if I wanted my Time Machine to work; instead I figured would be so much more convenient to backup to the network and not worry about connecting or disconnecting the drive. I could back up while wire connected or even wireless. With a proper configured network everything should be smooth.
Even before I got my hands on a Leopard, I hoped (actually I thought) the Time machine must have the network capability. As of this writing, Apple doesn’t support backups over the network, even though at the beginning they intended to. They realized it’s not going to be safe for the backups and they wouldn’t take responsibility for the loses. Besides, they had to provide a stable application, as they usually do.
When I realized the Time Machine doesn’t do backups over the network, I as a bit pissed, to be honest, but I was sure I wasn’t alone feeling that way; so someone, a hacker somewhere must have found a way to bypass this shortcoming; so I started searching.
So far I found a post on http://macosxhints.com that worked great for me in the end. Here it is:
http://www.macosxhints.com/article.php?story=20071028173642747
After I finished and having joy in reaching my goal, I stumbled upon another post that warned about the backups being compromised if you use a network backup solution. Seems like the Time Machine erases all the backups when the disk fills up. I didn’t want to wait around in order to see if it’s true
So back to google again. Pleased to see that the fix was on the same website. Here it is:
http://www.macosxhints.com/article.php?story=20071108020121567
So far, the above links is all you need. I don’t know if these pages are going to stay there forever, so I’m going to summarize the steps required in order to have the thing working 100%, if for some reason the above posts are absolete on the original site. This is my site and I can control what to keep on it and for how long
So…. if the above links don’t work anymore, read further.
1) Get another MAC machine (let’s call it MAC2)
2) Connect an external hard drive to the MAC2, format it as native MACOS.
3) Connect the two computers in the same network (even a network cable between them will do, if you assign a static IP address. It doesn’t even have to be a cross-over cable. Any CAT5 will do).
4) Enable network disks on time machine, by typing the following at the command line:
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
5) From your MAC, connect to MAC2 using a valid account on MAC2 and drag the external disk that will show, into Finder’s sidebar (next to your local Hard Drive)
6) Open Time Machine and click on “Choose Disk”. Select the external disk connected to MAC 2 and allow Time Machine to do a full backup. Hint: you can exclude most of the directories for now, in order for the first backup not to take forever, because, remember we need to give the second MAC computer back to our friend. As soon as the first backup is done, you can give him back the computer.
7) Setup your Linux box with these two functions:
a) Kernel enabled AppleTalk module (I had to recompile my kernel for that)
b) Install Netatalk version 2 or above. Netatalk version 1.x will work as afp share, but you won’t be able to use it because it doesn’t allow long file names for the contents of the share. You can find a project on sourceforge.net. Just google it.
At this point we gave back the 2nd MAC and we ended up with an external hard drive that contains our backup (it’s just a .sparsebundle file on it), a MAC with a network enabled Time Machine and a linux machine that acts as an AFP server. I tried to use NFS or SMB to do this trick, but none worked for me. If my MAC wanted another MAC to backup, I gave it a fake MAC, my Linux that speaks Apple language.
9) Make sure the external hard drive and the AFP share on the network don’t have the same name. That is, rename your external hard drive. The AFP share must match the name of the External Hard drive at the time of the backup.
10) Once both volumes show on your Finder (your external HDD and your AFP share on Linux), type the following in your Terminal window:
sudo rsync -xrlptgoEv --progress /Volumes/<your extrnal hdd>/ /Volumes/<<your afp share>>/
Ignore messages like:
rsync: chown "/Volumes/<your afp share>>/<<your computer.mac>>.sparsebundle/bands/25c” failed: Operation not supported (45)
I had to run the rsync command a couple of times, because for some reason it disconnected. It doesn’t matter how many times you run it.
11) That was all. Now you can disconnect your external hard drive and re-enable the time machine.
If anyone needs my afp configuration files, you can request them: marian@dantux.com
Regards,
Marian.
Since the new version of Leopard that came with this amazing application, Time machine, I was trying to get it to work on the network; especially having a laptop that moves around the house, I didn’t want to drag an external hard drive along with me if I wanted my Time Machine to work; instead I figured would be so much more convenient to backup to the network and not worry about connecting or disconnecting the drive. I could back up while wire connected or even wireless. With a proper configured network everything should be smooth.
Even before I got my hands on a Leopard, I hoped (actually I thought) the Time machine must have the network capability. As of this writing, Apple doesn’t support backups over the network, even though at the beginning they intended to. They realized it’s not going to be safe for the backups and they wouldn’t take responsibility for the loses. Besides, they had to provide a stable application, as they usually do.
When I realized the Time Machine doesn’t do backups over the network, I as a bit pissed, to be honest, but I was sure I wasn’t alone feeling that way; so someone, a hacker somewhere must have found a way to bypass this shortcoming; so I started searching.
So far I found a post on http://macosxhints.com that worked great for me in the end. Here it is:
http://www.macosxhints.com/article.php?story=20071028173642747
After I finished and having joy in reaching my goal, I stumbled upon another post that warned about the backups being compromised if you use a network backup solution. Seems like the Time Machine erases all the backups when the disk fills up. I didn’t want to wait around in order to see if it’s true
So back to google again. Pleased to see that the fix was on the same website. Here it is:
http://www.macosxhints.com/article.php?story=20071108020121567
So far, the above links is all you need. I don’t know if these pages are going to stay there forever, so I’m going to summarize the steps required in order to have the thing working 100%, if for some reason the above posts are absolete on the original site. This is my site and I can control what to keep on it and for how long
So…. if the above links don’t work anymore, read further.
1) Get another MAC machine (let’s call it MAC2)
2) Connect an external hard drive to the MAC2, format it as native MACOS.
3) Connect the two computers in the same network (even a network cable between them will do, if you assign a static IP address. It doesn’t even have to be a cross-over cable. Any CAT5 will do).
4) Enable network disks on time machine, by typing the following at the command line:
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
5) From your MAC, connect to MAC2 using a valid account on MAC2 and drag the external disk that will show, into Finder’s sidebar (next to your local Hard Drive)
6) Open Time Machine and click on “Choose Disk”. Select the external disk connected to MAC 2 and allow Time Machine to do a full backup. Hint: you can exclude most of the directories for now, in order for the first backup not to take forever, because, remember we need to give the second MAC computer back to our friend. As soon as the first backup is done, you can give him back the computer.
7) Setup your Linux box with these two functions:
a) Kernel enabled AppleTalk module (I had to recompile my kernel for that)
b) Install Netatalk version 2 or above. Netatalk version 1.x will work as afp share, but you won’t be able to use it because it doesn’t allow long file names for the contents of the share. You can find a project on sourceforge.net. Just google it.
At this point we gave back the 2nd MAC and we ended up with an external hard drive that contains our backup (it’s just a .sparsebundle file on it), a MAC with a network enabled Time Machine and a linux machine that acts as an AFP server. I tried to use NFS or SMB to do this trick, but none worked for me. If my MAC wanted another MAC to backup, I gave it a fake MAC, my Linux that speaks Apple language.
9) Make sure the external hard drive and the AFP share on the network don’t have the same name. That is, rename your external hard drive. The AFP share must match the name of the External Hard drive at the time of the backup.
10) Once both volumes show on your Finder (your external HDD and your AFP share on Linux), type the following in your Terminal window:
sudo rsync -xrlptgoEv --progress /Volumes/<your extrnal hdd>/ /Volumes/<<your afp share>>/
Ignore messages like:
rsync: chown "/Volumes/<your afp share>>/<<your computer.mac>>.sparsebundle/bands/25c” failed: Operation not supported (45)
I had to run the rsync command a couple of times, because for some reason it disconnected. It doesn’t matter how many times you run it.
11) That was all. Now you can disconnect your external hard drive and re-enable the time machine.
If anyone needs my afp configuration files, you can request them: marian@dantux.com
Regards,
Marian.
Posted by marian under
MAC, Linux
9 Comments »