libfuse / sshfs

A network filesystem client to connect to SSH servers
GNU General Public License v2.0
6.02k stars 494 forks source link

MacOS umount and mount command freeze or hang after failed SSHFS command. Computer restart required to fix lag on entire OS. #299

Closed inboxcda closed 7 months ago

inboxcda commented 7 months ago

MacOS umount and mount command freeze or hang after failed SSHFS command. Computer restart required to fix lag on entire OS. I am curious if anyone know what process I need to kill when a failed mount happens. I consistently get a bogged down finder and terminal apps stops responding after a failed sshfs mount attempt.

When sshfs fails, I then use the mount command to see if anything is still mounted. But the mount command hangs and does not return. I have to force quit my terminal and reopen it. But sadly it doesnt open after that so I have to restart mac. The mount command exits successfully before I run the sshfs command but it freezes if I run it after running the sshfs command and it fails. Any idea?

bfleischer commented 7 months ago

This sounds like a macFUSE issue, that has been addressed in version 4.6.2. Which version of macFUSE are you using?

inboxcda commented 7 months ago

Thank you for the reply! My apologies for the delay. I am using macFuse 4.6.0 which I downloaded directly from https://osxfuse.github.io/

I see the new version and will install that and do some tests. Thank you for the information!

Side question: Is there an easier way to install macfuse via command line rather than using a dmg? I would prefer to automate this install and update process for my team.

bfleischer commented 7 months ago

Side question: Is there an easier way to install macfuse via command line rather than using a dmg? I would prefer to automate this install and update process for my team.

You can extract the installer from the disk image, copy it to your team's Macs and use the installer command in Terminal to run the installer.

Alternatively, you can run the following command to update macFUSE.

sudo /Library/PreferencePanes/macFUSE.prefPane/Contents/MacOS/autoinstall-macfuse-core --install

Please note: This command will change in the future. Rewriting the update mechanism is on the roadmap.

inboxcda commented 7 months ago

Wow that's fantastic thank you!! I'll do some validation in the event that the command doesn't exist in the future so my script will handle it accordingly. Thank you.

I don't know where else to ask questions so my apologies for asking them in this issue post.

Last question. What is the proper way to unmount a drive? I have SSHFS and MacFuse installed and my script mounts with SSHFS and unmounts with umount. My problem is that the umount command always leaves remnants of the mount unless I run umount -f. Is there a MacFuse or SSHFS command I'm supposed to use for unmounting safely and entirely? I've looked for the documentation but I don't see anything about unmounting with SSHFS or MacFuse.

Lastly, I'm grateful for all the work that's been put into MacFuse and SSHFS. Thank you for all the time and effort you've put into it. An awesome utility for sure!

bfleischer commented 7 months ago

The correct way to unmount a volume on macOS is calling the umount ... or diskutil unmount .... Unmounting will fail in case a file on the volume is still open. The lsof command can tell you which file on the volume is still open. By using the force option (-f) you risk loosing unsaved data.

Feel free to open a ticket in the macFUSE issue tracker for macFUSE issues.