Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I've got a pretty specific need - to disable unmounting a network drive through the regular Finder eject function (accessed either by right-clicking the mounted drive on the desktop, or clicking the eject button in Finder). This is on OS X 10.8 Mountain Lion.

Basically I need to stop other users of the Mac unmounting a drive volume. I'm happy if unmounting is still possible by other means (terminal etc.) My users do not purposefully eject the drive, it's usually accidental - e.g. when trying to eject a USB drive, or just a mis-click. I'd like to prevent the ejecting/unmounting entirely.

Anyone have a way to do this? Have been searching for a while, never found a solution.

Edit 1: I should also note this is an smb network drive, but may also need same function for an afp drive

Edit 2 [9/1/13]: I had another idea, albeit problematic. With defaults write com.apple.finder ProhibitEject true I can disable ejecting any volume completely. Unfortunately this won't do in my circumstance, I need users to be able to plug in portable USB drives.

share|improve this question
    
Given that this will likely involve permissions at some point, what are your users required to do on the drive? Eg. just read files, write files, etc. –  Alex Dec 18 '12 at 4:21
    
Your post leads me to assume your "unmountable" network drive is only needed on one Mac, and others use this same Mac as you do. Do you use separate user accounts (one per user) or an account for you and another for everyone else? If everyone uses one account, is it safe to assume it is also configured as an administrator? Can your environment or workflow realistically accept multiple user accounts? –  TomUnderhill Dec 18 '12 at 4:48
    
thanks guys, some more info: @TomUnderhill - your right, I can/do use different accounts, one for sysadmin and one for the user. So ejecting could be restricted for regular user accounts if possible Alex - just read. essentially the drive needs to be always available for the users to read and for certain automated syncing functions to work. –  Ross Richardson Dec 18 '12 at 5:13

2 Answers 2

You could open a terminal window and change to the network path so that the file system is marked as in use. You could also open a file or application on the drive.

The users might still choose to force eject, so it's not a proper ban on ejecting the volume, but it adds another roadblock.

share|improve this answer
    
thanks @bmike, that was a thought and possibly a last resort should there be no other way. A slightly more savvy yet unaware user may shut down the terminal too. People will always find a way to stuff things up :) –  Ross Richardson Dec 18 '12 at 5:17

You can mount share via command line using mount_smbfs(8):

# mount -t smbfs //user@server/sharename /path/to/share/directory

This directory can't be unmounted from Finder directly and user have to unmount it explicitly:

# umount /path/to/share/directory
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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