30

In FHS-2.3, we have /media that holds mount points for removable media such as CD-ROMs and we have /mnt that holds temporarily mounted filesystems.

On the other hand, we have /run/media and /run/mount. For me, the CDs and USBs are mounted on /run/media.

I don't see any clear distinction between them(/media, /mnt, /run/mount) . What are their differences?


I have seen similar trend (mount on /run/media) in fedora 20 - GNOME 3.10.4 and ubuntu 14.04.1 (installed on virtual box) with GNOME 3.10.4. But when I plugged in a USB flash (with auto-mounter script) on a system with Centos 6 and GNOME 2.28.2 it was mounted on /media

SRYZDN
  • 1,079
  • 3
    The /run/mount/ thing happens when you use some kind of auto-mounter script - it mounts the disk in a user-owned directory. /media and /mnt are root-owned usually - so there's that at least. – mikeserv Dec 31 '14 at 12:12
  • 1
    udisks2 mounts to /run/media and the older udisks mounts to /media... See also What is this new /run filesystem? – jasonwryan Jan 03 '15 at 00:10
  • Why would I mount anything in root? That would require applications and Terminal sudo to be able to write to the. Why not just use home? I'm mounting a folder from local network. – Shayan Sep 28 '19 at 09:05

2 Answers2

15

FHS v2.3 was released ten years ago. Some things have changed since then (including the introduction of /run1). About three years ago, the Linux Foundation decided to update the standard and invited all interested parties to participate.
You can view the v. 3.0 drafts here and the section that describes /run here.
The distinction between /media and /mnt is pretty clear in the FHS (see Purpose and Rationale), so I won't go over it again. Same for the purpose of /run - see links.

The Gnome story is yet another thing. Gnome uses underneath an application called udisks (replaced later by udisks2) to automount drives/devices. For quite a long time, udisks default mounts were under /media. In 2012 the devs decide to move the mounts to /run/media (i.e. a private directory). So the different behaviour you're experiencing there is caused by the different versions of udisks that each DE is using.

1: see
What's this /run directory doing on my system and where does it come from ?
What is this new /run filesystem ?

don_crissti
  • 82,805
2

FHS states that /media is for users and /mnt is for admins. Furthermore, it forbids adding user mounts into /mnt since that was a common practice before /media was created.

/run is the replacement for /var/run. Those directories are for changes made to the system since boot and should be cleared on each boot. Since mountable media is something that gets cleared on boots some utilities use /run.

It would be nice if a future FHS addresses these differences by mandating that media is moved to /run or that media is not put in /run. I'm hitting these on different systems too and I'll have to code around it.

Details at: http://www.linuxbase.org/betaspecs/fhs/fhs.html#mediaMountPoint

BlueManCZ
  • 1,753
  • 1
  • 13
  • 31