0

I have some sshfs mounts which I want to put in a Linux filesystem location following the Filesystem Hierarchy Standard.

The standard is strangely silent on where network mounts should be placed:

media   Mount point for removeable media
mnt     Mount point for mounting a filesystem temporarily

Mounting under /net could conflict with NFS autofs mounts from the same hostname.

Where is a sensible place to put sshfs mounts given that creating directories directly under / is frowned upon?

  • The filesystem is irrelevant to where you mount something (if you want to follow FHS). What matters is the content, and what you will use it for. – Patrick Apr 15 '17 at 16:20
1

The FHS is defining directory names and usage. Creating a custom directory directly under the root one is considered risky as it might conflict with a future version of the standard or with a new OS owned directory.

Unlike many other Unix and Unix like OSes file system standards (e.g. freeBSD and Solaris), the FHS fails for some reason to define /net as a generic mount point for automounted NFS shares. On the other hand, the FHS defines /mnt and /media for a similar but distinct purposes.

While /media is for locally attached devices like CD, DVDs and thumb drives, /mnt doesn't restrict the kind of device so should theoretically be usable to store your sshfs mount, for example in /mnt/sshfs/xxx, but creating an exclusive subdirectory under /mnt might conflict with existing admin usage so I wouldn't recommend doing it. /mnt is defined to hold file systems temporarily mounted here by the administrator, which doesn't exactly match file systems automatically mounted by a daemon.

There is no way to use /net to store sshfs mounts as autofs configuration is forbidding to have multiple handlers for the same mount point.

As auto.smb is suggesting /cifs for its root mount point directory, I would simply use /sshfs. The risk for /sshfs to clash in the future with an OS owned directory is essentially zero.

Excerpt from the auto.smb manual page:

# Put a line like the following in /etc/auto.master:
# /cifs  /etc/auto.smb --timeout=300

Excerpt for the auto.master default configuration file:

# NOTE: mounts done from a hosts map will be mounted with the
# "nosuid" and "nodev" options unless the "suid" and "dev"
# options are explicitly given.
#
# /net  -hosts
0

As Patrick wrote in a comment, the filesystem is irrelevant to where you mount something (if you want to follow FHS). What matters is the content, and what you will use it for. Actually, the type of the filesystem (whether it is sshfs or NFS or ext4 or anything else) is even more irrelevant.

Where does the content below the mountpoint that you are mounting belong in the filesystem tree? Mount it there.

If you are talking about ad-hoc sshfs mounts performed by individual unprivileged users for casual access to files on remote systems (as opposed to, say, something configured in /etc/fstab), those users can put them wherever they like, such as an ad-hoc directory under their home directory (which is a likely and obvious place where unprivileged users have permission). The FHS or indeed indeed local sysadmin policies (quite correctly) don't have anything to say about that.

  • The file system is irrelevant to the standard but not to the automount program configuration files. The question is about generic mount point locations. What the file system mounted there contain is irrelevant, just like what contain file systems mounted under /mnt or /media. – jlliagre Apr 15 '17 at 22:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.