LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to unbind/rebind paths over sshfs without disconnect/reconnecting the network (https://www.linuxquestions.org/questions/linux-networking-3/how-to-unbind-rebind-paths-over-sshfs-without-disconnect-reconnecting-the-network-4175653699/)

BryanFRitt 05-10-2019 06:12 PM

How to unbind/rebind paths over sshfs without disconnect/reconnecting the network
 
How to unbind/rebind paths over sshfs without disconnect/reconnecting the network?

I mounted a sshfs directory, then binded directories within that.
If I unbind the binded mount points and then try to rebind them, they fails to rebind.
However, if I disconnect the network, and reconnect, the rebinding will then again work.

Code:

# shorting down the script, here's what I'm doing...

# mount the main sshfs directory
sudo sshfs -p "$RPORT" -o follow_symlinks -o allow_other -o IdentityFile="$RSAKEY" -o reconnect "$RFSUSER@$url:/" "$MAINMOUNTPOINT"

# bind the subdirectory
sudo bindfs "$MAINMOUNTPOINT/media/$drive" "/media/$drive"

# unmount the subdirectory bind, etc...
sudo umount "/media/$drive"; sudo umount "$MAINMOUNTPOINT" # followed by the sshfs command above

# try to rebind it again... fails to rebind, no error message
sudo bindfs "$MAINMOUNTPOINT/media/$drive" "/media/$drive"
# disconnect then reconnect the network, and try again... command succeeds


ondoho 05-12-2019 12:17 AM

i don't know about the bind/unbind bit, but back when i was still using sshfs (i long since switched to NFS), i had sth like this:
Code:

# mounting:
sshfs -C -o "$sshfs_options" "$location" "$mountdir"
# unmounting:
fusermount -u -z "$mountdir"



All times are GMT -5. The time now is 06:27 PM.