Back in November 2020 (oh my god this blog/gemlog has lived for a long time now) I wrote about how I used sshfs and autofs to automatically mount servers that I have ssh access to as local filesystems when needed.
Over the years I've run into some trouble with this, surprisingly. When I've been offline it's sometimes taken several minutes to log in, unless I disable the autofs service. I can only assume that some process tried to check through my home directory and had to wait for autofs to time out for each remote server it tried to mount, but which process or why remains a mystery. This was not a problem I had back then, mind you. It started later; probably due to some upgrade.
I was hardly ever offline, however, so the problem wasn't very big.
Now that I've gone back using a very old laptop that's already slow I decided that mounting the remotes when needed is something I can do manually.
Still... I'm a little too lazy to do that... Usually I need at least two of the four I have configured. Why not mount all at once, right?
So this is what you do (on Linux/BSD):
$ sudo apt-get install -y sshfs # Or corresponding command for your package manager of choice
$ mkdir -p ~/.local/bin $ echo 'export PATH="${PATH}:${HOME}/.local/bin"' >> ~/.bashrc # or corresponding setting for your shell of choice
$ mkdir -p ~/Remotes/{acc,fileserver,home,team}
#!/bin/bash USAGE="Usage: ${0} [u|m] u Unmount predefined remote volumes. m Mount predefined remote volumes." TARGETS="fileserver home acc team" if [[ ${1} == "m" ]]; then for remote in ${TARGETS}; do sshfs ${remote}:. ~/Remotes/${remote} done elif [[ ${1} == "u" ]]; then for remote in ${TARGETS}; do fusermount3 -u ~/Remotes/${remote} done else echo "${USAGE}" fi
=> "Mount Your Tilde", 2020-11-12 (gemlog only)
-- CC0 ew0k, 2022-06-20
text/gemini; lang=en
This content has been proxied by September (ba2dc).