LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Annoying cdrw permissions problem. (https://www.linuxquestions.org/questions/linux-hardware-18/annoying-cdrw-permissions-problem-325234/)

Lord Zoltar 05-19-2005 10:47 PM

Annoying cdrw permissions problem.
 
Annoying problem with my cdrw drive: I can never get it to keep its permissions. Everytime I put a cd in, I have at chmod a+r /dev/hdc. not sure why... This only started happening when I upgraded to kernel 2.6.10. I think it has something to do with udev, not sure...

I have this:
Code:

# permissions for IDE CD devices
BUS="ide", KERNEL="*[!0-9]", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT="cdrom*", NAME="%k", GROUP="cdrom", MODE="0666"
BUS="ide", KERNEL="*[!0-9]", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT="cdrw*", NAME="%k", GROUP="cdrom", MODE="0666"

in my /etc/udev/rules.d/udev.rules file.

Robert G. Hays 05-20-2005 09:20 AM

Not playing with udev yet, but I'm fairly sure I remember reading that there is also another udev-specific file involved.

Also, your system-wide umask (man umask) may still have something to do with it.

But from your 'code', it might be udev itself, so may I suggest you search here and at www.google.com/linux for any possible reports/fixes?
Your search term should probably be in the advanced box as 'all words' needing udev and cd.

hth,

fuzzyash 05-20-2005 09:59 AM

I haven't yet played with udev much but your problem has sparked in me an interest with it, so I'm looking into it.

Do you have any files in /etc/udev/permissions.d/ ? I am running Fedora Core 3 with kernel 2.6.9 & this is were the files that define the udev device permissions reside in FC3.
If you are defining the perms in both /etc/udev/rules.d/udev.rules & /etc/udev/permissions.d/*.permissions then there might be a fight between these two as to what perms to use.

If you do have any files in /etc/udev/permissions.d/, post their contents & we'll try to get to the bottom of this.

Also, run:

ls -R /etc/udev/

& post results.

Lord Zoltar 05-20-2005 11:28 AM

$ ls -R /etc/udev/
/etc/udev/:
permissions.d/ rules.d/ scripts/ udev.conf

/etc/udev/permissions.d:
udev.permissions udev.permissions~

/etc/udev/rules.d:
10-local.rules compat.rules.unsupported udev.rules
10-local.rules~ devfs.rules.unsupported udev.rules~

/etc/udev/scripts:
floppy-extra-devs.sh* ide-devfs.sh* make_extra_nodes.sh* scsi-devfs.sh*



...is what I got.

Also, here's the contents of /etc/udev/permissions.d/udev.permissions :
(I think you'll find the only interesting section is "Optical Devices")
So, yeah it looks like I may be defining the permissions for the drive twice, but so? I define them the same way: 0666
Code:


# console devices
console:root:tty:0600
tty:root:tty:0666
tty[0-9][0-9]*:root:tty:0660
vc/[0-9]*:root:tty:0660

# pty devices
#  Set this to 0660 if you only want users belonging to tty group
#  to be able to allocate PTYs
ptmx:root:tty:0666
pty[p-za-e][0-9a-f]*:root:tty:0660
tty[p-za-e][0-9a-f]*:root:tty:0660
pty/m*:root:tty:0660
vc/s*:root:tty:0660

# serial+dialup devices
ttyS*:root:uucp:0660
tts/[0-9]*:root:uucp:0660
ttyUSB*:root:uucp:0660
tts/USB[0-9]*:root:uucp:0660
ppp:root:uucp:0660
ippp*:root:tty:0660
isdn*:root:tty:0660
isdnctrl*:root:tty:0660
capi*:root:tty:0660
dcbri*:root:tty:0660
ircomm*:root:tty:0660

# vc devices
vcs:root:tty:0620
vcs[0-9]*:root:tty:0620
vcsa:root:tty:0620
vcsa[0-9]*:root:tty:0620
vcc/*:root:tty:0620

# memory devices
random:root:root:0644
urandom:root:root:0644
mem:root:kmem:0640
kmem:root:kmem:0640
port:root:kmem:0640
full:root:root:0666
null:root:root:0666
zero:root:root:0666

# misc devices
misc/nvram:root:root:0660
misc/rtc:root:root:0664
misc/psaux:root:sys:0660

# floppy devices
floppy/[0-3]:root:floppy:0666

# audio devices
dsp*:root:audio:0662
audio*:root:audio:0662
midi*:root:audio:0662
mixer*:root:audio:0666
sequencer*:root:audio:0662
sound/*:root:audio:0662
snd/control*:root:audio:0666
snd/midi*:root:audio:0666
snd/pcm*p:root:audio:0666
snd/seq:root:audio:0666
snd/timer:root:audio:0666
snd/hw*:root:audio:0662
snd/pcm*c:root:audio:0662
beep:root:audio:0664
admm*:root:audio:0662
adsp*:root:audio:0662
aload*:root:audio:0662
amidi*:root:audio:0662
dmfm*:root:audio:0662
dmmidi*:root:audio:0662
sndstat:root:audio:0662

# optical devices
sr*:root:cdrom:660
scd*:root:cdrom:660
pcd*:root:cdrom:0660
cdrom*:root:cdrom:0666
cdrw*:root:cdrom:0666
dvd:root:cdrom:0660
rdvd:root:cdrom:0660
cdroms/*:root:cdrom:0666

# pilot/palm devices
pilot:root:uucp:0660

# jaz devices
jaz*:root:disk:0660

# zip devices
pocketzip*:root:disk:0660
zip*:root:disk:0660

# ls120 devices
ls120:root:disk:0660
ls120*:root:disk:0660

# lp devices
lp*:root:lp:0660
parport*:root:lp:0660
irlpt*:root:lp:0660
usblp*:root:lp:0660
usb/lp*:root:lp:0660

# scanner devices
scanner:root:root:0600
usb/scanner*:root:root:0600

# camera devices
camera*:root:root:0600
usb/dc2xx*:root:root:0600
usb/mdc800*:root:root:0600

# raw devices
ram*:root:disk:660
raw/*:root:disk:660

# disk devices
hd*:root:disk:660
sd*:root:disk:660
dasd*:root:disk:660
ataraid*:root:disk:660
loop*:root:disk:660
md*:root:disk:660
ide/*/*/*/*/*:root:disk:660
discs/*/*:root:disk:660
loop/*:root:disk:660
md/*:root:disk:660

# tape devices
ht*:root:sys:0660
nht*:root:sys:0660
pt[0-9]*:root:sys:0660
npt*:root:sys:0660
st*:root:sys:0660
nst*:root:sys:0660

# dm devices
dm-*:root:root:0640

# memstick devices
memstick*:root:root:0600

# flash devices
flash*:root:root:0600

# diskonkey devices
diskonkey*:root:disk:0660

# rem_ide devices
microdrive*:root:disk:0660

# fb devices
fb:root:root:0600
fb[0-9]*:root:root:0600
fb/*:root:root:0600

# kbd devices
kbd:root:root:0644

# joystick devices
js[0-9]*:root:root:0644
djs[0-9]*:root:root:0644

# video4linux devices
video*:root:video:0660
radio*:root:video:0660
winradio*:root:video:0660
vtx*:root:video:0660
vbi*:root:video:0660
video/*:root:video:0660
vttuner:root:video:0660
v4l/*:root:video:0660

# input devices
input/event*:root:root:600
input/ts*:root:root:600
input/*:root:root:644

# Sony Vaio Jogdial sonypi device
sonypi:root:root:0666

# gpm devices
gpmctl:root:root:0700

# dri devices
nvidia*:root:video:0666
3dfx*:root:video:0660
dri/*:root:video:0660

# mainboard devices
apm_bios:root:root:0600

# scsi devices
sg*:root:disk:0660
pg*:root:disk:0660
cdwriter:root:disk:0666

# usb devices
usb/dabusb*:root:sys:0660
usb/mdc800*:root:sys:0660
usb/rio500:root:sys:0660
usb/legousbtower*:root:usb:0660

sgi_fetchop:root:root:666
iseries/vcd*:root:disk:660
iseries/vd*:root:disk:660


fuzzyash 05-20-2005 01:13 PM

I just remembered!!!
I had the same trouble when I first went to the 2.6 kernel.
The way you are supposed to do this now is to add any user that wants cdrom access to the "disk" group.

As root:

usermod -G disk <user_name>

You might also want to undo any changes you made to your udev files.

Lord Zoltar 05-22-2005 12:49 PM

hey fuzzyash: didn't work. oh and by the way, don't use KUser to change user/group permissions... it will only end in pain!

what changes in the udev files should I undo? I don't even remember the order I made them in :(

Harmaa Kettu 05-22-2005 03:21 PM

Quote:

The way you are supposed to do this now is to add any user that wants cdrom access to the "disk" group.

As root:

usermod -G disk <user_name>
This gives the user unlimited write access to all hard disk devices because they are also owned by group "disk".

I use this configuration file with a couple of additions at the end:
Code:

BUS="ide", ID="1.0", SYMLINK="cdrom"
BUS="ide", ID="1.0", SYMLINK="dvd"
BUS="ide", ID="1.0", GROUP="audio", MODE="660"

The group could be something like "cdburner" but I think it's better to have just one group for all multimedia stuff.

Croaker 05-22-2005 04:51 PM

Lord Zoltar:
I was having a problem with my cdrom and dvd drives when I upgraded to the 2.6.11.9 kernel. I found the udev would change the links in /dev everytime I booted up. I had /dev set like this:
Code:

cdrom -> hdc
dvd -> hdd

But everytime I rebooted it would look like this:
Code:

cdrom -> hdd
dvd -> hdd

So after having to physically reset the links and permissions in /dev after every boot, I just uninstalled udev. Haven't had any problems since. One of things I like most about Slackware. Being able to take something out and not having the machine crash on you.

fuzzyash 05-27-2005 07:30 AM

Quote:

I just uninstalled udev. Haven't had any problems since.
Simply uninstalling udev, in my opinion, is not a good idea unless you either NEVER want to modify your systems hardware again, or you're a Linux EXPERT!

Problems arise with simply uninstalling udev. Lets face it, most average users out there running Linux at home are gonna want to add a hard drive, plug in a USB memory stick or mp3 player or something of that description at some stage. udev was specifically developed to help make adding devices to the system much simpler & faster, making Linux more user friendly for those who want to use a reliable OS, but don't want to become an absolute expert. All they want is for their computer to do what they want, without having to go through a steep learning curve to what most would consider an easy task, like simply downloading the pics off their digital camera for example.
So the problem with uninstalling udev is that if you ever want to add or remove devices to or from your system, then you will need to go to a great deal more trouble to get them to work. This might be alright for those of us who enjoy learning all their is to know about every task that they preform, but for most users, this is a pain in the arse!

Alright, back to the problem...

A couple of posts ago I said:

Quote:

add any user that wants cdrom access to the "disk" group.
& Lord Zoltar you said that this did not work. I am running Fedora Core 3 & "disk" is the group that all the disks are grouped under by Fedora. Your disk group, if any, is most likely different being that you are running Slackware 10.0.

Run:

Code:

ls -l /dev/hdc
& post results.

Harmaa Kettu, you obviously know more about udev & how it works than I do. Could you please explain your answer, in other words, why this works? Could you also please post a link to where to find a good tutorial site on udev & how to configure it, if you know of one of course!

Thanks!


All times are GMT -5. The time now is 09:46 AM.