Purpose of /net directory

5,066

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.

Share:
5,066

Related videos on Youtube

Tom Hale
Author by

Tom Hale

Updated on September 18, 2022

Comments

  • Tom Hale
    Tom Hale over 1 year

    I notice on my system (Manjaro Linux) that:

    1. I have an empty directory named /net
    2. 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 (eg sshfs, nfs) mountpoints?

    Or, in other words, is it like /media, but for non-removable non-temporary mount points?

  • jlliagre
    jlliagre about 7 years
    @Kusalananda Yes but amd standard configuration is to mount on /a, not /net which is autofs standard mount point. I assume the OP machine is running autofs, not amd.
  • Tom Hale
    Tom Hale about 7 years
    Thanks, I've not played with autofs. What happens if there is already a sshfs /mnt/hostname mounted there?
  • jlliagre
    jlliagre about 7 years
    /mnt and /net are different directories and sshfs and NFS 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
    Tom Hale about 7 years
    Sorry I meant to say: What happens if there is an existing sshfs /net/host mounted and autofs wants to mount host's NFS directories?
  • jlliagre
    jlliagre about 7 years
    You 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.