FileVault

smat

Registered
hi,
is it possible to use FileVault on another disk as the user directory?
e.g. i have 2 disks; system and data, my userdir on 'system' is filevault enabled and now i want to secure my 'data' disk, so that osx opens the sparseimage on 'data' and hides the originally disk, so that i only see my opened sparseimage ..
or if any knows a other solution to secure disks under osx - please say .. :)
thank you all!
- smat
 
well, you could mount the image in place of the disk with the command

hdiutil attach /Volumes/otherdisk/data.sparseimage -mountpoint /Volumes/otherdisk/

That would still ask you for a password though (you might have to add a flag '-stdinpass' to specify that it should prompt for a password)

I suspect that you could put the password into a script in your home directory (which would be encrypted when you're logged out), and have that script run on login. Not ideal, since you then have passwords lying around in plaintext whenever you're logged in, but better than nothing. The best would be if there were a nice commandline utility to get the password from the keychain, but I can't find such a thing...

e.g.
hdiutil attach -stdinpass (yadda yadda) << END
password
END
 
... because when i use that mountpoint, it will cause that the originally drive is not accessible, but that must be accessible for the sparseimage to write/read ...
;)
any other choice/idea?
 
That's how filevault works though, isn't it? your actual home directory on the HD contains only one file, the .sparseimage file. When you log in, the system opens the file, and then mounts it over top of your home dir, so you can't see the .sparseimage.

This comes back to something a little tricky in the way Unix OSs work. Once a file is opened by a process, it can become inaccessible from the file system, but the processes that have it open don't lose it. No new processes could find it to open it, but the process that had it open already can still use it.

Actually, some programs handle temporary scratch files in this way - open a file, then delete it from the file system. The file isn't accessible for new programs to open, but it doesn't go away right away, because the program that created it still has it open for reading and writing. Then the program doesn't have to worry about cleaning up its old scratch files - as soon as the program quits, the last "handle" on the file is dropped, and the operating system goes ahead and deletes it.
 
Oh. Whoah. Teach me to give advice without trying things out... I tried it. Finder never crashed, but it refused to mount the disk image over top of the real disk entry in /Volumes

I could of course mount the sparseimage to a new /Volumes entry. Doesn't actually hide the drive it's kept on, but if the only thing on the actual HD is one .sparseimage file (or a number, for individual users), you can mount the image on login, and keep all your data on the mounted image. You'd still have to take care of automatically unmounting the image on logout, but that should be feasible with a small applescript or similar.

Incidentally, you do know you can put the password into your keychain when you create it, right? If you don't specify -stdinpass then it checks the keychain, and if nothing's there, pops up a GUI prompt...
 
Back
Top