Weblog entry #3 for summitwulf
The /etc/fstab file seems to be correctly set up for the CDROMs:
/dev/hdc /media/cdrom0 auto ro,user,noauto,exec 0 0
/dev/hdd /media/cdrom1 auto ro,user,noauto,exec 0 0
and the permissions on the files in /media are:
drwxr-xr-x 2 root root 4096 2006-2-25 03:28 cdrom0
drwxr-xr-x 2 root root 4096 2006-2-25 03:28 cdrom1
For example, from Totem as a normal user I get:
Error: Failed to play Audio/Video Disc - Failed to open device /dev/hdd for reading: permission denied
and yet it works fine if I quit and restart it after an su. In GnomeBaker, if I try to say copy a CD, I repeatedly get 'Information - Please insert a disk into the SONY CD-RW CRX216E'. The disk is there already, and once again I don't get this error if I run GnomeBaker as root.
I'm sure this is simple. Can any kind soul enlighten me as to how to fix this? It looks to me like the group permissions on the CDROM drives should have another group added to them so they can be accessed by these programs, but what group should it be, and how do I find out?
SW
Comments on this Entry
[ Send Message | View Steve's Scratchpad | View Weblogs ]
The error message says 'permission denied' on /dev/hdd so I'd take a look at that.
On my system I have:
skx@itchy:~$ ls -l /dev/hdd brw-rw---- 1 root disk 22, 64 2005-02-26 06:38 /dev/hdd
So to read + write to it I have to be a member of group disk.
Run, as root:
addgroup youID disk
Where "youID" is the ID of your non-root login. Then logout, login, and try again.
[ Parent | Reply to this comment ]
Thanks for your help! =)
SW
[ Parent | Reply to this comment ]
The CDROM really ought to be in group "cdrom".
Like here;
brw-rw---- 1 root cdrom 22, 0 2006-02-15 15:27 hdc
When the worst you are likely to do by mistake is make extra coasters, or play your DVDs at inopportune moments.
Afraid I have no idea why it isn't listed as a CDROM, or how to change it, it may be MAKEDEV or udev, probably MAKEDEV (less /sbin/MAKEDEV), as udev is newer than the stock Sarge kernels. Afraid when I had to do this for myself, I found a newsgroup article, made the change, and erased my memory.
Dare say if you post kernel version, CD ROM drive type, the lazyweb make spring into action.
[ Parent | Reply to this comment ]
Sorry if this sounds stupid
V.
[ Parent | Reply to this comment ]
Root can change the permissions, but these days most *n?x boxes either recreate /dev/ entries, or check/correct them on reboot, which is what my reference to MAKEDEV is about. Afraid it has changed so often, I tend to work it out each time.
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
OK, let's see:
Kernel version:
> uname -a
Linux xxxxxxx 2.6.8-2-386 #1 Tues Aug 16 12:46:35 UTC 2005 i686 GNU/Linux
and Totem reports the drives as:
Sony CD-RW CRX216E
NEC DVD-RW ND-3540A
[ Parent | Reply to this comment ]
[ Send Message | View Utumno's Scratchpad | View Weblogs ]
http://lists.debian.org/debian-devel/2004/11/msg00428.html
And got answers that
- /dev/hd* could be a harddrive as well
- when using udev, this problem disappears as udev figures out which of the /dev/hd* is a CD/DVD rom ( confirmed )
- current d-i runs 'chgrp cdrom /dev/hdX' if you installed from /dev/hdX CD device. ( weird, I could have sworn I installed it from /dev/hdc and upon installation I still had it belong to 'disk' , but maybe I am wrong or used to early an d-i. )
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Send Message | View Utumno's Scratchpad | View Weblogs ]
The installer, as I was told in Debian-Devel, currently has no means to detect which one of IDE and SCSI block devices is a harddrive, which a CD/DVD ROM, and which yet something else like a tape, so it simply defaults to treating all those devices as harddrives and groupowns them to 'disk'.
http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
for an more in-depth explanation.
[ Parent | Reply to this comment ]
So it seems that being a member of group 'cdrom' is not enough for Totem or Gnomebaker (if as you say all users are automatically members of 'cdrom' by default), presumably because the actual devices in /dev/hd... don't below to cdrom themselves (they belong to 'disk').
This begs the question: what to do? If making your users members of group 'disk' is a bad idea? Somehow you have to associate the /dev/hd... devices with the cdrom group on a permanent basis....?
[ Parent | Reply to this comment ]
[ Send Message | View Utumno's Scratchpad | View Weblogs ]
Or, if you are hesitant to make such a change, just add another boot-up script 'my_script' in /etc/init.d:
#!/bin/sh
case "$1" in
start)
chgrp cdrom /dev/hdc
;;
stop)
;;
esac
'chmod a+x' it and 'update-rc.d my_script defaults'.
[ Parent | Reply to this comment ]
[ Send Message | View Utumno's Scratchpad | View Weblogs ]
Or, if you are hesitant to make such a change, just add another boot-up script 'my_script' in /etc/init.d:
#!/bin/sh
case "$1" in
start)
chgrp cdrom /dev/hdc
;;
stop)
;;
esac
'chmod a+x' it and 'update-rc.d my_script defaults'.
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]