Purpose of /net directory
Yes, it is very similar to /mnt
and is designed to contain nfs
shared directories from remote hosts.
If there is a NFS server named nfsserver
sharing a directory named shared-directory
, you can access it just by listing or reading files in /net/nfsserver/shared-directory[/filepath]
.
This featured is provided by the automounter, was first implemented by Sun Microsystems in SunOS 4 (1988).
Unlike Linux, Solaris is documenting it in its file system hierarchy standard documentation:
$ man filesystem
...
/net
Temporary mount point for file systems that are mounted
by the automounter.
Note that the /net directory is not hardcoded and you can select a different one by editing the /etc/auto.master
or /etc/autofs/auto.master
configuration file. See for example this documentation page.
Note also that the same mechanism can be used to automount CIFS or fuse based (e.g. sshfs) file systems shares. See this Gentoo wiki page or that Ubuntu documentation one.
Related videos on Youtube
Tom Hale
Updated on September 18, 2022Comments
-
Tom Hale over 1 year
I notice on my system (Manjaro Linux) that:
- I have an empty directory named
/net
- This directory is not mentioned in the Filesystem Hierarchy Standard
What is the intention behind this directory (quoting chapter and verse)?
Is it like
/mnt
(which is for temporary mounts) but for network (egsshfs
,nfs
) mountpoints?Or, in other words, is it like
/media
, but for non-removable non-temporary mount points? - I have an empty directory named
-
jlliagre about 7 years@Kusalananda Yes but
amd
standard configuration is to mount on/a
, not/net
which isautofs
standard mount point. I assume the OP machine is runningautofs
, notamd
. -
Tom Hale about 7 yearsThanks, I've not played with autofs. What happens if there is already a
sshfs
/mnt/hostname
mounted there? -
jlliagre about 7 years
/mnt
and/net
are different directories andsshfs
andNFS
are different protocols. Nothing particular would happen if you use both methods to access the same shared directory. That would gave you to different paths to the same data. -
Tom Hale about 7 yearsSorry I meant to say: What happens if there is an existing
sshfs
/net/host
mounted and autofs wants to mounthost
's NFS directories? -
jlliagre about 7 yearsYou can't have both sshfs and NFS configured to handle the same mount directory. You have to select different ones in the
auto_master
file.