Jun 06, '08 07:30:02AM • Contributed by: cody121
This hint will put your Entourage 2004 database on a sparse bundle, which Time Machine knows how to use for a true incremental backup. I am using this for Entourage, but it will probably work OK with Paralells' or VMware's virtual machines, too -- I just don't know about the speed issue.
Sorry, much of this is kind of advanced, but if you don't understand what you are doing here, you are probably better off not using this method. If something goes wrong after an update, you will have a hard time figuring out what happened, and getting to your email. This is not a hint for those with only a basic knowledge of the system...
Basically this is how I made a Sparse Bundle mount to an odd mount point on system boot. I am going to use my Entourage installation as an example, and I'm not going to explain every step in the ultimate low-level of detail, so watch what you are doing.
- Create the Sparse Bundle in Terminal. First see how big your current database is:
My Entourage folder is 2.5GB, and when I create my Sparse Bundle, I want it to have enough room to grow. So I used Disk Utility to make an image:$ cd ~/Documents/Microsoft\ User\ Data/ $ du -hs Office\ 2004\ Identities 2.5G Main Identity/- Save As: Entourage.sparsebundle
- Location: ~/
- Name: Entourage Database
- Size: Custom (10GB)
- Format: Mac OS Extended (journaled)
- Encryption: none
- Partition: No Partition Map
- Image Format: sparse bundle disk image
- Move your current data. Quit all of your MS Office programs, and do not start them again until you're done here. Be sure that nothing is accessing your Main Identity folder, using Terminal:
You may see your own applications in the list, but that is not a big deal. Rename your Office 2004 Identities folder:$ lsof | grep "Microsoft User Data"
Be sure that the file owner, group, and permissions are the same.$ cd ~/Documents/Microsoft\ User\ Data/ $ mv Office\ 2004\ Identities Office\ 2004\ Identities.BACKUP $ mkdir Office\ 2004\ Identities $ ls -dl Office\ 2004\ Identities* - Make a script to mount your sparse bundle to your new directory, using Terminal:
This should be the contents of the mountentourage file:$ cd $ mkdir -p unix/scripts $ cd unix/scripts $ touch mountentourage $ chmod 750 mountentourage $ nano mountentourageObviously, change the USER directory to your user's home directory. If you copy and paste the above, be sure that there are no trailing spaces at the end of the lines. Exit nano, saving your changes. You should now have an executable file that mounts your disk image to your datastore:#!/bin/sh /usr/bin/hdiutil attach "/Users/USER/Entourage.sparsebundle" \ -mountpoint "/Users/USER/Documents/Microsoft User Data/Office 2004 Identities" \ -owners on -notremovable -nobrowse
And df should now show your mapping:$ ./mountentourage /dev/disk2 Apple_partition_scheme /dev/disk2s1 Apple_partition_map /dev/disk2s2 Apple_HFS /Users/USER/Documents/Microsoft User Data/Office 2004 Identities$ df Filesystem 512-blocks Used Available Capacity Mounted on /dev/disk1s9 320144448 150973320 168659128 48% / devfs 233 233 0 100% /dev fdesc 2 2 0 100% /dev /dev/disk0s3 624880224 290918680 333961544 47% /Volumes/Backup map -hosts 0 0 0 100% /net map auto_home 0 0 0 100% /home /dev/disk2s2 20971520 72480 20899040 1% /Users/USER/Documents/Microsoft User Data/Office 2004 Identities - Execute the script at startup. (Oh how I long for the days of good old simple /etc/rc). In Terminal:
This should be the contents of the user.USER.mountentourage.plist file:$ hdiutil detach disk2 $ df // The drive should no longer be mounted $ cd /Library/LaunchDaemons $ sudo nano user.USER.mountentourage.plistExit nano, saving your changes. Then execute these Terminal commands:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>user.USER.mountentourage</string> <key>ProgramArguments</key> <array> <string>/Users/USER/unix/scripts/mountentourage</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist>
If all went well, you will now see your entourage directory mounted. Verify that after a system restart, df shows you your mount.$ ls -l -rw-r--r-- 1 root wheel 398 Jun 4 16:11 user.USER.mountentourage.plist $ sudo launchctl load user.USER.mountentourage.plist $ df - Test and populate your new image. One final check of the mount first:
At this point, your data should be loaded and ready to go. I choose to back my Office 2004 Identities.BACKUP directory just to be safe:
$ cd ~/Documents/Microsoft\ User\ Data/Office\ 2004\ Identities $ touch testfile $ ls testfile $ cd .. $ df | grep Microsoft $ hdiutil detach disk2 $ cd Office\ 2004\ Identities $ ls // The file testfile should not be here $ cd .. $ sudo launchctl unload /Library/LaunchDaemons/user.USER.mountentourage.plist // (because it was loaded at startup) $ sudo launchctl load /Library/LaunchDaemons/user.USER.mountentourage.plist $ df $ cd Office\ 2004\ Identities $ ls testfile $ rm testfile $ cd .. $ cp -prv Office\ 2004\ Identities.BACKUP/* Office\ 2004\ Identities/$ mv Office\ 2004\ Identities.BACKUP /Volumes/Backup/ - Configure Time Machine. While all of the data that you have looks like it resides in ~/Documents » Microsoft User Data » Office 2004 Identities, technically, that is now another Volume. Since those are the big files that you were probably ignoring before, you still don't want to back them up directly. So go to your Time Machine options and make sure that "Entourage Database" is in the "do not backup" list.
[robg adds: I haven't tested this one...]
