Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.5: Limit size of Time Machine backups on Time Capsule Network
Many have expressed the desire to partition the internal hard disk in their Time Capsule -- presumably because they wish to limit the amount of space allocated to Time Machine backups. I myself wanted to do this. Thanks to these instructions on the ReadyNAS Community site, I believe I have found a solution that uses their method and builds off of it.

Note: although it is working for me, this is not guaranteed to work, it may contain errors, and it is not for those who are unfamiliar with working in Terminal. I also do not offer tech support -- you're on your own.

With those provisos, here's the how-to...
  1. Disable Time Machine in the Time Machine System Preferences panel.
  2. Find the MAC address of the machine's internal Ethernet port with ifconfig en0 | grep ether in Terminal. This will return one line of output, which is the MAC address for the Ethernet port, which will be a string of letters and numbers, for example, 00:16:cb:af:91:d7.

    Even if the network backups will be done using a different port (e.g. AirPort: usually en1), the system will use the MAC address of en0 as part of the system identifier. If your computer's (not your hard disk's) name is MyMac, the identifier that Time Machine will use will be (using the sample MAC address above) MyMac_0016cbaf91d7.
  3. Create a new sparsebundle directly on the Time Capsule share. Decide how many gigabytes in size you want it to be, and substitute the figure you want for 125 below (be sure to append the g for gigabytes). The easiest way to do this is to type after the prompt:
    hdiutil create -size 125g -fs HFSX -volname "Backup of MyMac"
    Next, press the Space Bar, and drag the Time Capsule volume appearing on your desktop directly from the desktop into the Terminal window (assuming you have the Finder set to display connected servers). Then type in the sparesebundle name as calculated above. So if the name of the Time Capsule volume is david, the final command should look something like this:
    hdiutil create -size 125g -fs HFSX -volname "Backup of MyMac" /Volumes/david/MyMac_0016cbaf91d7.sparsebundle
    Note that in place of david would be whatever the name of the particular Time Capsule volume you have chosen. (I use Secure Shared Disks » With Accounts" under Disks » File Sharing in AirPort Utility, so volumes for each account name are created). Hit Return now, and you should see a message similar to this:
    created: /Users/david/Mac_0016cbaf91d7.sparsebundle
  4. Double-click that .sparsebundle file residing on your Time Capsule volume, and it should mount.
  5. Launch Disk Utility, choose "Backup of MyMac" in the Disk Utility sidebar, and click on the Enable Journaling button. The reason why I do this is that, in the course of testing, I found that Time Machine created .sparsebundle files which when mounted had filesystems that were both case-sensitive and journaled, and the hdiutil command apparently doesn't allow one to create a .sparsebundle file with both of these attributes simultaneously.
  6. Unmount Backup of MyMac.
  7. Open the Time Machine System Preferences panel, and select Backup of MyMac as the new destination for Time Machine backups.
  8. Turn Time Machine back on in this same System Preferences panel.
[robg adds: I haven't tested this one, and the above is a shorter version of the very-thorough instructions on the ReadyNAS site -- read their entry if you'd like more detail on the process.]
    •    
  • Currently 2.64 / 5
  You rated: 4 / 5 (11 votes cast)
 
[69,122 views]  

10.5: Limit size of Time Machine backups on Time Capsule | 15 comments | Create New Account
Click here to return to the '10.5: Limit size of Time Machine backups on Time Capsule' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Limit size of Time Machine backups on Time Capsule
Authored by: diamondsw on May 22, '08 08:39:03AM
I can verify this procedure works well, and it also allows you to migrate the backup to other drives (including a Time Capsule). I have a critique on my blog of the odd way Apple uses two different storage layouts for Time Machine and some of the consequences.

[ Reply to This | # ]
10.5: Limit size of Time Machine backups on Time Capsule
Authored by: hamarkus on May 22, '08 10:18:44AM

One reason against a disk image is that a corruption of that image file can render all your backups inaccessible. (To be precise, TC uses a disk image bundle which consists of hundreds to thousands of files, probably more robust than one huge file and practically necessary above a certain file size.)



[ Reply to This | # ]
10.5: Limit size of Time Machine backups on Time Capsule
Authored by: hamarkus on May 22, '08 10:10:36AM

Is there a reason why one could not create the sparsebundle directly with Disk Utility?



[ Reply to This | # ]
10.5: Limit size of Time Machine backups on Time Capsule
Authored by: macHobbes on May 22, '08 11:14:04AM

No - as far as I know it works, and I have done it several times.

Also, I think a still easier, although not faster method is the following.
First, let Time Machine create one backup, but exclude all visible folders to speed things up. This way, you automatically get the right name for the disk bundle.
Then, save that name, delete the backup, and create a new disk bundle with disk utility, giving it the name you just saved and the size you want.
Back in Time Machine choose this file for backups.



[ Reply to This | # ]
10.5: Limit size of Time Machine backups on Time Capsule
Authored by: badtz on May 22, '08 11:43:48PM

Thanks for pointing out the tidbit in step #2 about time capsule/airdisk using the MAC ID of en0, this was lacking in previous tips and caused me a lot of headache.



[ Reply to This | # ]
Another method
Authored by: GaelicWizard on May 23, '08 09:24:39PM

Here's another way of doing this, with much less work:

You'll need two Macs for this version, but anyone who has the technical knowledge to be following either the original hint or this tip should know how to adjust it for use from just one Mac. (Hint: temporarily disable Time Machine.)

1) Put Mac #1 to sleep. This is to prevent Time Machine on Mac #1 from attempting a backup while we are violating its backupdb.
2) Fire up Terminal on Mac #1 and cd to your Time Capsule share.
3) Enter: [code]hdiutil resize -size 300g Mac#1_01234abcde.sparsebundle[/code]

This should get the goal of the original hint done, but without destroying your existing backups and without having to mess with choosing the right volume.


---
Pell



[ Reply to This | # ]
Another method (correction)
Authored by: GaelicWizard on May 23, '08 09:26:16PM

Step two should refer to Mac #2, not Mac #1 (since Mac #1 is asleep).

Oops. :-) There's a Preview button for a reason, I guess...

---
Pell



[ Reply to This | # ]
Another method
Authored by: Herve5 on May 25, '08 07:07:06AM

sorry for not reading your comment before commenting myself.
In fact you don't need a second mac to do this, only to stop TM (see my own post below yours)
H.



[ Reply to This | # ]
10.5: Limit size of Time Machine backups on Time Capsule
Authored by: Herve5 on May 25, '08 07:04:47AM
You can limit the size of your already existing network backup with hdiutil:
First, stop Time Machine, then open Terminal and type:
[your prompt] hdiutil resize -size [your target size in Go]g -shrinkonly
[and then drag'n drop here the .sparseimage icon, Terminal will type the path]

and then you wait, it can take a dozen of minutes via a slow wifi if your .sparsebundle is already big. When you get the prompt back, you are done.
Honestly, I think I found this very hint here on macosxhints, shortly after TM was introduced.
I've been using it happily for months to backup 3 separate machine on the same NAS without one gulping it all, while ensuring extra space on the same volume.

[ Reply to This | # ]
10.5: Limit size of Time Machine backups on Time Capsule
Authored by: finitesquid on Oct 15, '09 07:59:31AM

Has anyone tried this with 10.6 yet? It seems that the MAC address is no longer used in the name of the sparse bundle, and the 'hdutil -size' command is returning an error...

I've played around a bit (tried creating a new image, used Disk Util to resize, etc.), but no luck so far.



[ Reply to This | # ]
10.5: Limit size of Time Machine backups on Time Capsule
Authored by: fabio.fidanza on Oct 21, '09 01:18:10PM

Tried on Snow Leopard: after about 10 minutes got a
<pre>hdiutil: resize: failed. Operation not permitted (1)</pre>
this is the command i used:
<pre>sudo hdiutil resize -size 400g -shrinkonly /Volumes/XXXXXXXXXXXXX/sparsebundle</pre>

Any idea?




[ Reply to This | # ]
10.5: Limit size of Time Machine backups on Time Capsule
Authored by: scottlepich on Mar 17, '10 08:01:46AM

Thanks for the tips. Here's a one-liner that should give you the sparsebundle name you need from the terminal (provided your computer name is sensible and doesn't have any spaces in it):

name=`system_profiler | grep "Computer Name" | awk '{print $3}'` && addr=`ifconfig en0 | grep ether | awk '{print $2}' | sed 's/\://g'` && echo "${name}_${addr}.sparsebundle"

Cheers!



[ Reply to This | # ]
10.5: Limit size of Time Machine backups on Time Capsule
Authored by: ClunkClunk on Mar 19, '10 12:14:59PM
Works with spaces in the machine's sharing name:
name=`system_profiler | grep "Computer Name" | awk '{print $0}' | sed 's/Computer\ Name\://g'` && addr=`ifconfig en0 | grep ether | awk '{print $2}' | sed 's/\://g'` && echo "${name}_${addr}.sparsebundle"


[ Reply to This | # ]
10.5: Limit size of Time Machine backups on Time Capsule
Authored by: gusbear on Mar 25, '10 08:15:23AM
Not to be pedantic, but I can't help myself:
echo "$(system_profiler | sed -ne 's/.*Computer Name: //p')_$(ifconfig en0 | awk '$1=="ether"{gsub(":","");print$NF}').sparsebundle"
Using grep, sed and awk all at the same time is a pet peeve. :P Actually I can do the whole thing with a single awk, but that was more complicated than just doing the above.

[ Reply to This | # ]
10.5: Limit size of Time Machine backups on Time Capsule
Authored by: sutara on Oct 16, '10 03:59:56PM

Hi! I need a little help. I am trying to limit the time machine the same way, however I am facing problem in terminal since I have unfortunately named my comp with 3 words (and space in between) which resulting in the command thinking that these are more than 1 files/directory, thus nor allowing it to execute the command.

Can someone help? How can I rename my comp? I have tried with hostname change etc, but it didnt work.

aaarrrggghhh... this is so frustrating!!!
Ratna.



[ Reply to This | # ]