Having an external HD gives me a chance to use Time Machine to backup all my data.
.
Even though the initial process (first backup) is very slow, I am so impressed to see Time Machine in action. Now I can easily check how my Mac looks like, let’s say for yesterday’s date at particular hour. Just like its name, Time Machine.
.
.
At particular hour you said? Yes, by default Time Machine will create:
- Hourly backups for the past 24 hours
- Daily backups for the past month
- Weekly backups for all previous months
However, there is one important information in the Time Machine Preferences window:
.
.
What???? I did not buy this HD only to store Time Machine backups! Why there is no setting to limit the space used by Time Machine???
If you use external HD, I believe you can prepare separate partition with limited space for Time Machine. But, here I am not sure on how to do that in NAS (I am using MyBook Live).
.
After a whole day Googling, trial & error, and Googling, and trial & error (you can repeat this 5x), I managed to set limit on the image size used by Time Machine.
.
Before you go further on how to do this, all the steps were done in Mac OS X 10.6.7 and I am using MyBook Live 2TB for my NAS.
.
Here are the steps:
- First, switch off your time machine. You can do this from the Time Machines Preferences window. Just to be safe, I also set the Disk to None by clicking “Select Disks” and choose “None”
. - (Edited on 11.04.2012 to add info on mounting the backup volume – Thx to Gumlor).
.
Mount the backup volume and go into terminal to resize sparsebundle used by Time Machine by using hdiutil command.To mount the backup volume: Finder > Go > Connect to Server…
Enter the “Server Address” (change the disk name with your own one):afp://;AUTH=No%20User%20Authent@RapidoNAS.local/TimeMachine.
Use hdiutil command in the Terminal:hdiutil resize -size 500g -shrinkonly /Volumes/TimeMachine/PC-benk2.sparsebundle/.
On the example above, the maximum size of the sparsebundle image is 500GB. However, the exact size will be 1024*1024*1024*500 = 536.87GB.
.
You will need to change the path and name for the sparsebundle accordingly.TIPS:
– You may need to use sudo to execute hdiutil.
– If you got “hdiutil: resize failed – error -5341” as what I got at first time, try to reduce the size in several steps.
In my case, first I reduce the size to 1t (1 Terabyte) and to 500g subsequently.
. - By default, Time Machine will again resizing the image up to the max when the backup is running.
To avoid this you need to lock the Info.* files in sparsebundle by using SetFile from Terminal.
You can get SetFile by installing Developer Tools (Xcode.mpkg) from Installation DVD.
.SetFile -a L /Volumes/TimeMachine/PC-benk2.sparsebundle/Info.*.
- Now you can choose set the disk back from the Time Machine Preferences window and switch ON.From time machine preferences, the available space will still show the maximum size of your HD.
. - Open the Console from Application\Utilities to check the log and run the backup. Here in my system, I am getting below in the log:
.6/7/11 12:50:47 PM com.apple.backupd[13149] Starting standard backup 6/7/11 12:50:47 PM com.apple.backupd[13149] Network destination already mounted at: /Volumes/TimeMachine 6/7/11 12:50:47 PM com.apple.backupd[13149] Warning: Destination /Volumes/TimeMachine does not support TM Lock Stealing 6/7/11 12:50:47 PM com.apple.backupd[13149] Warning: Destination /Volumes/TimeMachine does not support Server Reply Cache 6/7/11 12:50:48 PM com.apple.backupd[13149] Resizing backup disk image from 500.0 GB to 1851.3 GB 6/7/11 12:50:55 PM com.apple.backupd[13149] Could not resize backup disk image (DIHLResizeImage returned 30) 6/7/11 12:50:56 PM com.apple.backupd[13149] QUICKCHECK ONLY; FILESYSTEM CLEAN 6/7/11 12:50:59 PM com.apple.backupd[13149] Disk image /Volumes/TimeMachine/PC-benk2.sparsebundle mounted at: /Volumes/Time Machine Backups 6/7/11 12:50:59 PM com.apple.backupd[13149] Backing up to: /Volumes/Time Machine Backups/Backups.backupdb 6/7/11 12:51:01 PM com.apple.backupd[13149] No pre-backup thinning needed: 1.01 GB requested (including padding), 259.52 GB available 6/7/11 12:51:11 PM com.apple.backupd[13149] Copied 627 files (2.2 MB) from volume Macintosh HD. 6/7/11 12:51:12 PM com.apple.backupd[13149] Starting post-backup thinning 6/7/11 12:51:14 PM com.apple.backupd[13149] Deleted backup /Volumes/Time Machine Backups/Backups.backupdb/PC-benk2/2011-06-06-124852: 259.52 GB now available 6/7/11 12:51:16 PM com.apple.backupd[13149] Deleted backup /Volumes/Time Machine Backups/Backups.backupdb/PC-benk2/2011-06-06-114856: 259.53 GB now available 6/7/11 12:51:20 PM com.apple.backupd[13149] Deleted backup /Volumes/Time Machine Backups/Backups.backupdb/PC-benk2/2011-06-06-104854: 259.54 GB now available 6/7/11 12:51:20 PM com.apple.backupd[13149] Post-back up thinning complete: 3 expired backups removed 6/7/11 12:51:20 PM com.apple.backupd[13149] Backup completed successfully..
As you can see, Time Machine is unable to resize the image size 🙂
. - Check the Time Machine volume, and it shows the correct size.
.
.
.
Just to ensure everything works fine, I also restart my Mac and reboot my NAS and recheck the log when the backup run. So far until now it is still working fine.
.
Please feels free to comment.
I am not an expert on this, so please let me know in case the steps might harm my system.