# CD burning still not working

## falcon_za

I already posted about that, but the thread stalled without an answer, and some posting about kernel config makes it longer that i would like. So let's start a fresh one.

I'll sum it up here, but if you want to read it all, the original thread was:

https://forums.gentoo.org/viewtopic-t-311032-highlight-.html

So basicaly, I am trying to get my QSI branded cd-burner in my laptop to work via atapi. but the problems I have remain if I switch to scsi emulation, i tried.

So basicaly, cdrdao works from the command line to blank cds, wether i log in as root or as a regular user. did not try to bruns cds with it from the command line, i am not sure about the syntax.

but cdrecord, which is used as the main tool by most frontends, including the one I like (graveman) is not so lucky.

If I login as root, I managed to burn CD as "track at once" (backend cdrecord ?) and "disc at once" (backend cdrdao?) with xcdroast and graveman. but blanking CDs either from the interface or from the command line fails when it uses cdrecord. i get the following error for "cdrecord dev=ATAPI:0,0,0 -blank=all" :

```

....

scsidev: 'ATAPI:0,0,0'

devname: 'ATAPI'

scsibus: 0 target: 0 lun: 0

Warning: Using ATA Packet interface.

Warning: The related Linux kernel interface code seems to be unmaintained.

Warning: There is absolutely NO DMA, operations thus are slow.

Using libscg version 'schily-0.8'.

Device type    : Removable CD-ROM

Version        : 0

Response Format: 2

Capabilities   : 

Vendor_info    : 'QSI     '

Identifikation : 'CDRW/DVD SBW-241'

Revision       : 'VX08'

Device seems to be: Generic mmc2 DVD-ROM.

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

Driver flags   : MMC-2 SWABAUDIO BURNFREE 

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

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

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

cdrecord: Input/output error. blank unit: scsi sendcmd: no error

CDB:  A1 00 00 00 00 00 00 00 00 00 00 00

status: 0x2 (CHECK CONDITION)

Sense Bytes: 70 00 05 00 00 00 00 0A 00 00 00 00 24 00 00 00 00 00

Sense Key: 0x5 Illegal Request, Segment 0

Sense Code: 0x24 Qual 0x00 (invalid field in cdb) Fru 0x0

Sense flags: Blk 0 (not valid) 

cmd finished after 0.000s timeout 9600s

cdrecord: Cannot blank disk, aborting.

```

this is the first problem. though the drive is detected, opperations fail.

the second problem is highlighted by the following error message. If i run the same command as above as regular user, which belongs to the cdrw group, i get the following:

```

.....

scsidev: 'ATAPI:0,0,0'

devname: 'ATAPI'

scsibus: 0 target: 0 lun: 0

Warning: Using ATA Packet interface.

Warning: The related Linux kernel interface code seems to be unmaintained.

Warning: There is absolutely NO DMA, operations thus are slow.

Using libscg version 'schily-0.8'.

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

```

When I run graphical front ends such as graveman or xcdroast, they detect my drive as a CD reader only.

I would hate to be required to keep windows on my hard drive just to be able to run Nero, so help would be immensly appreciated.

----------

## pksings

I am able to burn using K3B to my ATAPI drive just fine. I might add that it's the only program I have found which works.

PK

----------

## manucorrales

All my problems with cd recording were solved when i do chmod for all users to

/usr/bin/cdrecord

and more important remove the setUID permission !!

That was the reason it didnt work

----------

## lami

I have similar experience, using xcdroast, after upgrade to 2.6 kernel. Althouf it didn't worked from commandline for first time. I am using cdrecord and cdrecord-ProDVD, both behaved same (I'll probably mix them here). All I do as common user, after I let xcdroast setup enviroment for multi-user burning.

```
$ cdrecord dev=ATAPI:0,0,0 speed=4 blank=fast

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

on-the-fly encryption (version 1.0-rc1) built-in, (C) 2004,2005 Maximilian Decker

<snip>

cdrecord: Warning: Running on Linux-2.6.11-gentoo-r5

cdrecord: There are unsettled issues with Linux-2.5 and newer.

cdrecord: If you have unexpected problems, please try Linux-2.4 or Solaris.

cdrecord: Cannot allocate memory. WARNING: Cannot do mlockall(2).

cdrecord: WARNING: This causes a high risk for buffer underruns.

cdrecord: Operation not permitted. WARNING: Cannot set RR-scheduler

cdrecord: Permission denied. WARNING: Cannot set priority using setpriority().

cdrecord: WARNING: This causes a high risk for buffer underruns.

scsidev: 'ATAPI:0,0,0'

devname: 'ATAPI'

scsibus: 0 target: 0 lun: 0

Warning: Using ATA Packet interface.

Warning: The related Linux kernel interface code seems to be unmaintained.

Warning: There is absolutely NO DMA, operations thus are slow.

Using libscg version 'schily-0.8'.

<snip>

Supported modes:

cdrecord: Operation not permitted. prevent/allow medium removal: scsi sendcmd: no error

CDB:  1E 00 00 00 01 00

status: 0x0 (GOOD STATUS)

cmd finished after 0.000s timeout 40s

cdrecord: Cannot init drive.
```

After I did cdrecord dev=HELP, I noticed "ATA" instead of "ATAPI". With dev=ATA:0,0,0 I've been able to do anything from commandline, even burn CD

```
$ cdrecord-ProDVD dev=ATA:0,0,0 speed=4 -dao install/install-x86-minimal-2004.3-r1.iso

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

Unlocked features:

Limited  features:

cdrecord-ProDVD: Cannot allocate memory. WARNING: Cannot do mlockall(2).

cdrecord-ProDVD: WARNING: This causes a high risk for buffer underruns.

cdrecord-ProDVD: Operation not permitted. WARNING: Cannot set RR-scheduler

cdrecord-ProDVD: Permission denied. WARNING: Cannot set priority using setpriority().

cdrecord-ProDVD: WARNING: This causes a high risk for buffer underruns.

scsidev: 'ATA:0,0,0'

devname: 'ATA'

scsibus: 0 target: 0 lun: 0

Warning: Using badly designed ATAPI via /dev/hd* interface.

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    : 'TEAC    '

Identifikation : 'DV-W516GA       '

Revision       : 'C4S2'

Device seems to be: Generic mmc2 DVD-R/DVD-RW.

cdrecord-ProDVD: This version of cdrecord limits DVD-R/DVD-RW support to -dummy or 1 GB real.

cdrecord-ProDVD: If you need full DVD-R/DVD-RW support, ask the Author for cdrecord-ProDVD.

cdrecord-ProDVD: Free test versions and free keys for personal use are at ftp://ftp.berlios.de/pub/cdrecord/ProDVD/

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-ProDVD: Operation not permitted. WARNING: Cannot set RR-scheduler

cdrecord-ProDVD: Permission denied. WARNING: Cannot set priority using setpriority().

cdrecord-ProDVD: WARNING: This causes a high risk for buffer underruns.

Starting to write CD/DVD at speed 4 in real SAO mode for single session.

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

Turning BURN-Free off

Track 01: Total bytes read/written: 52992000/52992000 (25875 sectors).
```

But it doens't work from xcdroast, even when I manually added ATA:0,0,0 device into the list. I'll try to do some more research about it (ie. how commandline parameters differ when burning from xcdroast)... If I'll have a bit of free time, commandline is sufficient for me right now

----------

## mijenks

I've been meaning to ask this for a few weeks now, but always thought I might stumble upon the answer somewhere.  Well I'm done looking, for now:

Is there a definitive guide to CD Burning for >=2.6.8.1?  Seriously, being able to burn only as root sucks.  Or, what sucks even more is booting Knoppix just to burn CDs.  All this ridiculousness with recent kernel releases has started getting silly.  I noticed an option in 2.6.10 config that allowed packet writing directly to devices -- I think for the purposes of CD burning.  I enabled, but still, no luck.

If people have CD burning working as non-root for >=2.6.8.1, I would think that a guide could be written by now.  After about two weeks of searching, all I do is turn up the same posts, articles and such all over again . . . and most of those outdated.

Ridiculous.

----------

## bollucks

CD burning for non-root post 2.6.7 was considered a security risk. The reason is the commands that do the burning also can completely rewrite the firmware of your cd burner turning it into a door stop. Having said that, the chance of some code actually doing this maliciously in linux is (at the moment) zero, and if you burn as root the risk still exists anyway so it's a silly cyclical problem the developers refuse to address. -ck has a patch in the patchset that allows an ordinary user to burn cds. You can get it by using ck-sources or by just adding the patch yourself to your sources. The latest version is:

http://ck.kolivas.org/patches/2.6/2.6.11/2.6.11-ck4/patches/cddvd-cmdfilter-drop.patch

This is a fairly simple patch that should apply to any recent kernel and allows cd burning as user. For it to work, however, you must also disable the SUID root bit on cdrecord like so:

```

chmod -s /usr/bin/cdrecord

```

Then cd burning as an ordinary user should work from any application that uses cdrecord.

Oh and please stop using all other interfaces for 2.6 for IDE. There is only one supported interface:

```

cdrecord dev=/dev/hdc

```

for hdc etc. Ignore the warning message that cdrecord gives you; the cdrecord author is a crazy fool who refuses to agree to anything with the linux developers.

----------

## bollucks

I don't get it. Heaps of forum threads with this same problem over and over again, and every time I answer what the problem is the thread gets ignored, and two more threads with the same problem appear...

For god's sake stop using other interfaces for IDE with cdrecord; call the device directly.

----------

## dsd

i see the same - i also did this a lot a couple of months ago until i got bored. by the way - please dont ask people to use that cmdfilter patch - its not needed. if it makes a difference, its a bug, people should mail me their dmesg output and i will fix up the command table (i have already done this for about ~5 commands thanks to user feedback)

----------

## mijenks

Hey guys, I hate to bitch, but when the search function for the forums sucks as royally as it does, you really can't fault the users for it.  Although I did follow dsd's thread wherein he was asking for people to test his patch for quite a while, it really got me nowhere.

This all brings me back to my original post in this thread:  Why is there not a definitive guide to burning with >2.6.8.1?  As I said before, the gentoo-wiki is outdated.  Realize that we are all frustrated with this, just as much as you devs are.

Also, could a dev edit a cdrecord or cdrdao ebuild so that messages are passed to users during emerges of the pertinent packages, pointing them in the right direction?  I have no experience with ebuilds, but would submit one to bugzilla if it were deemed appropriate, or if I knew where the hell I could get good, solid, up to date information.

----------

## redog

xcdroast does not work for me.

ive setup /dev/hdc 

scsibus1:

        1,0,0   100) 'MATSHITA' 'CD-RW  CW-8121  ' 'AA20' Removable CD-ROM

xcdroast only detects ATAPI 

scsibus0:

        0,0,0     0) 'MATSHITA' 'CD-RW  CW-8121  ' 'AA20' Removable CD-ROM

But I cannot burn cds

I am useing ide-cd 

setuid or setgid is NOT set on 

$ls -l `which cdrecord`

-rwxr-xr-x  1 root root 357640 Apr  9 00:22 /usr/bin/cdrecord

2.6.7 worked fine

2.6.10-gentoo-r6 doesn't work

So WTF?

btw xcdroast works fine as root. I suppose linspire just might have an ease of use advantage afterall  ;-P

----------

## dsd

xcdroast does weird things with suid bits. make sure that xcdroast and its helper apps are *not* suid.

btw, i think xcdroast might be broken at this point in time. the author no longer develops it.

----------

## redog

xcdrwrap is setuid

-rwsr-xr-x  1 root root 15936 Aug  3  2004 /usr/lib/xcdroast-0.98/bin/xcdrwrap

unsetting it causes an error when starting xcdroast as a normal user.

I suppose your correct, xcdroast is roasted.

 :Sad: 

Anyone know another lightweight frontend to cdrecord?

k3b is nice but way too big for my liking.

----------

## GungHo

 *dsd wrote:*   

> xcdroast does weird things with suid bits. make sure that xcdroast and its helper apps are *not* suid.
> 
> btw, i think xcdroast might be broken at this point in time. the author no longer develops it.

 

well, I'm not a developer, only a user. But I can imagine, what the developers of xcdroast and cdrecord think about this weird madness, that breaks core applications that have worked for years, and it's functionality is now broken. Give them clear guidance how their applications shall be developed to work in the future. 

But I think this should be done on the LKML. The developers of this cdburning apps are developing apps, that should work across a broad variety of hardware and operating systems, should be portable, that is hard stuff.

I for myself want to have a simple, working solution to burn CD's (or DVD's), as xcdroast and cdrecord have been for a long time, for years. Not being able to burn CD's is a clear showstopper for using Linux ! As a normal user I'm not interested wether these apps are doing weird things with suid flags, I need working applications, not academic solutions !

cheers  :Smile: 

----------

## manny15

I've been trying to figure out the best way to set up CD burning on kernels 2.6.*. SUID may not work, but has anyone considered SGID (set-group-id)? It seems to work here:

```

# chgrp disk /usr/bin/cdrecord

# chmod g+s /usr/bin/cdrecord
```

```
$ ls /usr/bin/cdrecord -l

-rwxr-sr-x  1 root disk 282368 Jun 15 17:38 /usr/bin/cdrecord
```

From my understanding, this gives cdrecord access to files in the disk group, which include /dev/hd*, /dev/sg*. So after this change...

```
$ cdrecord dev=ATA -scanbus

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

cdrecord: Warning: Running on Linux-2.6.11-ck10

cdrecord: There are unsettled issues with Linux-2.5 and newer.

cdrecord: If you have unexpected problems, please try Linux-2.4 or Solaris.

scsidev: 'ATA'

devname: 'ATA'

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

Warning: Using badly designed ATAPI via /dev/hd* interface.

Linux sg driver version: 3.5.27

Using libscg version 'schily-0.8'.

scsibus1:

        1,0,0   100) *

        1,1,0   101) 'LITEON  ' 'DVD-ROM LTD163  ' 'GDHG' Removable CD-ROM

        1,2,0   102) *

        1,3,0   103) *

        1,4,0   104) *

        1,5,0   105) *

        1,6,0   106) *

        1,7,0   107) *

```

...works for normal users. Of course, this means we would need to trust cdrecord and friends not to cause havoc with our disk drives. But regardless of the approach chosen, I really which this was not only documented, but that cdrtools and cdrdao ebuilds are updated and set things up automatically. Having to modify these permissions every time these packages are updated is quite silly.

----------

## dsd

your understanding of sgid is wrong - you dont need it just to give a certain group read/write access to nodes! (chmod g+rw ....)

you dont need suid or sgid or anything special. just write access as a normal user will do fine.

on recent setups, this will be handled already. cdrom nodes will be owned by group cdrom and will have g+rw permissions applied

----------

## manny15

Well, you are right about the cdrom device being in the cdrom group. And I can use hotplug to adjust the permissions of my USB CDRW when I plug it in. BUT, there's still one problem. cdrecord -scanbus won't work if it doesn't have access to all devices nodes, hd* and sg*. Instead of skipping the ones it doesn't have access to, it bombs when it finds one it can't access due to permissions. If you run cdrecord from the command line knowing which device to specify, then it's no problem. But GUI programs can't run cdrecord -scanbus successfully, so they can't list the available cdrom/cdrw devices.

I think my understanding of sgid is pretty darn good. If I wanted to give users access to certain files through an executable and not give the users direct access to the files, sgid can do the job. I really don't want to use sgid (I just disabled it) but besides using suid, which to me is riskier, how can cdrecord -scanbus work?

----------

## BigBaaadBob

OK.  I'm stoopid.  I can't discern from the above (or any of the other posts) what the experts want us to do.  I'm using XCDRoast, gentoo-sources-2.6.11, I'm in the cdrom and cdrw groups, and I still get the dreaded: 

```
Calling: /usr/lib/xcdroast-0.98/bin/xcdrwrap CDRECORD dev= "/dev/hdd" gracetime=2 fs=4096k driveropts=burnfree -v -useinfo speed=31 -dao -eject -pad -audio "/track-01.wav" ...

cdrecord: Warning: Running on Linux-2.6.11-gentoo-r11

Cdrecord-Clone 2.01 (i686-pc-linux-gnu) Copyright (C) 1995-2004 J\uffffrg Schilling

cdrecord: There are unsettled issues with Linux-2.5 and newer.

TOC Type: 0 = CD-DA

cdrecord: If you have unexpected problems, please try Linux-2.4 or Solaris.

Using libscg version 'schily-0.8'.

scsidev: '/dev/hdd'

Driveropts: 'burnfree'

devname: '/dev/hdd'

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

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

Linux sg driver version: 3.5.27

SCSI buffer size: 64512

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

```

Can someone, in small easily digestable steps, using words with not too many letters, tell me what I need to do to make this work?

----------

## manny15

 *BigBadBob wrote:*   

> OK.  I'm stoopid.  I can't discern from the above (or any of the other posts) what the experts want us to do.  I'm using XCDRoast, gentoo-sources-2.6.11, I'm in the cdrom and cdrw groups, and I still get the dreaded: 
> 
> ```
> Calling: /usr/lib/xcdroast-0.98/bin/xcdrwrap CDRECORD dev= "/dev/hdd" gracetime=2 fs=4096k driveropts=burnfree -v -useinfo speed=31 -dao -eject -pad -audio "/track-01.wav" ...
> 
> ...

 

I think I had that problem not too long ago. It's not a permissions problem. Here's the only step you need to perform:

```
emerge cdrtools
```

Yes, just recompile the thing  :Smile: 

----------

## farceb

Yes, as manny15 said, I just recompiled cdrecord and the thing is up and running.

----------

## BigBaaadBob

 *farceb wrote:*   

> Yes, as manny15 said, I just recompiled cdrecord and the thing is up and running.

 

Just did that.  No change, still get the alloc error.

----------

## manny15

 *BigBaaadBob wrote:*   

>  *farceb wrote:*   Yes, as manny15 said, I just recompiled cdrecord and the thing is up and running. 
> 
> Just did that.  No change, still get the alloc error.

 

1. Check dmesg for SCSI-related errors.

2. Run cdrecord within gdb and see if it gives you an error.

----------

## BigBaaadBob

No dmesg errors, and cdrecord (inside of xcdroast) runs fine if I'm root.  I think this is xcdroast brokenness and I'm sure it has been fixed somewhere, so off searching I go.

Update: So, I didn't even realize this was an xcdroast thread, this has been broken so long!!!

Even if the xcdroast developer is a goof, why can't the ebuild fix this?

----------

