Author Topic: [SOLVED]mounting and unmounting dvd or cd by user  (Read 795 times)

Offline ternor

  • Hero Member
  • *****
  • Posts: 1801
[SOLVED]mounting and unmounting dvd or cd by user
« on: May 26, 2010, 04:14:32 AM »
Hi.  The line is /etc/fstab is

Code: [Select]
/dev/sr0 /mnt/cdrom auto umask=0,users,iocharset=utf8,unhide,noauto,ro 0 0
I am able to mount and unmount a dvd as user with K3b but if I attempt to mount a dvd using konsole or a desktop icon, I get an error message to the effect that only root can do that.  This seems to be an anomaly.  What am I missing?  I could use a desktop icon in PCLinuxOS 2009 to mount and unmount a dvd.

According to man:mount, code such as that above should enable any user at least to mount the removable device:

Quote
The non-superuser mounts.
 Normally, only the superuser can mount file systems. However, when fstab contains the user option on a line, anybody can mount the corresponding system.

 Thus, given a line

 /dev/cdrom /cd iso9660 ro,user,noauto,unhide

 any user can mount the iso9660 file system found on his CDROM using the command

Changing 'users' to 'user' made no difference.  Quoting again from the man page:

Quote
If any user should be able to unmount, then use users instead of user in the fstab line.
« Last Edit: May 28, 2010, 02:01:40 AM by ternor »

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: mounting and unmounting dvd or cd by user
« Reply #1 on: May 26, 2010, 06:45:00 AM »
Is there a particular reason you want to have an entry in fstab for removable media?
If the entry is not there the media gets mounted in the user space under /media/<label>  or /media/disk.

The "Last Plugged In Device" notification in the panel is then used to mount or eject the media; or you could use Dolphin if that suited. You can unmount from Dolphin if you do not want to eject.

You should also be offered an option to open the media using K3b amongst other options.

Offline ternor

  • Hero Member
  • *****
  • Posts: 1801
Re: mounting and unmounting dvd or cd by user
« Reply #2 on: May 26, 2010, 09:43:36 PM »
Thanks for replying.  The only way I can mount a disk using the panel notification is to open the file with Konqueror.  If I then want to unmount the disk, I have to open Dolphin or K3b.  If I want to mount it again, I have to open it again with Konqueror or K3b.

With the previous version of PCLinuxOS I had a desktop icon which enabled me to mount or unmount a disk, eject it or open the disk with Konqueror.  Theoretically, I should be able to do that now.
« Last Edit: May 26, 2010, 09:45:16 PM by ternor »

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11598
  • ----IOFLU----
Re: mounting and unmounting dvd or cd by user
« Reply #3 on: May 27, 2010, 12:40:03 AM »

With the previous version of PCLinuxOS I had a desktop icon which enabled me to mount or unmount a disk, eject it or open the disk with Konqueror.  Theoretically, I should be able to do that now.


Unfortunately, you can still make the device icons, but they don't work with KDE4. When clicked you get;



However, if you can live with two icons, rather than one, this will mount the data cdrom, and open Dolphin to show the contents, if you have the mount line in your fstab.

-------------------------------------------------- start --------------------------------------------
[Desktop Entry]
Comment[en_US]=
Comment=
Exec=mount /dev/cdrom; dolphin /mnt/cdrom
GenericName[en_US]=
GenericName=
Icon=media-optical-data
MimeType=
Name[en_US]=Mount CD-ROM
Name=Mount CD-ROM
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=


-------------------------------------------- end ---------------------------------------------------

If all Dolphin windows to /mnt/cdrom are closed, the second icon/widget will unmount the CD and eject the tray. A second click will then close the tray.

-------------------------------------------- start -------------------------------------------------
[Desktop Entry]
Comment[en_US]=
Comment=
Exec=eject -T
GenericName[en_US]=
GenericName=
Icon=media-optical
MimeType=
Name[en_US]=Tray
Name=Tray
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-DCOP-ServiceType=
X-KDE-SubstituteUID=false
X-KDE-Username=


------------------------------------------------- end ----------------------------------------------

Copy/paste the part in purple into kwrite, and save each, as the name specified, to your desktop. Right click each, choose Properties, then on the Permissions tab check the Is executable box

My fstab line for the cdrom is as follows;

/dev/cdrom      /mnt/cdrom      auto    ro,user,noauto     0 0
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: mounting and unmounting dvd or cd by user
« Reply #4 on: May 27, 2010, 01:42:48 AM »
Thanks for replying.  The only way I can mount a disk using the panel notification is to open the file with Konqueror.  If I then want to unmount the disk, I have to open Dolphin or K3b.  If I want to mount it again, I have to open it again with Konqueror or K3b.

When the panel notification pops up ......  look carefully at the right side of the listing for the DVD .........  there is a small icon there which when clicked mounts which ever device in inserted.
That icon changes ro give eject after the media is mounted.

Yes it can be difficult to see, depending on the background image at that point.

Quote
With the previous version of PCLinuxOS I had a desktop icon which enabled me to mount or unmount a disk, eject it or open the disk with Konqueror.  Theoretically, I should be able to do that now.

Yes with the panel notifier.

Offline ternor

  • Hero Member
  • *****
  • Posts: 1801
Re: mounting and unmounting dvd or cd by user
« Reply #5 on: May 28, 2010, 12:39:42 AM »
Ok, thanks old-polack and JohnBoy.