Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My coworker has a desktop computer with /home shared on our file server. I have developed a Perl script for sshfs-mounting a certain directory on another SSH host which works fine on my laptop.

On his computer the script fails to dismount the sshfs at the end and leaves the mountpoint unclean. I didn't find any way to recover the mountpoint other than rebooting. After some testing I found that the difference between our setups is that his /home is on NFS. In his /tmp it works flawlessly.

After mount, during script operation everything is fine. But when killing the sshfs process it is listed as <defunc> by ps until the parent process (the Perl script) exits. When running a raw sshfs command on the shell the problem still occurs.

A ls -dl output for the mountpoint looks like this (as remembered - I have no real copy of the shell output at hand):

? 1 ? ? 4096 Feb  9 15:37 file_archive/

(only question marks for most information, at least all permission details)

The sshfs mount is still listed by mount but an unmount operation fails with error permission denied even when doing as root.

I searched Google but only found lots of comparisons between sshfs and NFS for running network filesystems. How can I do a sshfs mount/unmount in NFS directory safely?

share|improve this question

You should be able to unmount the sshfs share by executing:

 fusermount -u /path/to/sshfs/share
share|improve this answer
I tried this but got permission denied. Of course an ordinary umount must fail when run as non-root user. – Daniel Böhmer May 30 '11 at 15:16

Just kill the process using pkill to and then un mount the mounted folder path.

 pkill -kill -f "sshfs" && umount /path/to/sshfs/share
share|improve this answer
sudo diskutil umount force ~/mount/

Seems like this command works in OS X.

share|improve this answer
Can you expand your answer to explain what this code does and how it addresses the problem? Unexplained code is discouraged, because it doesn't teach the solution. Thanks. from review queue – fixer1234 Feb 13 at 18:43

Your Answer


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.