9

Why has Ubuntu and many other Linux distributions moved the default mount points from /media to /media/$USER

Example I plug in a USB drive and it's name is EXT4-250GB-USB it used to show up in /media/EXT4-250GB-USB but now it shows up in /media/z/EXT4-250GB-USB

Why is this and what's the reason behind it?

  • 1
    I surmise your username is z so that is normal behavior. Check this out : askubuntu.com/questions/88523/… - instructions for installing pmount to ensure it mounts the same time with each insertion. – SDsolar Nov 16 '17 at 22:32
7

In fact, Ubuntu as many other Linux distributions have switched to udisks2 which is used for the auto mount feature.

In the new version of udisks, the default mount point is /run/media/$USER, but it has been patched by Ubuntu (and some other distributions) to be /media/$USER (See this answer from Florian Diesch for more details).

udisks version 2.0.0, which is included in Ubuntu 12.10 doesn't allow you to change the default behaviour which is mounting a file system as non-shared (only accessible by $USER).

Since udisks 2.0.91, it is possible to change the default behaviour so that mounting a file system as shared can be done as before [/media] (See this answer from rocko for more details).

The root cause for this change of default behaviour in udisks2 seems clear : the security. It is safer to restrict access to a file system to one particular user instead of giving access to it to all the users of the system.

2

In Ubuntu this has been changed once with Quantal (12.10) release. The reason seems to be quite simple and logic:

  • First of all, in Linux like systems /media is a directory for mounting files systems on removable media like CD-ROM drives, floppy disks, and Zip drives. So, this is a rule.

  • Now, if you plug an USB drive for example, normally is that only you to have access to that USB drive - from here the reason of per-user mounting. In your example if you check with ls -l /media/z you will see that you are the owner of EXT4-250GB-USB and only (aka z user) you have permissions to read, write and execute EXT4-250GB-USB. The same thing is true for all the files from inside EXT4-250GB-USB.

  • In this way, a system administrator (root) can see quickly what each user has mounted.

Anyway, if you wish, you can manually mount something almost where you want (of course, where you will be granted access). For example, you will not be able to mount to /media/<anotheruser>.

You may be also interested by:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.