Friday, May 07, 2010

Time Machine backup on network

step 1. In the terminal enter the following:
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

step 2. Create what is called a sparse bundle on your mac(this is like a container for a virtual disk):
sudo hdiutil create -size 495g -type SPARSEBUNDLE -nospotlight -volname "mbp" -fs HFS+J -verbose ~/Desktop/mbpname_macaddresswithoutdividers.sparsebundle -imagekey sparse-band-size=131072

size = size in gigs
volname = the name of the volume in the sparse bundle
macaddresswithoutdividers = the mac address for the mac (eg 0023def4 etc)
The sparsebundle will be 200-300 meg

step 3. Copy sparsebundle over to network share.

step 4. open time machine and point it to wherever you put the sparse bundle

step 5. ?? (included for tradition's sake)

step 6. wait for the first backup to complete

Tip:
if you try starting time machine without the sparse bundle after the first step it will create the file name you need to use in the sparse bundle creation line similar to mycomputername_00023023d3.tmp.sparsebundle while it is working. Remove the "tmp" and you have the correct sparsebundle file name

Known issue:
If you put your machine to sleep or turn it off during a time machine backup the backup will be unrecoverable

Thursday, May 06, 2010

10.5: Start Time Machine backups now in Terminal - Mac OS X Hints

10.5: Start Time Machine backups now in Terminal - Mac OS X Hints

Backups every hour are fine, but what if you want to run a backup before taking your laptop somewhere? The following command in Terminal will start a backup immediately:
/System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper -auto
The same Resources directory has two interesting .plist files as well. StdExclusions.plist contains a list of all the folders and files that won't be backed up, while System.plist appears to be a list of all the files that are considered part of the standard release of OS X.

The fvimagetool app in that directory is probably the command which builds temporary disk images when you are doing backups over the network, but I haven't investigated that one fully yet.

[robg adds: While it's easy to start a backup now if you're in the GUI (control-click on the Time Machine icon in the dock or sidebar and choose Backup Now), the above may be useful to those who would like to start a backup remotely via ssh, or for use in scripting.]

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.