158

It seems to me that having both /mnt and /media is a little redundant. Is there any tangible difference between the two that I'm not aware of?

Is there a standard that most people follow for where to mount things, e.g. use one for certain types of devices, or is this completely subjective?

goric
  • 3,816

5 Answers5

131

The new standard is that /media is where the system mounts removable media, and /mnt is for you to mount things manually.

See the filesystem hierarchy standard (FHS) for details.

Mikel
  • 6,558
  • 3
    By the way, that website link is unclear about the purpose of /mnt in this context. – djangofan Dec 01 '11 at 16:01
  • 2
    It says /mnt is for the system administrator. This implies that /mnt should not be used by the system itself. So if your computer automatically mounts a CD or DVD, it should mount it in /media, not /mnt. – Mikel Jan 26 '12 at 01:23
  • 1
    I certainly agree with that (with you), but the article didn't explicitly say that. – djangofan Jan 30 '12 at 17:32
  • 19
    if /mnt is for temporary and /media is for removable where should permanent non-removable devices/partitions be mounted. i.e. an internal HDD which is formatted as NTFS but needs to be automounted at startup? – Caltor Oct 17 '12 at 13:48
  • 2
    Without re-reading the spec, I'm pretty sure that since nothing else should use that drive unless explicitly pointed there, you can mount that drive's partitions anywhere you like, e.g. /data or /a. – Mikel Oct 18 '12 at 13:05
48

Another important difference not mentioned yet is that devices mounted under /mnt will not appear in Nautilus' left pane, whilst those mounted under /media (as well as auto-detected devices that are not mounted yet) will.

So for example, if you don't want a certain partition to appear in the "Devices" subsection of Nautilus' left pane, you should create a subdirectory for it under /mnt, write an entry for said partition in your /etc/fstab (or do it through the Disks utility) and assign the newly created directory as its mount point:

/dev/{block_device_name)   /mnt/{descriptive_name}   {fs_type}   {mount,options}  0 2

Even better, add the noauto mount option in fstab/Disks and then your partition won't appear in Nautilus nor will it be mounted (preventing accidental mess with its files)! So for example, in the case of a dual-boot with Windows you could have:

/dev/sda1   /mnt/win7   ntfs-3g   rw,user,noauto,gid=100,uid=1000,nls=utf8,umask=002   0 0

in your /etc/fstab, and hence have your Windows partition not showing up in Nautilus (but still accessible through the mount command if you ever need it).

Here is a screenshot I made with a liveUSB, showing all three cases: Nautilus displaying unmounted/mounted devices that go to /media but not to /mnt

  • auto-detected devices not mounted ("16 GB Volume" /dev/sdb1)
  • devices mounted on a /media subdirectory and showing up in Nautilus ("iso" /dev/sdb2)
  • my Windows partition /dev/sda3 mounted on /mnt but not showing up in Nautilus left pane (it would be the same if it wasn't mounted since I have an entry for it in my fstab).

On the contrary, I want my shared data partition to show up in nautilus, so I assigned a /media mount point to it and set the auto mount option, so I can just click on Data and access it from the GUI.

To me this is THE big difference between those two directories, that I learned about when trying to do just what I explained ;-)

neitsab
  • 597
  • 2
    I'd add that if one wants Nautilus not to show some mount outside of /mnt/, they have to specify a flag x-gvfs-hide when mounting it. E. g., here's how it could be done inside fstab file:

    /mnt/my-drive/path/to/my-folder /home/my-username/my-folder-shortcut none bind,x-gvfs-hide 0 0. To me this is THE big deal. If you agree it's a useful hint, I'd appreciate if you append it to your answer.

    – whyer Oct 28 '18 at 19:06
  • Also of note: It seems that Nemo does the same and ALSO detects network mounts in your home directory. Though, I personally find that a little nauseating. IMO /media/whatever is a little cleaner. – musicin3d Jul 07 '20 at 03:31
14

As I understand it, /media is for mounting things like optical drives and other temporary media, where /mnt is usually for permanently attached storage (generally internal disks).

Of course, you can also mount a device anywhere you want... the /mnt and /media directories are more conventional though.

kiswa
  • 241
  • 3
    You understand it incorrectly! /mnt is proposed as a place for users to manually mount temporary resources, whereas /media should be used for static/automatically mounted devices. Check freedesktop.org – underscore_d Oct 05 '15 at 17:40
13

/mnt was already accepted as a place to manually and temporarily mount external media. The /media directory was created as a place under which multiple media, external or otherwise, could be automatically mounted.

psusi
  • 37,551
  • 1
    I can't help but notice that your answer and kiswa's answer are exact opposite. So, who is right?? The website Mikel provided isn't clear enough. – djangofan Dec 01 '11 at 16:02
  • 3
    @djangofan, mine ;) – psusi Dec 02 '11 at 02:29
  • @djangofan, they don't seem exactly opposite to me. One emphasizes permanent vs. temporary while they other emphasizes manual vs. automatic. They do disagree in the overlap just on the point of whether the /mnt directory should be permanent vs. temporary. However, considering that most permanent storage would presumably be manual, I personally am assuming this answer is more correct and @kiswa was just a little less precise on that point. But, IDK - I came with the same question and I'm not expert in this area. – combinatorist Oct 22 '23 at 21:26
5

This thing goes deeper: I like to keep internal drives mounted on /mnt, and external removables on /media.

This post illustrates a difference in functioning, where /media blocked access to certain system and user processes, (because of the default limiting umask attached to any drive that is mounted) where as /mnt acted like the host filesystem.

Fabby
  • 34,259
Sam
  • 311
  • 1
    Having more lax permissions is not a reason to recommend something. Especially when it's contrary to FreeDesktop recommendations. See my comment on another misguided answer. – underscore_d Oct 05 '15 at 17:41