Something is mounting stuff to /media SOLVED

Questions about software.
AlbertWagner
Posts: 51
Joined: 23 Dec 2017 18:11

Something is mounting stuff to /media SOLVED

Postby AlbertWagner » 11 Feb 2018 11:05

Screenshot_2018-02-11_04-56-49.png
Screenshot_2018-02-11_04-56-49.png (33.41 KiB) Viewed 535 times
Something is mounting the name of my home dir to /media. Also /root is mounted to /media.
Why is this happening? And how do I undo it? They cannot be unmounted using sudo.
What does the X placed over the folder icon mean?

User avatar
ilu
Posts: 2059
Joined: 09 Oct 2013 12:45

Re: Something is mounting stuff to /media

Postby ilu » 11 Feb 2018 17:23

AlbertWagner wrote:Something is mounting the name of my home dir to /media. Also /root is mounted to /media.
Why is this happening? And how do I undo it? They cannot be unmounted using sudo.
These should be just empty directories. You can mount stuff there (external harddisks, usb pen drives), but as long as the directories are empty, you haven't. To see the content of /media/root you need to be root, obviously.
AlbertWagner wrote:What does the X placed over the folder icon mean?
It means you have no read permission, because both directories are owned by root and can only be read by root and its group, not by others (so 750, not 755). The user access to the directory with the users name is managed by other means but I'm not sure which ones exactly. It's a special directory because the system mounts there with user perms.

User avatar
bas_otten
Posts: 203
Joined: 19 Oct 2013 12:22
Location: Netherlands

Re: Something is mounting stuff to /media

Postby bas_otten » 11 Feb 2018 19:34

A normal user does have r-x permissions to his/her named subdirectory under /media by means of a user-specific (extended) ACL.
On mounting external media, another subdirectory is created named after the label of the device and this mountpoint is set to be owned by the user.

As an example, when I (bas) mount a USB-drive labeled BAS32, you will see this:

Code: Select all

bas@bashost:/media $>>> ls -la bas
totaal 40
drwxr-x---+ 3 root root  4096 feb 11 20:13 .
drwxr-xr-x  3 root root  4096 jan 20 20:08 ..
drwxr-xr-x  2 bas  bas  32768 jan  1  1970 BAS32

bas@bashost:/media $>>> getfacl bas
# file: bas
# owner: root
# group: root
user::rwx
user:bas:r-x
group::---
mask::r-x
other::---

AlbertWagner
Posts: 51
Joined: 23 Dec 2017 18:11

Re: Something is mounting stuff to /media

Postby AlbertWagner » 11 Feb 2018 20:22

These should be just empty directories.
Should be, but aren't always. I've seen whole partitions mounted there. I've either (as root) unmounted
them or deleted them with no ill effects. But never before has my home name or root showed up, and I'm
hesitant to delete either one.
You can mount stuff there (external harddisks, usb pen drives),
but as long as the directories are empty, you haven't.
Of course I can. But I always explicitly, manually or in fstab, mount to mount points in my home directory.
I don't want some unknown activity mounting my stuff on /media, unless I know why.
It means you have no read permission, because both directories are owned by root and
can only be read by root and its group, not by others (so 750, not 755).
The user access to the directory with the users name is managed by other means
but I'm not sure which ones exactly. It's a special directory because the system mounts there with user perms.
I don't know what "perms" are, but I do not want them there. It's your "other means" that I am trying to discover.
They just showed up a couple of days ago.

What activity triggered their presence? Why are they there now when they never were before?

User avatar
ilu
Posts: 2059
Joined: 09 Oct 2013 12:45

Re: Something is mounting stuff to /media

Postby ilu » 11 Feb 2018 23:49

bas_otten already explained the "other means": "a user-specific (extended) ACL." Used by Thunar.

These directories are there because whenever you click on anything in Thunar that is not already mounted it gets mounted there. Thunar just does it that way.

If you delete content in /media just remember: Anything you delete on a mounted device will be gone for good afterwards.
What activity triggered their presence? Why are they there now when they never were before?
Most probable reason: You clicked on a device in Thunar. There might also be other programs that use the same mechanism. I'm assuming that you are not asked for a password before mounting, that's a deliberate configuration because most users want mounting without password.

"Perms" was just short for permissions, I'm sorry. Whether you want them there or not doesn't matter because Linux and in this case Thunar uses certain ways of handling files which of course could be changed but not by me and probably also not by you since we both aren't developers.

AlbertWagner
Posts: 51
Joined: 23 Dec 2017 18:11

Re: Something is mounting stuff to /media

Postby AlbertWagner » 12 Feb 2018 01:24

Thank you both, Ila and Bas, very much. That is the explanation that I was looking for. And, Ilo, you are right about deleting what is mounted. Not long ago, I deleted a whole OS because I didn't understand what I was looking at (and I was very tired). Hence, my jumpiness about deleting. I did (do?) have a sloppiness towards clicking on unmounted entities in the left column of Thunar. I have noticed a kind of trick to avoid this that probably would be laughed at: have you noticed that, when Gparted is started, Thunar refreshes to remove all unmounted items? I wish that there was switch for that.


Return to “Software”

Who is online

Users browsing this forum: Google [Bot] and 5 guests