# udev and cdrecord problem

## Hetfield666

hi, i got udev working with no problems.

but today, trying to write soemthing with k3b i got strange errors.

so, for debugging, i started to play with cdrecord command line.

/dev/hdb is my cdwriter. i guess that's a bug somewhere. why?

(without cd inserted, just to try..)

root@blight ~ # cdrecord dev=/dev/hdb blank=fast driveropts=burnfree

Cdrecord-Clone 2.01a33 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Schilling

scsidev: '/dev/hdb'

devname: '/dev/hdb'

scsibus: -2 target: -2 lun: -2

Warning: Open by 'devname' is unintentional and not supported.

Linux sg driver version: 3.5.27

Using libscg version 'schily-0.8'.

Device type    : Removable CD-ROM

Version        : 0

Response Format: 1

Vendor_info    : 'WAITEC  '

Identifikation : 'STORM52/1       '

Revision       : 'K.SC'

Device seems to be: Generic mmc CD-RW.

Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).

Driver flags   : MMC-3 SWABAUDIO BURNFREE FORCESPEED

Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R

cdrecord: Success. test unit ready: scsi sendcmd: no error

CDB:  00 00 00 00 00 00

status: 0x2 (CHECK CONDITION)

Sense Bytes: 70 00 02 00 00 00 00 0A 00 00 00 00 3A 01 00 00

Sense Key: 0x2 Not Ready, Segment 0

Sense Code: 0x3A Qual 0x01 (medium not present - tray closed) Fru 0x0

Sense flags: Blk 0 (not valid)

cmd finished after 0.000s timeout 40s

cdrecord: No disk / Wrong disk!

ok..seems good.i even burned a cd as root without problems.good.

same command but as simple user (with hdb permissions, i tried even 777)

$ cdrecord dev=/dev/hdb blank=fast driveropts=burnfree

Cdrecord-Clone 2.01a33 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Schilling

scsidev: '/dev/hdb'

devname: '/dev/hdb'

scsibus: -2 target: -2 lun: -2

Warning: Open by 'devname' is unintentional and not supported.

Linux sg driver version: 3.5.27

Using libscg version 'schily-0.8'.

cdrecord: Cannot allocate memory. Cannot get SCSI I/O buffer.

scsi error. same problem if i try to write something and so on.

cdrecord dev=/dev/hdb -checkdrive

Cdrecord-Clone 2.01a33 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Schilling

scsidev: '/dev/hdb'

devname: '/dev/hdb'

scsibus: -2 target: -2 lun: -2

Warning: Open by 'devname' is unintentional and not supported.

Linux sg driver version: 3.5.27

Using libscg version 'schily-0.8'.

Device type    : Removable CD-ROM

Version        : 0

Response Format: 1

Vendor_info    : 'WAITEC  '

Identifikation : 'STORM52/1       '

Revision       : 'K.SC'

Device seems to be: Generic mmc CD-RW.

Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).

Driver flags   : MMC-3 SWABAUDIO BURNFREE FORCESPEED

Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R

ok...this means i've permission to access device.

but...where is the problem so? help me please.

----------

## AtomicDog

I'm experiencing the same problem right now.  I've had it working flawlessly up until today.  I think the new cdrtools ebuild or kernel may have broken something (I updated both yesterday).

Time to do some more compiling.

----------

## Decibels

Don't think it is udev. I use k3b and works fine. Tried the same command you did, cept change to /dev/hdc. Here is the output. It blanked the cd.

```
bash-2.05b$ cdrecord dev=/dev/hdb blank=fast driveropts=burnfree

Cdrecord-Clone 2.01a28 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Sc

hilling

scsidev: '/dev/hdb'

devname: '/dev/hdb'

scsibus: -2 target: -2 lun: -2

Warning: Open by 'devname' is unintentional and not supported.

cdrecord: Invalid argument. Cannot set SG_SET_TIMEOUT.

bash-2.05b$ cdrecord dev=/dev/hdc blank=fast driveropts=burnfree

Cdrecord-Clone 2.01a28 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Sc

hilling

scsidev: '/dev/hdc'

devname: '/dev/hdc'

scsibus: -2 target: -2 lun: -2

Warning: Open by 'devname' is unintentional and not supported.

Linux sg driver version: 3.5.27

Using libscg version 'schily-0.8'.

Device type    : Removable CD-ROM

Version        : 0

Response Format: 2

Capabilities   :

Vendor_info    : 'LITE-ON '

Identifikation : 'COMBO LTC-48161H'

Revision       : 'KH0N'

Device seems to be: Generic mmc2 DVD-ROM.

Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).

Driver flags   : MMC-3 SWABAUDIO BURNFREE FORCESPEED

Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96                         R

Starting to write CD/DVD at speed 24 in real BLANK mode for single session                         .

Last chance to quit, starting real write    0 seconds. Operation starts.
```

Using cdrtools-2.01_alpha28-r1 and ide-cd.

----------

## oumpah-pah

Did you set cdrecord suid ?

```
chmod u+s /usr/bin/cdrecord
```

----------

## Decibels

Didn't catch that.  :Sad:   Ya, check your /usr/bin/cdrecord:

```
bash-2.05b$ ls -l /usr/bin/cdrecord

-rws--x--x  1 root root 336796 Jun  8 21:43 /usr/bin/cdrecord
```

----------

## Hetfield666

i think it's a kernel bug.

i'm using 2.6.8-rc3-mm1

someone can try that?

my permissions are ok...i've always had the same, same suid and so on.

k3bsetup tells me it's ok.

i switched from 2.6.7+ devfs to 2.6.8-rc3-mm1 + udev

must be one of them fault.

i saw lots of cdrecord's posts on kernel mailing list these days...can be kernel bug..

please try my same version and report

----------

## Hetfield666

no ideas?

----------

## Hetfield666

just changing kernel it has been fixed.

do not use previous kernels

----------

## int2str

I have the same problem (gentoo-dev-sources 2.6.8-r1). 

Which kernel works and which ones dont work for you?

Thanks,

  Andre

----------

## r3pek

i think that no 2.6.8 version work. stick with 2.6.7 or you can only record cd's as root.... oh! and no auio cd's...

----------

## LJ

I had the same problem and I found it was because I was using hdX=ide-scsi.  You're supposed to use hdX=ide-cd now.

This is an old thread.  I hope this still helps someone.

----------

## TobiWan

Hi,

 *Hetfield666 wrote:*   

> i think it's a kernel bug.
> 
> i'm using 2.6.8-rc3-mm1
> 
> someone can try that?
> ...

 

All I can say that after switching to 2.6.9-gentoo-r4(?!) and udev from 2.6.7 and devfs it stopped working for non-root users. In k3b I get the error that cdrecord can't allocate memory.

I burn CDs in sudo mode until this issue is solved. Very disturbing issue though, I hope it's fixed soon.

regards,

Tobias

----------

## manny15

I'll see what happends with kernel 2.6.11 but I'm running 2.6.10-ck5, and I'm having a bit of trouble burning cds as a non-root user with my USB cdrw. I think the problem is udev though. I have the following in /etc/udev/permissions.d/50-udev.permissions

```

sg*:root:cdrw:0660

...

sr*:root:cdrom:660

```

I'm in the cdrw (not cdrom though). But regardless, those permissions were not applyied. I know at one point they were working correctly. So I changed the group of both /dev/sr0 and /dev/sg0 to cdrw, and then it worked.

I'm I supposed to modify the permissions of sr* in /etc/udev/permissions.d/50-udev.permissions to cdrw, or add myself to the cdrom group?

I'm still confused as to why the group for sg0 was not set to cdrw. Hmm...

----------

## djs

Apparently, there were changes to the kernel in 2.6.9 and higher that won't allow cdrecord to work with suid. Do some searches on that.

/djs

----------

## manny15

```

-rwxr-xr-x  1 root root 296764 Dec  5 11:24 /usr/bin/cdrecord

-rwxr-xr-x  1 root root 719536 Oct 20 20:36 /usr/bin/cdrdao

```

And it works as a normal user if I set the group to cdrw on /dev/sr0 and /dev/sg0. But udev is supposed to do this (and it used to).

----------

