A lot of people have been having problems with FileVault lately. I'm one of them, and ended up doing a clean reinstall of Panther due to corruption. Speculation is that the cause of FileVault's problems is that it uses a sparse image. I wondered if FileVault would accept other types of disk images. Sure enough, it did. Here's how to convert your encrypted home directory to a different type of image and possibly prevent corruption.
First of all, I can't guarantee that this will prevent corruption, or that it won't cause other problems. The total amount of time I've tested this so far adds up to less than 30 minutes. There is also one limitation that it has compared to the sparse image which I'll detail below. The normal caveats (backup your data, use at your own risk, don't blame me, etc.) also apply. You will need a user with root access. I've done this using sudo and an administrator account, but the root user and single-user mode should work too.
[robg adds: Before you read the rest and try this hint, it's worth repeating: have you backed up lately?! With the release of 10.3.1, the corruption issue may be gone, but I figured folks might want to experiment with other disk image formats ... at their own risk, of course!]
Log out of the account that you want to convert and get root access. Open a Terminal and go to the user's home directory. If you do an ls, you'll see a file called shortname.sparseimage. The user I tried this on had test for a shortname, so that's what I'll use for the rest of the hint. You should record some information in case you want to convert back to a sparse image later. Type hdiutil imageinfo test.sparseimage. A dialog will pop up asking for the password to the image every time you run hdiutil. Use the user's password. If you're using sudo, don't forget you need to enter your own password in the terminal first. A lot of stuff scrolls by, but fortunetly the last line is the one we're interested in. Write down the number of total bytes and keep it somewhere safe.
The next step is to resize the image. This is the major limitation of this hint. I think the reason that Apple uses a sparse image is because it is dynamically sized. That means that your home's disk image doesn't take up any more space than it needs. None of the other image types, as far as I can tell, are able to do this. You will need to create a fixed size image. The problem is that if you run out of free space in your home directory but still have free space outside of it, you're out of luck, and vice versa. It's up to you to decide how much space you want in your home directory. There really is no good way to decide how much it should have. Once you have decided, enter this line:
hdiutil resize -size 10g test.sparseimage
Replace the 10 with however many gigs you want, or use an m instead of a g if you want to specify the size in megs. Now it is time to create the new image. Creating the image will require as much space as you specified in the previous step. Since you hopefully specified it to be less than the free space you already have, that shouldn't be a problem. Enter this line:
hdiutil convert test.sparseimage -format UDRW -o test -encryption
Enter the password for the current image, and then when prompted for the new password enter the same one again. Now get some coffee, go for a walk or repaint your house, because this is going to take a long time. It's done once the dots are all the way across the terminal. Once it's done creating the new image, rename the old one temporarily:
mv test.sparseimage test.sparseimage.bak
Then put the new image in its place:
mv test.dmg test.sparseimage
There's one more step before putting this to the test. Just to make sure there are no problems with permissions set the new image to be owned by the user:
chown test.test test.sparseimage
Now log in as the user and if all went well, your new encrypted home should be mounted. If you were having corruption problems before, see if it still happens. Once you're satisfied that the new image is working fine, you can delete the old one. One note: you will still get the dialog about recovering space when you log out. I don't think what it says is true any more, but it doesn't hurt to click continue.
% mv test.sparseimage test.old.sparseimage % hdiutil convert test.old.sparseimage -format UDSP -o test -encryptionFind out the original size of the sparse image. Remember the total bytes you wrote down as the first step?
% hdiutil resize -size 75161965568b test.sparseimage % chown test.test test.sparseimage % rm test.old.sparseimageIf anybody can figure out how to make File Vault mount a UDZO type image read/write, then this will be almost perfect as a replacement for the sparse image. If this turns out to not prevent corruption, note you can also use this to create read-only images, which might be useful for public computers. Check the man page for hdiutil to see the different image types you can use.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20031104223355900