2

My installation of CentOS 6.5 has stopped auto-mounting DVDs in KDE (default) X Window desktop environment (e.g. with all the KDE helper functions). Trying to troubleshoot this unexpected change in DE operations, I looked at:

  • /etc/fstab
  • /etc/group

I didn't notice anything had changed. Reading the man page for mount, I added a new line to fstab:

/dev/sr0   /media/dvd   iso9600   ro,users,noauto,unhide

Then, I added my non-root user (chris) to group users; however, mount continues to be accessible only to root:

$ mount -a
mount: only root can do that
$ mount /dev/sr0 /media/dvd
mount: only root can do that
$ mount /dev/sr0 /media/dvd
mount: only root can do that

The only command which is working right now is:

$ sudo mount /dev/sr0 /media/dvd

What are all the working pieces to granting users permission to mount dvds? BONUS, Why would KDE suddenly stop mounting DVDs?

  • Have you tried "user" instead of "users" - note the difference of the missing s – Thomas Junk May 9 '15 at 17:18
  • KDE should mount filesystems through PolicyKit (or, newer, polkit). – myaut May 9 '15 at 21:21
0

I'm not sure your question has a clean answer because of the way mounting impacts the system. I found this thread :

Why does mount require root privileges?

it mentions the way mounting can be used to gain root access to a system, thus it's generally locked down to the root user - so it's not really a cut and dry thing it would seem. However, I'm sure if you throw caution to the wind, you could perform some less-than-best-practices that would allow you to execute mount from a 'user' level user.

I think the answer you're looking for is here:

Allow non-superusers to mount any filesystem

  • This seems an example where logging in as root is necessary. The second link seems really hacky. I'm cataloging my DVD's and files and some files are owned by root or other random (like nx). Disks were either completely inaccessible or worse--partially accessible (I only just noticed some rsync'd directories skipped because they were from a portable device which has every file owned by root). – xtian May 10 '15 at 14:28
0

A few points here::

  1. First, remove noauto, because that would prevent mount -a from working.

  2. Then also check if the "T" bit is set on /media/dvd, such as

    chmod +t /media/dvd
    

This will set the sticky bit on the dvd directory so that anybody can write to it and own and be able to remove modify only his/her files directories.

  1. In addition, CAP_SYS_ADMIN Linux capability is required to mount.

For further information on this see this:

How do you add `cap_sys_admin` permissions to user in CentOS 7?

  1. Change "users" to "user"

That should solve your issues.

  • (2) Can you explain what the t mode bit does in this context; i.e., why it is important? (3) What does “CAP_SYS_ADMIN Linux capability is required to mount” mean, in terms that are meaningful to the user? … … … … … … … … … … Please do not respond in comments; edit your answer to make it clearer and more complete. – Scott Jun 8 at 16:51

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.