I would like to use a case-sensitive and encrypted disk-image for my development work. I need some folders inside it to be Dropbox-ed (using symlinks). However if I accidentally unmount the dmg, Dropbox erases everything in the cloud.

Therefore I need to prevent unmounting of this disk image (mounted at boot). Ideally it would require my session password when I click on the eject icon in the finder. Any ideas?

link|improve this question

50% accept rate
Cheap solution, but you could just put any small app (probably a dummy workflow) on that disk image, and start it. Finder won't unmount unless that app is quit. – slhck Nov 21 '11 at 12:33
1  
A workaround could be to mount the dmg with hdiutil attach -nobrowse some.dmg. It would only be shown in /Volumes/, not in Finder's sidebar or on the desktop. – Lri Nov 21 '11 at 14:17
hdiutil attach -nobrowse some.dmg seems really interesting, tried to drag back the iso to the tabbar but it adds back the eject button. I guess i could find my way with symlinks somehow. – olouv Nov 22 '11 at 22:58
feedback

2 Answers

If I were you, I would mount it as an escalated user (root)

You can indeed use sudo to mount a device in OSX. I have not had a chance to see if it behaves the same way as in Unix because I dont have OSX. This should indeed force you to enter the password again to unmount it, correct?

At that point file permissions need to be set correctly. But it should not be unmountable except by an escalated user or issuing sudo.

link|improve this answer
sudo hdid android.sparsebundlecan be unmount without elevation :(. Maybe there is another way/cmd to mount the drive but i guess it would not change that elevation thing... Was worth a try, thanks anyway ;). – olouv Nov 22 '11 at 22:55
Thats what i was afraid of man. I know it works this way in *nix. but a lot was simplified and changed in osx. If I can come up with a solution ill keep you updated. good luck – steve Nov 22 '11 at 23:24
feedback

You could do it the other way around - Keep the files in Dropbox and symlink them into your encrypted disk. Then Dropbox won't delete the files when you umount the disk and you still can access the files from your dev env.

link|improve this answer
1  
Probably due to missing case sensitivity of the main partition. File names will conflict. Assuming missing encryption is not an issue. – Daniel Beck Nov 23 '11 at 7:00
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.