How to forceably unmount stuck network share in Mac OS X?
Solution 1:
Other than seeing a folder with that name in /Volumes, how do you know that the remote share is still mounted? Does mount
or diskutil list
still show it as mounted? If not, then what you've got is not a stuck mount, but a mountpoint directory that was left behind after the remote share went away unexpectedly. If there are any files in that directory, they exist on your local boot drive, and were probably written by whatever processes were running on the iMac that had been working with that share.
If this is the case, then you can fix it just by moving aside the left-behind directory and files:
sudo mv /Volumes/Work\ Space ~/Desktop
...and then re-mounting your remote share.
But if mount
shows the remote share still mounted, well, that kind of state doesn't survive a reboot, so unless you're in some situation where you don't want to reboot, I'd say just reboot the iMac.
Solution 2:
First try sudo umount -f YOURDEVICE
if it does not work, delete the entry in /etc/mtab
, if this file exists on MacOS. The file should normally get updated automatically, but maybe it got corrupt.
If editing is impossible delete it with rm -f
. It should be recreated.
Solution 3:
I'm on Mac OS 10.12.2 Sierra and the above didn't work. What did work was:
- In a terminal, I ran
sudo umount -Af -t nfs,smbfs
- Then I changed to the
/Volumes
directory (cd /Volumes
) and removed the residual mount point folders. The folder name(s) will be different depending on the name of the folder(s) you had mounted but my folder was calledAthena
so I didsudo rm -rf Athena/
after verifying that folder was empty withls Athena/
. If you've mounted the folder multiple times there may be other residual folders with names likeAthena-1/
,Athena-2/
, etc. which should be removed as well. - Then try reconnecting to the share in Finder and it should be successful.
I also unchecked "Connected Servers" in the preferences for Finder (I'm not sure if this had any effect).