Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

10.5: Create a Time Machine size limit for networked disks System 10.5
I am using Time Machine to back up my MacBook Pro on a Samba drive connected to a Linux machine, per this hint. The thing is that when you use Time Machine, it will fill up your disk with backups. However, since I am using a shared networked drive, I wanted to leave free disk space for other users and keep my sysadmin happy. So, here is how you can prevent Time Machine from filling up your networked disk.

First, when you use Time Machine with a SMB disk, it creates a .sparsebundle disk image to put the backup data into. The disk image has a capacity of 2.75 TB. Since my SMB disk has only 1.5 TB of capacity, the disk image shows that 1.25TB is used and 1.5TB is available. The trick is to create another sparsebundle disk image of a given capacity (I used 300GB) on the SMB disk. Use 'Mac OS Extended (Case-sensitive, Journaled)' as the volume format in Disk Utility. Name the volume the same as the volume used by Time Machine (it should be Backup of computerName), and save it to something like test.sparsebundle.

Then, turn off Time Machine, mount your Time Machine backup image (by opening the .sparsebundle disk image on your SMB disk) and your newly-created disk image and use Disk Utility to 'restore' the Time Machine disk image into your new image. Click on the 'Erase Destination' button in order to allow Disk Utility to make a block copy of your Time Machine disk image. Wait for the process to finish.

Once finished, unmount both images and open a Finder window into your SMB drive. Note the name of the disk image used by Time Machine; it should be computerName_ABC123DEF.sparsebundle, where ABC123DEF is your MAC address. Delete this image, and rename your test.sparsebundle to this name. Then, restart Time Machine. The next time it backs up, you will see that the backup disk image used by Time Machine now has a new capacity (300GB in my case), and Time Machine will not fill up your network disk. It will use no more than 300GB.
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[63,020 views]  

10.5: Create a Time Machine size limit for networked disks | 19 comments | Create New Account
Click here to return to the '10.5: Create a Time Machine size limit for networked disks' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
10.5: Create a Time Machine size limit for networked disks
Authored by: rspeed on Wed, Nov 21 2007 at 8:13AM PST
Wouldn't it be much easier to use hdiutil?
hdiutil resize -size 500m -shrinkonly /Volumes/Network_Drive_Name/path/to/timemachine.sparseimage


[ Reply to This | # ]
10.5: Create a Time Machine size limit for networked disks
Authored by: felix-fi on Wed, Nov 21 2007 at 8:14AM PST
Nice trick... but my experience in that using SMB based partition for Time Machine is potentially very dangerous... read my post on apple discussions forum:

http://discussions.apple.com/thread.jspa?messageID=5918065#5918065

(I submitted this as an hint here yesterday, but it did not make yet...)

Meanwhile exercise extreme caution in using TM on SMB.

Basically, the problem boils down to the fact that TM is NOT able to recover freed space on a sparsebundle image... period.



[ Reply to This | # ]
10.5: Create a Time Machine size limit for networked disks
Authored by: felix-fi on Wed, Nov 21 2007 at 8:21AM PST
Just rephrasing the last sentece
"Basically, the problem boils down to the fact that TM is NOT able to recover freed space on a sparsebundle image which is on an SMB partition. period.

Meanwhile... anybody knows why sparsebundle images (created by TM) seem to report being twice as big as the SMB partition they are sitting on ? Weird...

[ Reply to This | # ]
10.5: Create a Time Machine size limit for networked disks
Authored by: dbs on Mon, Nov 26 2007 at 11:02AM PST
Based on your comment I set about testing AFP to a third-party NAS. This almost worked.

The old backups were correctly deleted (according to the log in the Console) but after deleting them I can only see one backup in the Time Machine GUI. The other backups exist properly (at least based on a quick examination) in the sparsebundle, but they are not accessible form the GUI.

This is a bit disturbing. It seems like something is really broken with sparsebundles. I don't know what would have to be different for AFP on a 10.5 machine to make this work.

I will test this later over AFP to a 10.5 machine and see if it magically works there. Otherwise it's back to CarbonCopyCloner for me and my $500 NAS...

[ Reply to This | # ]
10.5: Create a Time Machine size limit for networked disks
Authored by: odaigle on Wed, Nov 28 2007 at 6:33AM PST
Hi,
I have tested this and when TM filled the 50 Gig I had set the .sparsebundle size to, it successfully deleted only one backup to make place for the new one. I did not had the problem you are telling about. However, my backup partition (my SMB networked drive) was not full. It is only the .sparsebundle disk image that was full.

[ Reply to This | # ]
10.5: Create a Time Machine size limit for networked disks
Authored by: stokessd on Wed, Nov 21 2007 at 8:23AM PST
How about actually using the maxsize setting in the defaults file?

defaults write /Library/Preferences/com.apple.TimeMachine MaxSize 81920

Where the size is in Kbytes.


Sheldon

[ Reply to This | # ]
10.5: Create a Time Machine size limit for networked disks
Authored by: diamondsw on Wed, Nov 21 2007 at 8:38AM PST
I didn't know that - thanks! This will make it much easier to use the same volume for Time Machine backups and backups of other systems. I was afraid I couldn't do it because Time Machine would gobble up the whole disk.

By the way, if the size really is in kilobytes (why??), then that's a paltry 80MB you've given it. ;-)

[ Reply to This | # ]
10.5: Create a Time Machine size limit for networked disks
Authored by: stokessd on Wed, Nov 21 2007 at 12:20PM PST
That command is verbatim from other tips on time machine floating around on the net. I use 250gig and 400gig for my wife's and my laptops. Think of the 80 gig as a proof of concept...

Sheldon

[ Reply to This | # ]
10.5: Create a Time Machine size limit for networked disks
Authored by: Herve5 on Wed, Nov 21 2007 at 1:13PM PST
gosh. Just tried here, and TM still announces 320 Gb available in spite of my 100Gb new limitation.
How does it behave for you?
Do I understand correctly that the TM preference pane should now show 100 Gb max somehow? Do I have to reboot?

[ Reply to This | # ]
10.5: Create a Time Machine size limit for networked disks
Authored by: sd on Wed, Nov 21 2007 at 2:26PM PST
no, that is not the same. I have read that this allows to skip files over a certain size.

[ Reply to This | # ]
10.5: Create a Time Machine size limit for networked disks
Authored by: SandManMattSH on Tue, Apr 22 2008 at 10:39PM PDT
Does this work for local disks as well? (ie: external hard drives connected directly by firewire)

[ Reply to This | # ]
10.5: Create a Time Machine size limit for networked disks
Authored by: hughsaunders on Wed, Nov 21 2007 at 10:46AM PST
Time machine seems to obey disk quotas, so you can set a quota for the user time machine connects to the share as.



[ Reply to This | # ]
10.5: Create a Time Machine size limit for networked disks
Authored by: morespace54 on Wed, Nov 21 2007 at 11:14AM PST
Newbie question: How you do that?
Plus, what if the user want to access the drive for any other purpose? Wouldn't that bring an other problem (i.e. TM filling up all the user's available space of the now "quotas'ed drive")?

I want to be able to fill up the drive with anything I'm working on if I want to but stll make sure the whole drive isn't filled with TM backups.

Which of the proposed commands is the better one? The one that set the maxsize in the plist or the terminal one?

[ Reply to This | # ]
10.5: Create a Time Machine size limit for networked disks
Authored by: hughsaunders on Wed, Nov 21 2007 at 4:37PM PST
http://sial.org/howto/osx/quota/
Has lots of good info on setting up quotas on mac os, other operating systems I'm not really sure about..
The problem is that quotas are at disk level, so if your users are connecting to one machine for backup and other purposes, quota wont help you.
As for the solutions suggested above, the plist one is not well understood yet. -There have been reports of it not working and confusion over units.
So that only leaves the dmg soltution until someone comes up with something better...

[ Reply to This | # ]
10.5: Create a Time Machine size limit for networked disks
Authored by: dkssud on Thu, Nov 29 2007 at 1:23AM PST
oki, i tried that in terminal...

defaults write /Library/Preferences/com.apple.TimeMachine MaxSize 471859200
[400GB limit on a 700GB drive]

seemed like it processed...
but now timemachine is not backing up at all...
what's the reset code?
[should have known that before i tried it i know... :s ]
thanks!
:)

[ Reply to This | # ]
10.5: Create a Time Machine size limit for networked disks
Authored by: serj69 on Mon, Dec 3 2007 at 4:04AM PST
defaults delete /Library/Preferences/com.apple.TimeMachine MaxSize

[ Reply to This | # ]
10.5: Create a Time Machine size limit for networked disks
Authored by: dkssud on Tue, Dec 4 2007 at 10:32PM PST
thanks!
:)
it works

[ Reply to This | # ]
10.5: Create a Time Machine size limit for networked disks
Authored by: dkssud on Tue, Dec 4 2007 at 10:31PM PST
thanks!
:)
it works

[ Reply to This | # ]
Problem fixed in Time Machine and AirPort Updates v1.0
Authored by: adamcr on Sun, Apr 6 2008 at 10:13AM PDT
This problem has now been fixed with Apple's latest Time Machine and AirPort Updates v1.0. Time Machine will now compact the sparse bundle after it deletes an old backup to make sure it has the right amount of free space. I've posted my logs to show the new behaviour.

Cheers,

Adam

[ Reply to This | # ]