52

According to Wikipedia

http://en.wikipedia.org/wiki/Unix_directory_structure

http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

extra disks should not be mounted in /mnt/ according to the first link, but doesn't seams so according to the second link.

Both say thought that they shouldn't be in /media.

Question

So where should extra permanent disks be mounted?

Sandra Schlichting
  • 810
  • 1
  • 10
  • 13
  • 2
    The reason for avoiding /media is that that's where (for instance) udisks will put automatically mounted devices, so if you put things there then you might clash with it. –  Jan 14 '12 at 16:42
  • I think /media is more trendy these days. People used /mnt way back before there was this concept of USB drives and hot-swapping. – djangofan Jan 20 '12 at 18:24
  • 9
    /mnt is itself intended as a point where filesystems can be mounted *temporarily* by the system admin. If you obey this recommendation, then you wouldn't mount anything permanently in there. But similarly, /media is intended to contain mount points for *removable* media. If the user cannot "eject" or "remove" it then it *probably* doesn't belong in there. Which still leaves the question of where to mount permanent additional drives. – trr Oct 12 '12 at 04:56
  • 2
    I filed a bug to the FSF. https://bugs.linuxfoundation.org/show_bug.cgi?id=1432 – Yaroslav Nikitenko Dec 10 '18 at 15:47

4 Answers4

24

Extra disks are typically mounted in a directory called /media/something where the something reflects the mounted device, e.g. /media/cdrom0 for the first CD-ROM device. This convention is widely followed under Linux for removable devices, and often but not always for permanent devices.

The FHS forbids distributions from using directories under /mnt because some administrators use /mnt itself as a mount point for temporary mounts. If you're the administrator, you can do what you like; just don't use /mnt itself as a mount point if you create directories under it.

Many places have their own convention. Some automounters have their own directory or directories (configured through /etc/fstab and /etc/auto.*); /amnt or /auto are typical names. Network mounts are often put under /net/$machine_name. Some places just use whatever went through the administrator's mind: /data, /local, /scratch, …

Of course, filesystems that have a specific place in the directory structure should be mounted there. For example, the mail partition is normally mounted directly on /var/mail or /var/spool/mail. If your home directories are spread between several disks, it's typical to mount them underneath /home, e.g. ~alice = /home/disk0/alice and ~bill = /home/disk1/bill and so on, if you want to expose the different disks in home directories. If you don't, then mount the home partitions wherever you like and create symbolic links or automounts in /home.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
20

According to the FHS link that you gave

 /mnt/  Temporarily mounted filesystems.

So I assume that you must mean permenantly mounted non-root non-system (meaning not /var/log or similar) filesystems.

I've always put them in /mnt/fsidentifier and then symlinked to then where needed.

So for instance, I had /mnt/website at one point, /mnt/appdata, /mnt/whatever, then symlink that. I never mounted anything directly to /mnt

If you wanted a "clean" solution, you could write a script to take the UUID of the filesystem, create a mount point for it (under /mnt or wherever you wanted), then mount the filesystem to the mountpoint.

Matt Simmons
  • 1,040
  • 8
  • 14
16

Wherever you like and where it makes the most sense for you. I have seen countless variants.

Myself, I usually mount them at /data0, /data1 or subdirectories below /data and put symlinks to the appropriate places (like /home).

Sven
  • 2,417
  • 19
  • 15
  • 2
    The [FHS is dark about creating directories under `/`](http://www.pathname.com/fhs/pub/fhs-2.3.html#THEROOTFILESYSTEM) – Tom Hale Apr 15 '17 at 04:38
  • @TomHale Where exactly is it dark? Let me emphasize here that mount points doesn't take much space from rootfs. And that we're talking about user, not application here. – x-yuri Aug 18 '18 at 00:34
  • @x-yuri Good point. The 2nd "Rationale" section applies to applications. However, if you're administering some other user's system, it's easier to find things if they're in standard places. – Tom Hale Aug 19 '18 at 08:51
  • 2
    @TomHale The thing is there doesn't seem to be a standard place. `/mnt` is for temporarily mounted filesystems. `/media` for removable devices. `/srv`? I can't agree, unless you give a quote that justifies your other comment. What I agree on is that there'd better be such a place. – x-yuri Aug 19 '18 at 13:12
3

SuSE had /srv as generic mountpoint for server-related stuff.

/var/lib/yourapplication seems to be a standard, too.

Since I use the automounter with fixed entries for these things, I tend to use /automnt.

The media automounted by UDEV (/media) is being redirected through CLAMFS (for virus scanning) to /extern on my workstation.

So short - there is no real standard - it`s up to you.

Nils
  • 18,202
  • 11
  • 46
  • 82