Wrong group for IDE cdrom/cdwriter/dvd devices

Bug #75753 reported by Andreas Simon
124
This bug affects 1 person
Affects Status Importance Assigned to Milestone
udev (Ubuntu)
Fix Released
High
Scott James Remnant (Canonical)
Nominated for Feisty by Stefan Fleiter

Bug Description

Binary package hint: udev

Feisty with udev 103-0ubuntu4. Used kernel is linux-image-2.6.19-7-generic 2.6.19-7.11.

The group for cdrom/cdwriter devices gets set to 'root' instead of 'cdrom'.

This results for example that CD-writing software like k3b errors out because it has no permissions to write to the device unless you start it as root. Normally users in the 'cdrom' group should have write permissions to CD/DVD devices.

With the new libata under Feisty, IDE cdrom/cdrw/dvd devices are no longer /dev/hdX but /dev/sgX. But

# ls -l /dev/sg*
crw-rw---- 1 root root 21, 0 2006-12-14 03:00 /dev/sg0
crw-rw---- 1 root root 21, 1 2006-12-14 03:00 /dev/sg1
crw-rw---- 1 root root 21, 2 2006-12-14 03:00 /dev/sg2
crw-rw---- 1 root root 21, 3 2006-12-14 03:00 /dev/sg3

In this example sg1 is a CD writer and sg3 a DVD drive. Both should have the group 'cdrom'.

The /dev/scdX devices are also set to the wrong group. Here it's 'floppy' instead of 'cdrom'.

# ls -l /dev/cd*
lrwxrwxrwx 1 root root 4 2006-12-14 02:00 /dev/cdrom -> scd0
lrwxrwxrwx 1 root root 4 2006-12-14 02:00 /dev/cdrw -> scd0

# ll /dev/scd*
brw-rw---- 1 root floppy 11, 0 2006-12-14 03:00 /dev/scd0
brw-rw---- 1 root floppy 11, 1 2006-12-14 03:00 /dev/scd1

scdX are set to the group 'floppy', here again 'cdrom' should be the correct group.

Changed in udev:
status: Unconfirmed → Confirmed
Revision history for this message
bobbyjean58 (bobbyjean58) wrote :

I'm running Feisty and kernel 2.6.20-5-generic. I have the exact same problem. /dev/scd0 is listed under the group Floppy and /dev/sg0 and sg1 are in group root. NeroLinux complains that it needs free access to sg0 and sg1 so therefore can not function. Also, I can not write to UDF discs ...access denied.

Changed in udev:
importance: Undecided → Medium
Revision history for this message
Patrick (patrick-voegeli) wrote :

Same here. When trying to erase a cd-rw using wodim:
patrick@patrick-desktop:~$ wodim -format
Quickly guessing the name of a drive capable to write CD-R, please wait...
Found /dev/cdrw, assuming dev=/dev/cdrw
Error trying to open /dev/cdrw exclusively (Device or resource busy)... retrying in 1 second.
Error trying to open /dev/cdrw exclusively (Device or resource busy)... retrying in 1 second.
Error trying to open /dev/cdrw exclusively (Device or resource busy)... retrying in 1 second.
Error trying to open /dev/cdrw exclusively (Device or resource busy)... retrying in 1 second.
Error trying to open /dev/cdrw exclusively (Device or resource busy)... giving up.
wodim: No such file or directory.
Cannot open SCSI driver!
For possible targets try 'wodim --devices' or 'wodim -scanbus'.
For possible transport specifiers try 'wodim dev=help'.
For IDE/ATAPI devices configuration, see the file README.ATAPI.setup from
the wodim documentation.
patrick@patrick-desktop:~$ ls -la /dev/cdrw
lrwxrwxrwx 1 root root 3 2007-02-18 16:12 /dev/cdrw -> hda
patrick@patrick-desktop:~$ ls -la /dev/hda
brw-rw---- 1 root floppy 3, 0 2007-02-18 16:12 /dev/hda

Revision history for this message
Patrick (patrick-voegeli) wrote :

Same here. When trying to erase a cd-rw using wodim:
patrick@patrick-desktop:~$ wodim -format
Quickly guessing the name of a drive capable to write CD-R, please wait...
Found /dev/cdrw, assuming dev=/dev/cdrw
Error trying to open /dev/cdrw exclusively (Device or resource busy)... retrying in 1 second.
Error trying to open /dev/cdrw exclusively (Device or resource busy)... retrying in 1 second.
Error trying to open /dev/cdrw exclusively (Device or resource busy)... retrying in 1 second.
Error trying to open /dev/cdrw exclusively (Device or resource busy)... retrying in 1 second.
Error trying to open /dev/cdrw exclusively (Device or resource busy)... giving up.
wodim: No such file or directory.
Cannot open SCSI driver!
For possible targets try 'wodim --devices' or 'wodim -scanbus'.
For possible transport specifiers try 'wodim dev=help'.
For IDE/ATAPI devices configuration, see the file README.ATAPI.setup from
the wodim documentation.
patrick@patrick-desktop:~$ ls -la /dev/cdrw
lrwxrwxrwx 1 root root 3 2007-02-18 16:12 /dev/cdrw -> hda
patrick@patrick-desktop:~$ ls -la /dev/hda
brw-rw---- 1 root floppy 3, 0 2007-02-18 16:12 /dev/hda

running kernel 2.6.20-8-generic

Revision history for this message
Andreas Simon (andreas-w-simon) wrote :

I just want to add that this problem is still there with feisty's current udev version 103-0ubuntu13.

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

If it's true why can i use nautilus-cd-burner without root permissions for burning/erasing... (without gksudo) ?

Revision history for this message
Andreas Simon (andreas-w-simon) wrote :

Patrice, you are right. Nautilus works because it accesses my DVD-writer through /dev/scd0. But if I start it as a user who is in group cdrom but not in group floppy it fails too. The default user is member of both groups, so it doesn't have any impact that scd0's group is floppy instead of cdrom. But it's still wrong.

Revision history for this message
Sero (sero4linux) wrote :

A "me too" here as far as the wrong group "floppy" for /dev/scd0 goes. I realised this because I added another user and since my laptop doesn't have a floppy drive I did not put it in the group floppy. When I want to play a audio-cd with sound-juicer it doesn't work and complains about "Permission denied".

udev is 103-ubuntu13.

Temporaly fixed (until you reboot) with:
sudo chgrp cdrom /dev/scd0

Changed in udev:
assignee: nobody → keybuk
Revision history for this message
Mario Limonciello (superm1) wrote :

I'm encountering identical issues. Not all users are put into the floppy group by default, so this can be troublesome for those users.
supermario@portablemario:~$ ls -l /dev/scd0
brw-rw---- 1 root floppy 11, 0 2007-03-16 14:58 /dev/scd0

Revision history for this message
James (boddingt) wrote :

brw-rw---- 1 root floppy 22, 64 2007-03-26 07:56 /dev/hdd

Where hdd is an ide cdrw. My current work around is 'chgrp cdrom /dev/hdd' in rc.local. None of the users on my machine are in the floppy group. Machine has no floppy.

Revision history for this message
Andi T. (andreastetzlaff) wrote :

I've got the same problem with my CD writer "Sony DW-Q58A" on my Dell Latitude D610 (chipset Mobile Intel 915PM Express (533 MHz FSB)) using Kubuntu 7.04 (Feisty Fawn) beta:

$ sudo ls -lh /dev/scd0
brw-rw---- 1 root floppy 11, 0 2007-03-26 02:18 /dev/scd0

When I change the group with "sudo chown root.cdrom /dev/scd0" or with "kdesu k3b-setup", it only works until the next reboot.

To change ownership permanently, I have to create a file /etc/udev/rules.d/50-udev.rules with:
KERNEL=="sg[0-9]*", ACTION=="add", ATTRS{type}=="4|5", GROUP="cdrom"

Changed in udev:
importance: Medium → High
Revision history for this message
Julian67 (julianhughes) wrote :

Identical problem affects Edgy with kernel 2.6.17.11.

I upgraded the kernel for other reasons right after install and also installed all recommended patches so do not know if this problem existed in 2.6.17.10 and the default Ubuntu install from the alternate CD.

My optical drive is a MATSHITA DVD-RAM UJ-845S D100 (/dev/scd0, /dev/sg1) at /media/cdrom0.

Running "sudo chown root.cdrom /dev/sg0" gave me burning permissions in k3b and nautilus. I was assigned to both the cdrom and floppy groups while having the problem.

Revision history for this message
Julian67 (julianhughes) wrote :

Adding the /etc/udev/rules.d/50-udev.rules file described above by Andi T. and rebooting has fixed this for me.

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Changing instances of ATTR== to ATTRS== in /etc/udev/rules.d/40-permissions.rules cures this

Changed in udev:
status: Confirmed → In Progress
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Err, sorry, changing that AND moving 50-cdrom_id.rules to 30-cdrom_id.rules cures it.

This has been fixed with today's upload

Changed in udev:
status: In Progress → Fix Released
Revision history for this message
Ewan Mac Mahon (ewan-macmahon) wrote :

I've got the same/a similar problem with a USB burner on Fiesty updated and rebooted this morning. Plugging the drive in creates /dev/scd0 as:
 brw-rw---- 1 root cdrom 11, 0 2007-04-05 12:19 /dev/scd0
but /dev/sg1 as:
 crw-rw---- 1 root root 21, 1 2007-04-05 12:19 /dev/sg1
giving the same problems noted in this bug - k3b etc. report that they can't access the sg device.

udev is 108-0ubuntu3, kernel is 2.6.20-13-generic

Revision history for this message
bobbyjean58 (bobbyjean58) wrote :

The /dev/hdc group misidentification problem has been corrected. Thanks developers. The only problem I'm still experiencing is my UDF DVD+RW discs are still being seen as read-only. I can not write data to them at all neither as user or root. In Edgy these UDF DVD+RW discs function just fine.

Revision history for this message
Stefan Fleiter (stefan-fleiter) wrote :

The problem is not fixed for USB and SCSI devices as noted in comment 16.

Revision history for this message
Onkar Shinde (onkarshinde) wrote :

Reopening as the problem remains for USB device (cdwriter at least)

Changed in udev:
status: Fix Released → Confirmed
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Err, please don't reopen this bug -- the underlying problem has been fixed.

Please open a NEW bug for the /dev/sg* problem -- I have a feeling those have never had the right permissions, and even if they have, this is caused by a different problem.

Changed in udev:
status: Confirmed → Fix Released
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

My apologies, some investigation shows that this is another instance of the same bug

Changed in udev:
status: Fix Released → Confirmed
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

And fixed again

Changed in udev:
status: Confirmed → Fix Released
Revision history for this message
David Planella (dpm) wrote :

I'm not sure this is the same bug, so I'm not reopening it but I'll just add a comment.

Until a couple of days ago (sorry, I cannot be more specific), my IDE CD-Writer was working just fine. Now, with

udev 108-0ubuntu4
linux-image-2.6.20-15-generic 2.6.20-15.25

I cannot longer use it for writing.

For example, when trying to burn an ISO with nautilus, I get an empty error message dialog (no description of the error). If I then use gnomebaker, I get the following error log:

scsidev: '/dev/hdc'
devname: '/dev/hdc'
scsibus: -2 target: -2 lun: -2
Error trying to open /dev/hdc exclusively (Device or resource busy)... retrying in 1 second.
Error trying to open /dev/hdc exclusively (Device or resource busy)... retrying in 1 second.
Error trying to open /dev/hdc exclusively (Device or resource busy)... retrying in 1 second.
Error trying to open /dev/hdc exclusively (Device or resource busy)... retrying in 1 second.
Error trying to open /dev/hdc exclusively (Device or resource busy)... giving up.
TOC Type: 1 = CD-ROM
scsidev: 'ATA:/dev/hdc'
devname: 'ATA:/dev/hdc'
scsibus: -2 target: -2 lun: -2
wodim: No such file or directory.
Cannot open SCSI driver!
For possible targets try 'wodim --devices' or 'wodim -scanbus'.
For possible transport specifiers try 'wodim dev=help'.
For IDE/ATAPI devices configuration, see the file README.ATAPI.setup from
the wodim documentation.

Some other output in case it can be useful:

dpm@scenic:~$ ls -l /dev/scd*
ls: /dev/scd*: No such file or directory

dpm@scenic:~$ ls -l /dev/sg*
ls: /dev/sg*: No such file or directory

dpm@scenic:~$ ls -l /dev/hd*
brw-rw---- 1 root disk 3, 0 2007-04-15 12:51 /dev/hda
brw-rw---- 1 root disk 3, 1 2007-04-15 12:52 /dev/hda1
brw-rw---- 1 root disk 3, 2 2007-04-15 12:51 /dev/hda2
brw-rw---- 1 root disk 3, 5 2007-04-15 12:51 /dev/hda5
brw-rw---- 1 root disk 3, 64 2007-04-15 12:51 /dev/hdb
brw-rw---- 1 root disk 3, 65 2007-04-15 12:51 /dev/hdb1
brw-rw---- 1 root cdrom 22, 0 2007-04-15 12:51 /dev/hdc
brw-rw---- 1 root cdrom 22, 64 2007-04-15 12:51 /dev/hdd

dpm@scenic:~$ ls -l /dev/cd*
lrwxrwxrwx 1 root root 3 2007-04-15 12:52 /dev/cdrom -> hdd
lrwxrwxrwx 1 root root 3 2007-04-15 12:52 /dev/cdrw -> hdd

Some other information:

On Nautilus, I get a CD-ROM 1 entry on the "Places" sidebar (I've gor 2 CD Writer units on this PC). When I click on it, I get the following message:

mount: special device /dev/scd0 does not exist

When I insert a CD, though, I get a new entry on the "Places" menu and the CD (a feisty livecd) gets mounted on

/media/Ubuntu 7.04 i386,

where I would have expected that it mounts on

/media/cdrom0

This is an up-to-date clean Feisty installation (i.e. not upgraded from Edgy).

Revision history for this message
Luis García (angelblade) wrote :

This bug is possible too on version kernel 2.6.20.15-generic . On my case, i changed temporary to version kernel 2.6.17-50-386

Revision history for this message
^rooker (rooker) wrote :

I'm running Hardy (upgraded from Gutsy) here and notice a similar problem:

My DVD-writer suddenly had the following permissions:

   brw-r----- 1 root disk 3, 0 2008-01-10 09:37 /dev/hda

There are 2 problems with this:
1) It should be the group "cdrom" and not "disk"
2) Since it's a CD/DVD writer, the permissions should be 660 and not 640. :(

After changing it to:

    brw-rw---- 1 root cdrom 3, 0 2008-01-10 09:37 /dev/hda

Things seem fine again.
If there's already some documentation regarding how to change files in /etc/udev/rules.d/ in order to fix this reboot safe, I would be happy if someone could point me there. :)

Thanks

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.