Sunday, May 02, 2010

OSX Timemachine and Samba/Windows share « Hupio’s Weblog

From: OSX Timemachine and Samba/Windows share « Hupio’s Weblog

Hello all,

This is a tutorial on how to use OSX 10.5.2 time machine with a Linux Server/Windows Server/Windows Share. I hope that you have already set up your samba server or windows share on the network if not please read the Samba-Howto or windows file sharing. Also make certain that the shares have read write access! Now create a directory for each OSX computer that you will be using time machine on the server of windows share. I like to use the name of the OSX computer as the directory. My computer is called Hcomp ( you can change the name of your computer in OSX by going to System Preferences->Sharing) so I create a directory called Hcomp on my server.

Now we need to make it possible for timemachine to access our folders on our network. Open up Terminal (Finder->Applications->Utilities->Terminal) and enter in the command ‘defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1′.

It now should be possible for time machine to show the samba shares and other non OSX shares, but before we can use these shares we have to mount them. Open Finder and click on G0->Connect to server in the finder menubar at the top. For the Server enter in smb://yourusername@yourservername_or_ip/YourMacOSXComputerName. For example my server is called ‘Bob’ and my OSX computer name is called ‘Hcomp’. The username and password was set up by reading the samba or windows file sharing like. So lets say my my username to access the server is called ‘willy’ and the password is ‘wonka’. I would then enter in for the server address smb://willy@Bob/Hcomp then I would click on the connect button. The prompt will ask you for the password. Enter that in also.

Now open time machine (Finder->Applications->System Preferences->Time Machine) and click on change disk. If you have mounted the directory correctly it should show up when you click on Change Disk. Select the directory that you have just mounted. For me I would select Hcomp. Now turn time machine on and it will wait 2 minutes before running the back up. If it doesn’t backup automatically then make sure that the ‘Show time Machine status in the menu bar’ is checked and click on the round clock on the menu bar at the top of the OSX screen and click on back up now. it now should run for a little bit and give you an error saying that it cannot create image error. This message is fine because it created a file that we needed for this to work.

Next Open the terminal (Finder->Applications->Utilities->Terminal) and type in ‘ifconfig en0 | grep ether’. After hitting return the command should have given you something like ether 00:00:45:12:8a:91. Write this number down without the colons. Now you have to ask yourself how much space to allocate to the time machine back up. This depends on your setup and how much space you have on your server. I choose 100GB my mac only has 100GB partition. Now the next command will create the sparsebundle that time machine needs to make the whole thing work.

‘hdiutil create -size 100g -fs HFS+J -volname “TimeMachine Hcomp” Hcomp_000045128a91.sparsebundle’

Do not type this in to the terminal yet without modifying it to your settings. Basically after the ‘-size 100g’ is the maximum size that time machine can be. ‘-volname “TimeMachine Hcomp” can be changed to ‘-volname “anything that you want”‘ but the last part of the command is important. Remember you wrote down the numbers for your mac ether 00:00:45:12:8a:91.
Well for the last part replace ‘Hcomp with you computer name and _000045128a91 with the number that you wrote down.

The last paragraph might be confusing so here is another example.
Servername: Server
OSXComputerName: OSX
MAC: 00:00:1F:12:82:92
Size of time machine space : 200GB
command ‘hdiutil create -size 200g -fs HFS+J -volname “OSX Backup” OSX_00001F128292.sparsebundle’

Now you should a file like Hcomp_000045128a91.sparsebundle or OSX_00001F128292.sparsebundle on your computer. Now copy this file to the server by issuing ‘cp -R Hcomp_000045128a91.sparsebundle /Volumes/Hcomp’ or ‘cp -R OSX_00001F128292.sparsebundle /Volumes/OSX’ but remember to replace sparsebundle with your sparsebundle or you will get an error. If everything worked correctly click on the time machine button at the top (the round clock icon on the menu bar) and do backup now. It should run and will take at long time the first time you do this.

Happy travels through time.

No comments:

Post a Comment