10.4: Increase the max size of a FileVault directory

Mar 22, '06 05:40:00AM

Contributed by: cryptonomicon

Tiger only hintFileVault protected home directories are nothing more than a special usage of sparse disk images, like the ones you can create with Disk Utility. Sparse disk images only use as much space as they currently need to, but they do have a maximum capacity, determined at the time of their creation. Thus, FileVault protected home directories can run out of space, even if your hard drive has free space. This hint will explain how to increase the maximum capacity. You will need a copy of the latest version of Carbon Copy Cloner.

First, you will need a separate admin account on your system. Let's say the name of your FileVault protected user is foobar, and the name of your admin user is admin. Log in as admin, and navigate to /Users. Select the foobar folder, and select File: Get Info. Go to the Ownership & Permissions section of the Info window, and open the Details. Temporarily change the Owner to admin.

Now, open the /Users/foobar/ folder. Inside should be foobar.sparseimage. Select that file, and then do File: Get Info. As before, temporarily change the owner to admin. Now, before doing anything else, make a copy of the foobar.sparseimage file in a safe place in order to back it up.

Next, rename foobar.sparseimage to foobar_old.sparseimage. Double-click it to mount it. You will be prompted for foobar's password. Enter it, and a drive image named foobar should mount. Rename the drive image to foobar_old.

Open Disk Utility. You can inspect the mounted foobar_old to see what its current maximum size is, in order to help you decide how big to make the new maximum capacity. Select File: New: Blank Disk Image. Set the Format to sparse disk image, the Encryption to AES-128, and the Size to your new desired maximum capacity. Save the new image in /Users/foobar/ as foobar.sparseimage. When prompted for a password, you must enter foobar's password, otherwise the home directory will not mount properly when foobar logs in.

Once the new foobar.sparseimage is created, double click it to mount it. Now, launch Carbon Copy Cloner, and copy everything from foobar_old to foobar. Finally, unmount foobar and foobar_old. Remove foobar_old.sparseimage from /Users/foobar, and keep it someplace safe as a backup. Select the new foobar.sparseimage, and choose File: Get Info. Set the Owner to foobar. Do the same for the /Users/foobar directory to return ownership to foobar.

Now, log out of admin and log back in to foobar. That's it! You now have more available space in your FileVault protected home directory. If anything went wrong, you can restore your backup foobar.sparseimage into /Users/foobar using your admin account.

NOTE: When I followed this procedure, there was one hiccup. Suddenly any time I tried to delete a file that resided in my FileVault protected home directory, I would get a message telling me it would be deleted immediately, instead of simply being placed in the trash can. The problem was that the ".Trash" directory was missing from my home directory, and you can find the fix in this hint.

Comments (7)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20060317205945520