Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

From time to time my sshfs mount fails.

All programs using the mount freeze when it happens. I can't even ls anything or use nautilus.

Is there a way to find out what's the cause and how to handle it?

I've noticed regular SSH sessions to the server get their fair share of Write failed: broken pipe disconnects, too.

If I wait long enough (and I'm talking about 20-ish minutes, here) it will auto reconnect and things start working again.

share|improve this question

1 Answer 1

The best method would probably be, presuming the mount point is /mnt/sshfs, to run the following:

umount -l /mnt/sshfs

This is a "lazy" unmount, and can only be run as root. It will immediately umount the sshfs file system and let the kernel clean up the mess after. Be careful not to tab complete it as there's the risk you'll get a freeze if you hit tab once too many times and it tries reading within the mount point!

Give it a min, and you should safely be able to remount the file system again.

Try adding "-o ServerAliveInterval=30" to your sshfs command and see if it stops the freezes. It basically just forces the ssh client to send a packet every 30 seconds to say it's still there. You can also add it to your .ssh/config by adding a line like follows:

ServerAliveInterval 30

I'm not 100% sure if sshfs reads the .ssh/config file though.

share|improve this answer
    
Thanks, gonna try it out now. –  skerit Jan 10 '11 at 1:04

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.