# Request for testing: CD/DVD writing on 2.6.9

## dsd

Hi,

Now that I've got a cd writer again I've been trying to straighten out the CD burning situation in recent 2.6 kernels. To put it in context:

Sometime soon after 2.6.7, it was decided that allowing users to execute SCSI commands was a big security issue (even though they are usually connected through IDE/ATAPI, cd writers use SCSI commands for CD writing).

2.6.8 came out with a security fix, which was too restrictive and mostly broke cd writing. 2.6.9 improved upon this and has solved the problem (I think!).

The thing is, gentoo-dev-sources and ck-sources (probably others too) include a patch in the 2.6.8 and 2.6.9 releases, which completely bypasses the security fix. So these issues probably weren't visible anyway.

I removed the patch and tested writing on my new burner. It worked as expected, minus cdrdao not being able to read the buffer capacity. I wrote a kernel patch to allow it to be able to read that again,which got accepted into the 2.6.10 tree yesterday.

I've removed the bypass-security-fix from gentoo-dev-2.6.9-r3 and added my own patch to allow cdrdao to be happy again. What I'd appreciate now is testing from people who burn CDs or DVDs, so that we can be sure that the security fix isnt rejecting SCSI commands that are required.

Here's what you need to do:

1. Get the latest sources:

```
emerge =gentoo-dev-sources-2.6.9-r3
```

This has just gone into portage so you probably need to sync. Also its marked ~arch so will involve you going into the testing tree.

2. Apply a further debug patch which will tell us if SCSI commands are being rejected:

```

cd /usr/src/linux-2.6.9-gentoo-r3

wget "http://www.reactivated.net/patches/linux-kernel/2.6.9/scsi_ioctl-debug-rejected-commands.patch"

patch -p1 -i scsi_ioctl-debug-rejected-commands.patch
```

3. Compile, install, and reboot into your new kernel in the usual way.

4. Ensure that you have write access to your CD/DVD writer node. My CD writer is /dev/hdc and I can see that I need to be in the "disk" group to be able to write to it:

```
# ls -l /dev/hdc

brw-rw----  1 root disk 22, 0 Nov  3 22:36 /dev/hdc
```

5. Make sure your CD writing software is *not* setuid root.

```
chmod -s /usr/bin/cdrecord

chmod -s /usr/bin/cdrdao

# repeat for all other cd writing software you use
```

6. Write a CD. Simulation will do. Do this as a user, *not* as root.

And make sure you use the dev=/dev/hdc notation for cdrecord. Using dev=ATAPI:0,0,0 style notation no longer works.

7. Run "dmesg". Towards the end of the output, you will probably see output such as:

```
verify_command: rejected command 1
```

Post all of those rejection messages here.

Please repeat this for other software you have available. I'm especially interested in getting this tested with k3b (I don't fancy compiling X, half of KDE, ..., on my server just to try this). Also testing from DVD writing software would be great, since I don't own a DVD writer.

Thanks!

----------

## Codo

dsd:

  I can do some testing tonight.  My CDR is USB though, connected to my laptop.  I think the CDR itself is IDE/ATAPI over USB.  Is it worth?  If not, let me know pls.

Codo

----------

## dsd

yes, that will be useful - thanks  :Smile: 

i think USB cd writing goes over the same transport. It should be easy to see for certain, since it should definately reject command 1 a few times (still trying to find out exactly what this is)

----------

## Codo

Made some testing, and...  nothing.  there is no output on /var/log/messages...

I am using cdrecord with a GUI called cdbakeoven.  The only thing is that cdrecord complains about not being able to do a mlockall and set RR-scheduler, but I think this has nothing to do with the SCSI transport...

Let me know if you need me to check anything.

----------

## dsd

hm, in a way thats good news, perhaps rejecting command 1 is something specific to my setup.

even so, you could run a couple of checks to make sure you are running the right kernel:

running "uname -v" will tell you the date and time when the active kernel was compiled.

when you open /usr/src/linux-2.6.9-gentoo-r3/drivers/block/scsi_ioctl.c in a text editor, you should be able to do a search for "rejected" which will take you to a code block looking like the following:

```

        if (verify_command(file, cmd)) {

                printk(KERN_ERR "verify_command: rejected command %x\n", cmd[0]);

                return -EPERM;

        }

```

as long as that is there, and you are definately booted into the right kernel, then we can say that everything is working just fine  :Smile: 

thanks for the test

----------

## keyson

Hi

On my:

 *Quote:*   

> hdc: LITE-ON DVDRW LDW-811S, ATAPI CD/DVD-ROM drive

 

i get:

 *Quote:*   

> verify_command: rejected command 1

 

when burning a cdr with k3b.

 *Quote:*   

> verify_command: rejected command 1

 

when burning cdrw (k3b)

And

 *Quote:*   

> verify_command: rejected command 1e

 

when i burnt a dvd+rw (k3b)(Don't want to burn a dvd+r as it would

not simulate)

Program used by k3b:

cdrecord 2.1

dvd+rw-format 4.10

-Kjell

----------

## dsd

thanks! command 1 seems to be obseleted so i wont worry about that, but 1e is PREVENT_ALLOW_MEDIUM_REMOVAL which basically allows the software to ask the drive not to allow the user to eject the disc, or to let them eject it again, etc. it doesn't conflict with any other commands and looks safe so i'll get it added to the kernel.

----------

## Codo

dsd:

  I don't know if you're interested (I was going to do some tests...) but when I booted your kernel, burned, and then tried to reboot, my kernel crashed.  As I went to the toilet while it was rebooting, I couldn't see what actually went wrong, but the callstack (if that was a callstack) indicated some problems in the SCSI modules/functions.

  The door of my CDR was open when trying to reboot, maybe that was an issue.  I managed to hang the computer as well unplugging my USB 2.0 PCMCIA adapter (my connection is PCMCIA --> USB --> CDR).

  I have to go now, I'll do more tests later...

----------

## Broot

Unfortunately, I tried burning a CD with cdrecord as a regular user (via xcdroast) and all it can give me is this:

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

Before doing chmod -s /usr/bin/cdrecord, it also had a statement at the end that said something like Using 'schily-0.8.'

Checking dmesg, all I get is a long string of rejected commands type "55" interspersed with some types "bb."

In any event, I'm very glad someone is addressing this issue, as I really did not want to downgrade my kernel so I could have functional CD writing. Thanks for the patch.  :Smile: 

EDIT: Tried to burn the same files to CD using xcdroast in su mode. Both times I tried, OPC failed and the whole operation stopped within a few seconds. dmesg didn't show up with anything new. I uploaded the saved cdrecord.out file for reference.Last edited by Broot on Sat Nov 06, 2004 9:17 pm; edited 1 time in total

----------

## Broot

Update: I tried to burn the Ubuntu Linux 4.10 LiveCD ISO again using the Nautilus CD-writing plugin as a normal user. Everything seemed to go normally, although I could hear the CD drive speed up and slow down frantically during certain intervals, especially after fixating. As before (with 2.6.9-gentoo-r1 - refer to this thread for more info and ignore my second post), the CD is unreadable. :/

----------

## dsd

dont write cd's as root. take all the suid bits off etc (please reread the instructions at the top). it should work just fine as normal user. but, if when you are doing this, rejection messages appear in dmesg, then i'd like to know.

55 and bb are already permitted by the kernel, but only if the software opens the devices in write mode - some software opens in RDONLY, which causes rejections like this. same issue exists for the 1e command mentioned already in this thread..its time to track down which software caused that request. i've already fixed cdmrw and cdrwtool here.

your cd recording issue sounds a little odd if you have definately followed the instructions in this thread. which other kernels have you tried? when did it last work?

----------

## dsd

keyson: as mentioned above, your rejected command 1e is not a kernel issue. it is most likely it came from dvd+rw-format, and i just checked their sources, they have already fixed this in the latest ~arch release. thanks for the testing!

----------

## mholtz

I got this when I tried to burn a CD with the steps outlined above:

```

verify_command: rejected command 55

verify_command: rejected command 55

verify_command: rejected command 55

verify_command: rejected command 55

verify_command: rejected command 55

verify_command: rejected command 55

verify_command: rejected command 55

verify_command: rejected command 55

verify_command: rejected command 55

```

I should also note that the CD refused to burn this time around.  This time cdrecord reports that 

```

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

cdrecord: Warning: Running on Linux-2.6.9-gentoo-r3

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: Warning: Linux-2.6.8 introduced incompatible interface changes.

cdrecord: Warning: SCSI transport does no longer work for suid root programs.

cdrecord: Warning: if cdrecord fails, try to run it from a root account.

TOC Type: 0 = CD-DA

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'.

SCSI buffer size: 64512

atapi: 1

Device type    : Removable CD-ROM

Version        : 0

Response Format: 2

Capabilities   :

Vendor_info    : 'LITE-ON '

Identifikation : 'COMBO LTC-48161H'

Revision       : 'KH0P'

Device seems to be: Generic mmc2 DVD-ROM.

Current: 0x0009

Profile: 0x0010

Profile: 0x000A

Profile: 0x0009 (current)

Profile: 0x0008

Profile: 0x0002

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

Driver flags   : MMC-3 SWABAUDIO BURNFREE FORCESPEED

Supported modes:

Drive buf size : 1422080 = 1388 KB

FIFO size      : 4194304 = 4096 KB

cdrecord: Drive does not support TAO recording.

cdrecord: Illegal write mode for this drive.

verify_command: rejected command 55

```

This is regardless of the fact that cdrecord reports this:

```

#cdrecord dev="ATAPI:0,0,0" -atip

cdDevice type  : Removable CD-ROM

Version        : 0

Response Format: 2

Capabilities   :

Vendor_info    : 'LITE-ON '

Identifikation : 'COMBO LTC-48161H'

Revision       : 'KH0P'

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/R96R

```

----------

## dsd

mholtz: are you sure you have write access to your cd writer node? which cdrecord command are you using?

command 55 is MODE_SELECT and this is permitted by the kernel filter as long as you have write access to the device in question.

----------

## mholtz

The command I ran for the above output was this:

```

$ cdrecord dev=ATAPI:0,0,0 speed=44 -pad -audio -v -gracetime=2 *.wav

```

Here is the info on my CD-R node.

```

$ ls -la /dev/cdroms/cdrom0

lrwxrwxrwx  1 root root 6 11æ 10 09:00 /dev/cdroms/cdrom0 -> ../hdc

$ ls -la /dev/hdc

brw-------  1 mholtz cdrom 22, 0  5æ 10  2004 /dev/hdc

```

Unless the device node changes its permissions from kernel to kernel (does it?), it should have worked, no?

----------

## dsd

how about if you try:

```
cdrecord dev=/dev/hdc speed=44 -pad -audio -v -gracetime=2 *.wav 
```

also, how about a data cd? maybe your problem only affects audio cd's, i havent tried them..

----------

## AC

i've tried your solution with the patch. actualy, i'm currently using 2.6.9-r3 kernel but I can't use my cdrw/dvd combo drive. this is what I get when i run

ls -l /dev/hd*

```

lr-xr-xr-x  1 root root 32 Nov 10 15:25 /dev/hda -> ide/host0/bus0/target0/lun0/disc

lr-xr-xr-x  1 root root 33 Nov 10 15:25 /dev/hda1 -> ide/host0/bus0/target0/lun0/part1

lr-xr-xr-x  1 root root 33 Nov 10 15:25 /dev/hda2 -> ide/host0/bus0/target0/lun0/part2

lr-xr-xr-x  1 root root 33 Nov 10 15:25 /dev/hda3 -> ide/host0/bus0/target0/lun0/part3

lr-xr-xr-x  1 root root 33 Nov 10 15:25 /dev/hda4 -> ide/host0/bus0/target0/lun0/part4

```

this is my dmesg | grep hd

```

Kernel command line: root=/dev/hda4 append="hdc=ide"

    ide0: BM-DMA at 0x1860-0x1867, BIOS settings: hda:DMA, hdb:pio

    ide1: BM-DMA at 0x1868-0x186f, BIOS settings: hdc:DMA, hdd:pio

hda: HTS548040M9AT00, ATA DISK drive

hdc: TOSHIBA DVD-ROM SD-R9012, ATAPI CD/DVD-ROM drive

hda: max request size: 128KiB

hda: Host Protected Area detected.

hda: 71029746 sectors (36367 MB) w/7877KiB Cache, CHS=65535/16/63, UDMA(100)

hda: cache flushes supported

hdc: ATAPI 24X DVD-ROM CD-R/RW drive, 2048kB Cache, UDMA(33)

ReiserFS: hda4: found reiserfs format "3.6" with standard journal

ReiserFS: hda4: using ordered data mode

ReiserFS: hda4: journal params: device hda4, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30

ReiserFS: hda4: checking transaction log (hda4)

ReiserFS: hda4: Using r5 hash to sort names

Adding 1005472k swap on /dev/hda3.  Priority:-1 extents:1

e1000: eth0: e1000_watchdog: NIC Link is Up 100 Mbps Full Duplex

hda: dma_intr: status=0x58 { DriveReady SeekComplete DataRequest }

hda: set_drive_speed_status: status=0x58 { DriveReady SeekComplete DataRequest }

```

cat /etc/fstab

```

# /etc/fstab: static file system information.

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/fstab,v 1.14 2003/10/13 20:03:38 azarah Exp $

#

# noatime turns off atimes for increased performance (atimes normally aren't

# needed; notail increases performance of ReiserFS (at the expense of storage

# efficiency).  It's safe to drop the noatime options if you want and to

# switch between notail and tail freely.

# <fs>                  <mountpoint>    <type>          <opts>                  <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

/dev/hda2               /boot           ext2            noauto,noatime          1 2

/dev/hda3               none            swap            sw                      0 0

/dev/hda4               /               reiserfs        noatime                 0 1

/dev/cdroms/cdrom0      /mnt/cdrom      iso9660         noauto,user,ro          0 0

/dev/hda1               /mnt/win        ntfs            auto,user,umask=022     0 0

# NOTE: The next line is critical for boot!

none                    /proc           proc            defaults                0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for

# POSIX shared memory (shm_open, shm_unlink).

# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will

#  use almost no memory if not populated with files)

# Adding the following line to /etc/fstab should take care of this:

none                    /dev/shm        tmpfs           defaults                0 0

#none                   /proc/bus/usb   usbfs           defaults                0 0

```

mount /mnt/cdrom

```

mount: special device /dev/cdroms/cdrom0 does not exist

```

mount /dev/hdc /mnt/cdrom

```

mount: special device /dev/hdc does not exist

```

i've searched the forum for 3 weeks or so now. if you could shed some light I would be most grateful.

if you need any more info to post let me know,

thank you

----------

## dsd

your device manager isnt creating a node for your cdrom. this is a totally separate issue, please open another thread to keep this one on track.

----------

## AC

wow, you're fast.

i've opened a new thread, thanks

----------

## irondog

So, if I'm not supposed to burn as root, how should the permissions of the cdrom device (I.E. /dev/hda) look like?

After booting it's 600 here, but shouldn't it be the number o/t beast?

----------

## idkwiam187

irondog: you should change the ownership of the device so that root owns it and its group is a CD Buring group, "cdrom" for example.  Then set the permissions to 660 and put your normal user, and any other users on the box that will use the burner in that group.

----------

## eradicator

 *dsd wrote:*   

> how about if you try:
> 
> ```
> cdrecord dev=/dev/hdc speed=44 -pad -audio -v -gracetime=2 *.wav 
> ```
> ...

 

I had the same issue... changing to dev=/dev/hdc is a usable workaround for me

----------

## eradicator

Seems to be burning fine, but I'm getting these rejections:

verify_command: rejected command 1

verify_command: rejected command 4d

----------

## donjuan

Seems to have burned successfully with k3b, got these though:

verify_command: rejected command 1e

verify_command: rejected command 1e

verify_command: rejected command e9

verify_command: rejected command e9

verify_command: rejected command ed

verify_command: rejected command e9

verify_command: rejected command 1

verify_command: rejected command f5

verify_command: rejected command e9

verify_command: rejected command eb

verify_command: rejected command f5

----------

## dsd

 *eradicator wrote:*   

> Seems to be burning fine, but I'm getting these rejections:
> 
> verify_command: rejected command 1
> 
> verify_command: rejected command 4d

 

which software are you using? 4d is log sense, doesnt conflict with anything, might be worth adding if the context looks ok.

donjuan : is this with cd's or dvds? do you know which software k3b is invoking to do the writing? 1e has already been addressed if its dvd+rw-format .. the others are outside of the scsi spec which is odd. could you please post the output of

```
cdrecord -dev=/dev/hdc -checkdrive
```

----------

## donjuan

It is using cdrecord, and I was copying a CD that was in my DVD drive.  It's also using burnfree if that makes any difference.

Here's the output of 

```
cdrecord -dev=/dev/hdd -checkdrive
```

 *Quote:*   

> Cdrecord-Clone 2.01 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Schilling
> 
> cdrecord: Warning: Running on Linux-2.6.9-gentoo-r3
> 
> cdrecord: There are unsettled issues with Linux-2.5 and newer.
> ...

 

----------

## r3pek

@dsd:

i can burn cd's with cdrecord..... but i can't use growisofs.

(burning as user)

here's the log from k3b:

```
System

-----------------------

K3b Version:0.11.17 

KDE Version: 3.3.0

QT Version: 3.3.3

growisofs

-----------------------

Executing 'builtin_dd if=/dev/fd/0 of=/dev/hdc obs=32k seek=0'

:-( unable to PREVENT MEDIA REMOVAL: Operation not permitted

growisofs comand:

-----------------------

/usr/bin/growisofs -Z /dev/hdc=/dev/fd/0 -use-the-force-luke=notray -use-the-force-luke=tty -use-the-force-luke=dao -dvd-compat -speed=2 -overburn 

mkisofs

-----------------------

/usr/bin/mkisofs: Warning: -follow-links does not always work correctly; be careful.

mkisofs comand:

-----------------------

/usr/bin/mkisofs -gui -graft-points -volid K3b data project -volset  -appid K3B THE CD KREATOR VERSION 0.11.17 (C) 2003 SEBASTIAN TRUEG AND THE K3B TEAM -publisher  -preparer K3b - Version 0.11.17 -sysid LINUX -volset-size 1 -volset-seqno 1 -sort /tmp/kde-r3pek/k3bX4Odma.tmp -rational-rock -hide-list /tmp/kde-r3pek/k3bHPVDmc.tmp -full-iso9660-filenames -follow-links -iso-level 2 -path-list /tmp/kde-r3pek/k3bTrOhfc.tmp -dvd-video /tmp/kde-r3pek/k3bVideoDvd1 /home/r3pek/.kde/share/apps/k3b/temp/dummydir0/ 
```

```
r3pek@Trinity r3pek $ groups

tty disk wheel audio cdrom games cdrw users portage
```

```
r3pek@Trinity r3pek $ ls /dev/dvdrec /dev/hdc

lrwxrwxrwx  1 root  root     3 Nov 12 09:07 /dev/dvdrec -> hdc

brw-------  1 r3pek root 22, 0 Nov 12 09:07 /dev/hdc

```

i'm using udev. any special atention needed?

----------

## xanderhsia

I got the same error at first as r3pek

Now after several tries, I get the following instead

```

System

-----------------------

K3b Version:0.11.17 

KDE Version: 3.3.1

QT Version: 3.3.3

growisofs

-----------------------

WARNING: /dev/hdd already carries isofs!

About to execute 'builtin_dd if=/dev/fd/0 of=/dev/hdd obs=32k seek=0'

:-( write failed: Input/output error

growisofs comand:

-----------------------

/usr/bin/growisofs -Z /dev/hdd=/dev/fd/0 -use-the-force-luke=notray -use-the-force-luke=tty -use-the-force-luke=dao -dvd-compat -speed=2.4 

```

I have not yet done the second patch for logging errors. Will try that and report back

----------

## Cazzantonio

 *r3pek wrote:*   

> @dsd:
> 
> i can burn cd's with cdrecord..... but i can't use growisofs.
> 
> (burning as user)
> ...

 

I got the same error with growisofs (& k3b), but i can burn if logged as root

I'm using 2.6.9-gentoo-r4 & pure udev

----------

## llsardonicll

k3b works great, no messages at all

*edit

xcdroast is broken now, it fails with 

```

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

```

worked fine with previous kernels, works fine now as root, not users...off I go to find the solution to this problem.

----------

## phekko

 *r3pek wrote:*   

> 
> 
>  unable to PREVENT MEDIA REMOVAL: Operation not permitted
> 
> 

 

I get this too. Used to work until upgrading to kernel 2.6.9-gentoo-r4. Ideas how to fix this would be welcome

----------

## dsd

growisofs users: please upgrade to the latest testing version of dvd+rw-tools (5.21.4.10.8 ). they already fixed dvd+rw-format in that release, so i'm thinking they probably fixed growisofs too.

please report back here and let me know if it works. if it does, i'll send in a request to make 5.21.4.10.8 stable

llsardonicll: that is usually just a cdrecord warning. does cdrecord work ok outside of xcdroast?

donjuan: fyi, i figured out those rejected commands - they are specific to plextor writers. i'll see what the linux block maintainer thinks about this sort of situation..

----------

## llsardonicll

Yeah, cdrecord works fine just seems to be a xcdroast problem...i have a plextor drive and I get  no reject commands at all.                                      

```

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

cdrecord: Warning: Running on Linux-2.6.9-gentoo-r4

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: Warning: Linux-2.6.8 introduced incompatible interface changes.

cdrecord: Warning: SCSI transport does no longer work for suid root programs.

cdrecord: Warning: if cdrecord fails, try to run it from a root account.

scsidev: '/dev/hdd'

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

Using libscg version 'schily-0.8'.

Device type    : Removable CD-ROM

Version        : 0

Response Format: 1

Vendor_info    : 'PLEXTOR '

Identifikation : 'CD-R   PREMIUM  '

Revision       : '1.05'

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 VARIREC FORCESPEED SPEEDREAD SINGLESESSION HIDECDR

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

```

----------

## phekko

After emerging the new dvd+rw-tools everything seems to work a-ok. Thanks for the help. Now don't have any problems whatsoever with dvd writing

----------

## rapsure

I am currently running the 2.6.10-rc2 kernel, and this is what I have concluded.  I have a patch that I found for cdrtools that will allow a user to burn to a cd.  This is a vanilla kernel that hasn't been patched, and cdrtools that has been patched.  Here it is:  

```
--- cdrtools-2.01/cdrecord/cdrecord.c.orig   2004-10-28 12:44:39.927882183 -0400

+++ cdrtools-2.01/cdrecord/cdrecord.c   2004-10-28 13:00:02.627948467 -0400

@@ -492,8 +492,11 @@

    /*

     * XXX Below this point we do not need root privilleges anymore.

     */

-   if (geteuid() != getuid()) {   /* AIX does not like to do this */

+   

+   // fixing issue with kernel >= 2.6.8.1

+   //if (geteuid() != getuid()) {   /* AIX does not like to do this */

                /* If we are not root      */

+   /*

 #ifdef   HAVE_SETREUID

       if (setreuid(-1, getuid()) < 0)

 #else

@@ -505,6 +508,8 @@

 #endif

          comerr("Panic cannot set back effective uid.\n");

    }

+    */

+

    /*

     * WARNING: We now are no more able to do any privilleged operation

     * unless we have been called by root.

@@ -1009,10 +1014,14 @@

        * even on OS that do not support getreuid() which is *BSD

        * and SUSv3 only.

        */

+

+      // fixing issue with kernel >= 2.6.8.1

+      /*

       if (oeuid != getuid()) {

          if (setreuid(-1, oeuid) < 0)

             errmsg("Could set back effective uid.\n");

       }

+       */

 #endif

       /*

        * fork() here to start the extra process needed for

@@ -1027,11 +1036,14 @@

       /*

        * XXX Below this point we never need root privilleges anymore.

        */

-      if (geteuid() != getuid()) {   /* AIX does not like to do this */

+      // fixing issue with kernel >= 2.6.8.1

+      //if (geteuid() != getuid()) {   /* AIX does not like to do this */

                   /* If we are not root      */

+      /*

          if (setreuid(-1, getuid()) < 0)

             comerr("Panic cannot set back effective uid.\n");

       }

+       */

 #endif

    }

    if ((*dp->cdr_set_speed_dummy)(scgp, dp, &speed) < 0) {
```

That should fix all of the cdrtools issues with the new kernels.  However cdrtools-proDVD is broke still, and that isn't open source so we will have to wait on the owner to fix it.  I was able to burn using dvd+rw-tools, and also using Gnome 2.8 CD-creator, and also the front end called Xcdroast also works.

[/code]

----------

## r3pek

 *dsd wrote:*   

> growisofs users: please upgrade to the latest testing version of dvd+rw-tools (5.21.4.10.8 ). they already fixed dvd+rw-format in that release, so i'm thinking they probably fixed growisofs too.

 

works here too! mark it stable on amd64 too.

----------

## dsd

 *llsardonicll wrote:*   

> Yeah, cdrecord works fine just seems to be a xcdroast problem...i have a plextor drive and I get  no reject commands at all.                                      

 

could you please re-check step 5 in the original post, make sure that xcdroast / cdrecord are not setuid root, and confirm that you are not running as root user.

----------

## dsd

 *rapsure wrote:*   

> I am currently running the 2.6.10-rc2 kernel, and this is what I have concluded.  I have a patch that I found for cdrtools that will allow a user to burn to a cd.

 

if you take setuid root off your cdrecord binary you will not need this.

----------

## dsd

fixed dvd+rw-tools is now stable on x86 and amd64 very soon

----------

## undrwater

Burning .iso using k3b, which is using cdrecord i get the following:

```
verify_command: rejected command e9

verify_command: rejected command e9

verify_command: rejected command ed

verify_command: rejected command e9

```

output of

```
 cdrecord -dev=/dev/scsi/host0/bus0/target4/lun0/cd -checkdrive
```

```
scsidev: '/dev/scsi/host0/bus0/target4/lun0/cd'

devname: '/dev/scsi/host0/bus0/target4/lun0/cd'

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        : 2

Response Format: 2

Capabilities   : SYNC LINKED 

Vendor_info    : 'PLEXTOR '

Identifikation : 'CD-R   PX-W124TS'

Revision       : '1.07'

Device seems to be: Generic mmc CD-RW.

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

Driver flags   : MMC SWABAUDIO 

Supported modes: 

```

----------

## dsd

undrwater: those commands are specific to plextor drives and i'm not sure what will happen about getting the kernel to permit them. i'll see what the block maintainer has to say when i next send in a patch.

----------

## undrwater

 *dsd wrote:*   

> undrwater: those commands are specific to plextor drives and i'm not sure what will happen about getting the kernel to permit them. i'll see what the block maintainer has to say when i next send in a patch.

 

Thanks!

----------

## dsd

forgot to ask, did the cd burn ok anyway?

----------

## undrwater

 *dsd wrote:*   

> forgot to ask, did the cd burn ok anyway?

 

I think it should have...I'm doing some compiling, so the buffer ran below 50%.

I ran is as a simulation.  When I get a chance to try an actual burn, I'll post back.

----------

## rapsure

None of my cd burning utilities are set as suid.  I have already made sure that I had checked that, because I had read a lot of other posts.  cdrtools-proDVD doesn't work.  There is no suid set on it either.  It errors out with 

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

That is the message I get with cdrtools-proDVD.  I received the same message with cdrtools-2.01 until I applied the afore mentioned patch.  Also dvd+rw-tools gave me this message until I upgraded: 

```

unable to PREVENT MEDIA REMOVAL: Operation not permitted 

```

So cdrtools-2.01 was fixed for me with the patch above.  dvd+rw-tools was fixed by upgrading, and cdrtools-proDVD is still broke.  Perhaps it has to do with my BenQ 1620 DVD+-RW DL drive.  But what I understand from the code above is that it is trying to try to set the root user id for operation, and that isn't permitted.  The kernel isn't broke, but the userland was broke by the patch.

----------

## rapsure

So I went and ran cdrecord-ProDVD from bash, and this is the full error message.  

```

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

cdrecord-ProDVD: Operation not permitted. mode select g1: scsi sendcmd: no error

cdrecord-ProDVD: Cannot init drive.

```

This is an error message that I get from cdrecord, but it still works.

```

cdrecord: Input/ouput error.  write_g1: scsi sendcmd: no error

```

It will still burn the cd's though.

----------

## xanderhsia

Just reporting that I am burning fine now with dvd+rw-tools-5.21.4.10.8.

Running on gentoo-dev-sources-2.6.9-r3 with pure udev and k3b. Burned data, video, and audio discs with no problems.    :Laughing: 

----------

## dsd

those error messages suggest that prodvd is opening the device as read only. not much i can do about this without prodvd source code, but it did appear to work for eradicator - maybe he was on a newer version (2.01a27).

i'm also not convinced about your cdrecord issue. yesterday i was talking to a developer with exactly the same problem who said his cdrecord binary was not setuid root. i pointed out that i can reproduce the error by putting the +s bit on, and in return he posted me the ls -l output which showed that it indeed it was setuid (his mistake!). taking it off solved the problem.

then again, you are on 2.6.10-rc2. i don't have a cd writing machine that i can test with that kernel right now. but at the same time i don't see anything that would change this after 2.6.9. also, the patch you applied is advertised elsewhere to make cdrecord work as root again. /me shrugs

i submitted a patch to allow the LOG_SENSE command that eradicator pointed out, and also was informed that the current command filter is only a temporary measure. eventually, the kernel will provide a mechanism where a user interface will allow commands to be allowed/disallowed, this will allow for those non-standard cases (e.g. some plextor writers)

----------

## rapsure

```

-rwxr-xr-x  1 root root 345156 Oct 30 15:22 /usr/bin/cdrecord

```

That is what my cdrecord is set to now.  Now cdrecord-ProDVD worked until I upgraded to the latest version.  Version 2.01_beta31 broke it, but it was working before that.  Version 2.01_beta27 worked, but from my perspective at the time this bug showed up I had the command-filter applied.  Then with that it broke, so right now it will remain broken.

```

-rwxr-xr-x  1 root root 372924 Nov 14 22:23 /usr/bin/cdrecord-prodvd-2.01b31-i686-pc-linux-gnu

```

----------

## llsardonicll

 *Quote:*   

> could you please re-check step 5 in the original post, make sure that xcdroast / cdrecord are not setuid root, and confirm that you are not running as root user.

 

xcdroast and cdrecord are good

```

sardonic bin $ ls -l xcdroast cdrecord k3b

-rwxr-xr-x  1 root root  342628 Oct 17 17:58 cdrecord

-rwxr-xr-x  1 root root 1458556 Nov  5 21:14 k3b

-rwxr-xr-x  1 root root  762432 Nov 16 03:13 xcdroast

```

and deffinatly logged in as a normal user

----------

## llsardonicll

Seems i've figured out my xcdroast problem, i have to

```

chown root  /usr/lib/xcdroast-0.98/bin/xcdrwrap && chmod 4755 /usr/lib/xcdroast-0.98/bin/xcdrwrap

```

or xcdroast won't launch, once it's launced i can take off the suid bit and it runs perfectlyLast edited by llsardonicll on Sat Nov 20, 2004 9:43 pm; edited 1 time in total

----------

## undrwater

Tested burn...everything looked OK until the fixating process...

```
verify_command: rejected command e9

verify_command: rejected command e9

verify_command: rejected command ed

verify_command: rejected command e9

Info fld=0x3c72a4, Current sdb: sense key Recovered Error

ASC=18 ASCQ= a

```

I hear a clicking in the drive..and it doesn't stop.

Anything that I do that tries to access the drive will hang the system.

[EDIT]CD burned OK after reboot.  Still a bit to pay for a successful burn...  :Rolling Eyes:  [/EDIT]

----------

## serge

Hi

Using k3b-0.11.17, gentoo-dev-sources-2.6.9-r4, after burning the iso [the md5sum being correct], i always get an error at 99% when checking the data, no matter what length has the iso file. The burned iso file is always corrupted then.

I thought it came from my dvd burner so i tried a new one , and this problem still remains.

Any idea?

Thank you

Serge

----------

## cbradney

On doing a test write to CDRW, 2 files, nothing special (2.6.9r4, k3b 0.11.17), fails as follows:

System

-----------------------

K3b Version:0.11.17 

KDE Version: 3.3.1

QT Version: 3.3.3

cdrecord

-----------------------

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

TOC Type: 1 = CD-ROM

Using libscg version 'schily-0.8'.

Driveropts: 'burnfree'

/usr/bin/cdrecord: Warning: Running on Linux-2.6.9-gentoo-r4

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

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

/usr/bin/cdrecord: Warning: Linux-2.6.8 introduced incompatible interface changes.

/usr/bin/cdrecord: Warning: SCSI transport does no longer work for suid root programs.

/usr/bin/cdrecord: Warning: if cdrecord fails, try to run it from a root account.

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

SCSI buffer size: 64512

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

cdrecord comand:

-----------------------

/usr/bin/cdrecord -v gracetime=2 dev=/dev/hdc speed=24 -tao driveropts=burnfree -eject -data -tsize=7337s - 

mkisofs

-----------------------

7337

mkisofs comand:

-----------------------

/usr/bin/mkisofs -gui -graft-points -volid K3b data project -volset  -appid K3B THE CD KREATOR VERSION 0.11.17 (C) 2003 SEBASTIAN TRUEG AND THE K3B TEAM -publisher  -preparer K3b - Version 0.11.17 -sysid LINUX -volset-size 1 -volset-seqno 1 -sort /tmp/kde-craig/k3bHIRvab.tmp -rational-rock -hide-list /tmp/kde-craig/k3bh0Mqoa.tmp -full-iso9660-filenames -iso-level 2 -path-list /tmp/kde-craig/k3bx4GGfc.tmp /home/craig/.kde3.3/share/apps/k3b/temp/dummydir0/

----------

## Pylon

Beside the usual rejected command 1e during fixating a DVD, I have no problems with my PowerPC and pegasos-dev-sources-2.6.9-r2.

Thanks a lot for leading out of the dark times for CD-writing.  I nearly lost the interest for the media-optical herd and all the cd-writing-applications due to many bugs with problems that pointed to the changes in the kernel  :Rolling Eyes: 

I hope that this will get better now.

----------

## Thrain

Excuse me, maybe I'm OT.

as long as I used gentoo-dev-sources-2.6.9-r3, I see that cdrecord switch down the writing speed from 40x (that's the maximum for my burner) to 12x, telling me that the selected speed (40x) is not supported by the burner.

I noticed that using either nitro-sources or development-sources (2.6.9) I don't have this problem.

Then... Is it possible that this problem is caused by your patch, dsd?

Thank you in advance.

----------

## Pylon

 *Thrain wrote:*   

> as long as I used gentoo-dev-sources-2.6.9-r3, I see that cdrecord switch down the writing speed from 40x (that's the maximum for my burner) to 12x, telling me that the selected speed (40x) is not supported by the burner.

 

I can't confirm.  Just tested to write a CD-R in k3b.  Automatic speed detection switched to 40x (maximum speed).  Everything went fine.  Even the buffer is now shown  :Smile: 

Probably your CD-R tells the burner that it can only handle the maximum speed of 12x?  I fall into this "trick" once, when I used an old blank CD-R...

----------

## bk0

Audio CD burning with cdrecord is extremely CPU intensive and results in literally dozens of buffer-underruns. This is on an Athlon XP 2600+, 768MB RAM and kernel 2.6.9-gentoo-r4.

Here's the bug report: 

https://bugs.gentoo.org/show_bug.cgi?id=63040

----------

## dsd

 *cbradney wrote:*   

> On doing a test write to CDRW, 2 files, nothing special (2.6.9r4, k3b 0.11.17), fails as follows:

 

please remove all suid bits (see the start of this thread)

 *Quote:*   

> Excuse me, maybe I'm OT.
> 
> as long as I used gentoo-dev-sources-2.6.9-r3, I see that cdrecord switch down the writing speed from 40x (that's the maximum for my burner) to 12x, telling me that the selected speed (40x) is not supported by the burner.
> 
> I noticed that using either nitro-sources or development-sources (2.6.9) I don't have this problem.
> ...

 

very unlikely. any rejected commands? could you please test with 2.6.9-r2 ?

----------

## cbradney

 *dsd wrote:*   

> 
> 
> please remove all suid bits (see the start of this thread)
> 
> 

 

Hey, cool. it works  :Smile:  top stuff. Ok, It burnt at 4x, but it was a CDRW. Will try a real backup onto CDR tomorrow, hopefully at full speed.

----------

## rapsure

I found that xcdwrap was set with the suid, and so I disabled that, and then I tried to burn a CD, and this is what I get with cdrecord.  

```

brian@rapsure cdimage $ cdrecord dev=ATAPI:0,0,0 -sao -data SimCity3000_Unlimited.iso

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

cdrecord: Warning: Running on Linux-2.6.10-rc2

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'.

Device type    : Removable CD-ROM

Version        : 0

Response Format: 2

Capabilities   :

Vendor_info    : 'BENQ    '

Identifikation : 'DVD DD DW1620   '

Revision       : 'B7P9'

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

cdrecord: This version of cdrecord does not include DVD-R/DVD-RW support code.

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

cdrecord: 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

Supported modes:

cdrecord: Drive does not support SAO recording.

cdrecord: Illegal write mode for this drive.

```

This is the error message that I get regardless of what mode I put it in.  From my previous post I reinstalled cdrtools so that it didn't have any patches.  I get the same error message from cdrecord-ProDVD.

----------

## Thrain

K3b tell me that "Medium or burner don't support 40x writing speed"... then maybe a medium-related problem: but the cdrs I bought are certified for burning at 52x speed! Can I bypass that limitation with some arguments to cdrecord (I checked the man page with no results) ?

Thank you

----------

## rapsure

I patched the kernel to report rejected commands, and so here it is:

```

Nov 24 13:23:07 [kernel] verify_command: rejected command 55

```

Now if I can just patch the kernel to allow that command I am pretty sure that it will allow me to burn cd's.

----------

## dsd

it's not that simple.. 55 is already permitted by the kernel, but only for write access.

which software are you using? it needs to be patched to open the cdrom device node in O_RDWR mode... (most seemed to be using O_RDONLY before this situation came about)

----------

## rapsure

I used cdrtools-2.01.

----------

## rapsure

```

Nov 24 16:12:51 [kernel] scsi: unknown opcode 0x55

Nov 24 16:12:51 [kernel] scsi: unknown opcode 0x1e

Nov 24 16:12:51 [kernel] scsi: unknown opcode 0x01

Nov 24 16:12:51 [kernel] scsi: unknown opcode 0xbb

Nov 24 16:13:01 [kernel] scsi: unknown opcode 0x54

Nov 24 16:13:03 [kernel] scsi: unknown opcode 0x5d

Nov 24 16:13:03 [kernel] scsi: unknown opcode 0x2a

Nov 24 16:15:54 [kernel] scsi: unknown opcode 0x35

```

Those are the codes that are needed for my burner to burn.  I modified the filter function so that I could get that information.  I propose that instead of a list of allowed commands for writing in the kernel there should be a list of banned commands for writing.  The list would most likely be shorter and more saner.  From what I read Linus put the patch in so that a user couldn't flash the firmware on the drive.  

I do agree with the security with the read though.  I wouldn't want the read allowed commands changed.

----------

## dsd

 *rapsure wrote:*   

> I used cdrtools-2.01.

 

which actual binary though? cdrtools contains a few..

and please confirm that you have write access to your cd writer node - it may have dropped back to read only...

----------

## dsd

 *rapsure wrote:*   

> 
> 
> ```
> 
> Nov 24 16:12:51 [kernel] scsi: unknown opcode 0x55
> ...

 

did you modify it in the same way as i did? at least half of those are already permitted by the kernel (i havent checked the others, but i just recognise some..), *as long as you have write access to your cd writer node* (and the software must open the node for read+write)

----------

## rapsure

Here is what was happening.  I put a lot of debugging information into the command filter function to figure out what was going on there.  The commands from cdrecord weren't being recognized as cmd_type CMD_WRITE_SAFE commands.  I don't know why, but they weren't being recognized at all the the entire filter.  If it was working I should have gotten debug information back from the (type & CMD_WARN) if statement, but I wasn't.  So this is what I did.  

scsi_ioctl.c

```

        /* Anybody who can open the device can do a read-safe command */

        if (type & CMD_READ_SAFE)

                return 0;

        cmd_type[cmd[0]] = CMD_WRITE_SAFE; /* Stupid filter below wasn't  working*/

        /* Write-safe commands just require a writable open.. */

        if (type & CMD_WRITE_SAFE) {

                if (file->f_mode & FMODE_WRITE)

                        return 0;

        }

```

Then I went and changed the O_RDONLY references in the cdrtools to O_RDWR to open the device for write mode.  Then I compiled, and tested, and it worked.  If cdrecord-proDVD was Open source I would get it working too.

----------

## rapsure

I took out the patch in the kernel, and now only cdrtools is patched.  It does seem backwards that cdrecord was opening the device for read, and not write.

----------

## dsd

opening cd nodes as O_RDRW fails on kernel 2.4 unless it is a DVD-RAM disc.

----------

## rapsure

Is there another structure that can test for write capabilities, but with out the drive needing to be in write mode?  The current  

```

if (file->f_mode & MODE_WRITE) 

```

is checking if the drive is in write mode, and if you have write permissions.  I just want something to check if you have write permissions.

----------

## Herodot

I'm using 2.6.9-gentoo-r4, Cdrecord 2.01 and K3b 0.11.17. I'v removed the suid from cdrecord and whatever else I could find. But I now have these problems:

1) When I try to burn a cd it fails, usually about halfway through. K3b complains about cdrecord not being suid. So I can't really burn anything.

2) When I erase a cdrw, the desktop stalls until the erase is finished.

----------

## MaxDamage

I'm trying to blank a CDRW but it fails. That's what I get in /var/lo/messages:

```

Nov 27 10:59:07 Mutsumi verify_command: rejected command 55

Nov 27 10:59:07 Mutsumi verify_command: rejected command 55

Nov 27 10:59:07 Mutsumi verify_command: rejected command 55

Nov 27 10:59:07 Mutsumi verify_command: rejected command 55

Nov 27 10:59:07 Mutsumi verify_command: rejected command 55

Nov 27 10:59:07 Mutsumi verify_command: rejected command 55

Nov 27 10:59:07 Mutsumi verify_command: rejected command 55

Nov 27 10:59:07 Mutsumi verify_command: rejected command 55

Nov 27 10:59:07 Mutsumi verify_command: rejected command 55

Nov 27 10:59:07 Mutsumi verify_command: rejected command 55

Nov 27 10:59:08 Mutsumi verify_command: rejected command 1e

Nov 27 10:59:08 Mutsumi verify_command: rejected command 1

Nov 27 10:59:08 Mutsumi verify_command: rejected command 55

Nov 27 10:59:08 Mutsumi verify_command: rejected command 55

Nov 27 10:59:08 Mutsumi verify_command: rejected command 55

Nov 27 10:59:08 Mutsumi verify_command: rejected command 35

Nov 27 10:59:08 Mutsumi verify_command: rejected command 55

Nov 27 10:59:08 Mutsumi verify_command: rejected command 1e

Nov 27 10:59:09 Mutsumi verify_command: rejected command 55

Nov 27 10:59:09 Mutsumi verify_command: rejected command 55

Nov 27 10:59:09 Mutsumi verify_command: rejected command 55

Nov 27 10:59:09 Mutsumi verify_command: rejected command 55

Nov 27 10:59:09 Mutsumi verify_command: rejected command 55

Nov 27 10:59:09 Mutsumi verify_command: rejected command 55

Nov 27 10:59:09 Mutsumi verify_command: rejected command 55

Nov 27 10:59:09 Mutsumi verify_command: rejected command 55

Nov 27 10:59:09 Mutsumi verify_command: rejected command 55

Nov 27 10:59:09 Mutsumi verify_command: rejected command 55

Nov 27 10:59:10 Mutsumi verify_command: rejected command 1e

```

I'm using Gtoaster, that's the error message (in fact, the cdrecord one):

```

GnomeToaster Recording Terminal

blanking CDRW.

cdrecord: Warning: Running on Linux-2.6.9-gentoo-r6

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: Warning: Linux-2.6.8 introduced incompatible interface changes.

cdrecord: Warning: SCSI transport does no longer work for suid root programs.

cdrecord: Warning: if cdrecord fails, try to run it from a root account.

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.

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

Using libscg version 'schily-0.8'.

Device type    : Removable CD-ROM

Version        : 0

Response Format: 2

Capabilities   : 

Vendor_info    : 'SONY    '

Identifikation : 'CD-RW  CRX185E1 '

Revision       : 'XYS2'

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: 

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.

```

----------

## dsd

MaxDamage: you have to make sure that gtoaster uses device /dev/hdc (for example) as opposed to ATAPI:0,0,0

----------

## rapsure

I was experimenting, and these are the results I got.  I might help out some other people.  If you have  a kernel with no patches, and cdrtools not patched also.  Now apply dsd's kernel message patch.  The patch is mentioned in the first post with a link to it.  Run cdrecord like this.

```

cdrecord dev=/dev/hd* -dao -data #yourfavoriteiso

```

If it errors out, and complains that it can't init the drive then run:

```

dmesg

```

Look at it, and if there are only 

```

verify_command: rejected command #what ever command it is

```

Now there should be a 

```

scsi: unknown opcode

```

before the rejected command.  If you are missing the scsi: unknown opcode then the command filter isn't working, and the kernel isn't recognizing the command to the burner as a SAFE_WRITE command.  Now here is the fix that will let you burn CD's and DVD's again.  Here is the kernel code in linux/drivers/block/scsi_ioctl.c before it is patched:

```

        /* Anybody who can open the device can do a read-safe command */

        if (type & CMD_READ_SAFE)

                return 0;

        /* Write-safe commands just require a writable open.. */

        if (type & CMD_WRITE_SAFE) {

                if (file->f_mode & FMODE_WRITE)

                        return 0;

        }

        if (!(type & CMD_WARNED)) {

                cmd_type[cmd[0]] = CMD_WARNED;

                printk(KERN_WARNING "scsi: unknown opcode 0x%02x\n", cmd[0]);

        }

```

The above code is broke for your instance.  Now patch your kernel to what I have below, and you will be able to burn.

```

        /* Anybody who can open the device can do a read-safe command */

        if (type & CMD_READ_SAFE)

                return 0;

        /* Write-safe commands just require a writable open.. */

        cmd_type[cmd[0]] = CMD_WRITE_SAFE;

        if (type & CMD_WRITE_SAFE) {

                if (file->f_mode & FMODE_WRITE)

                        return 0;

        }

        if (!(type & CMD_WARNED)) {

                cmd_type[cmd[0]] = CMD_WARNED;

                printk(KERN_WARNING "scsi: unknown opcode 0x%02x\n", cmd[0]);

        }

```

remake the kernel, and install, and restart the computer.

Now run:

```

cdrecord dev=/dev/hd* -dao -data #yourfavoriteiso

```

Now burning should work for you.  If it doesn't post in the forum.  If you don't have a problem with burning don't apply this patch.  :Twisted Evil: 

----------

## dsd

please dont do that. that allows every single command to be written to the drive, including the ones which kill hard disks or corrupt drive firmwares. theres a reason why this filter was put in place...

----------

## hielvc

I have followed the instructions on the first page. I have tried form the

command line and xterm both as user and as root, and sence about 2.6.8-r5 I cant

burn anything. When I try this is what I get *Quote:*   

> hielvc@tester ~/iso $ cdrecord dev=ATAPI:0,0,0 -checkdrive
> 
> Cdrecord-Clone 2.01 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Schilling
> 
> cdrecord: Warning: Running on Linux-2.6.9-gentoo-r3n
> ...

 

 and just hangs the only way to kill it is a reboot. ps shows this 

```
 

hielvc   17400  0.4  0.1   1936   728 pts/2    D+   11:39   0:05 cdrecord dev=ATAPI:0,0,0 -checkdrive 
```

and dmesg this  *Quote:*   

> 
> 
> verify_command: rejected command 55
> 
> verify_command: rejected command 55
> ...

 

I found a puppy-linux-8 which uses a 2.4 kernel and scsi-emulation my burner works, I burned puppy-9.6.

puppy-9.6 uses ATAPI and it works.

----------

## rapsure

it doesn't let every command fly for me.  Unless it is in the list of allowed commands it get's blocked.  The only commands allowed are the commands that have safe_for_write(SOMETHING) still.  

I only put that in, because all of the commands that cdrecord was sending weren't being interpreted as safe_for_write commands.  NONE.  So if cdrecord send a command as 0x55 it got blocked, but it didn't bring back a warning.  Every command should be coming back with at least a warning if it is blocked.

----------

## dsd

ahhh.. hielvc's problem just made me realise rapsures problem too :

you need to burn a cd using (e.g.) dev=/dev/hdc 

using dev=ATAPI:X,Y,Z no longer works

will update first post

----------

## rapsure

hielvc this is what you run:

cdrecord dev=ATAPI:0,0,0 -checkdrive

That will not work.  This is what you need to use for command arguments:

cdrecord dev=/dev/hdc -checkdrive

Seems minor, but it makes the difference.

----------

## dsd

rapsure : your patch definately does allow all commands. jsut think about it for a second.

your code:

```

        /* Write-safe commands just require a writable open.. */

        cmd_type[cmd[0]] = CMD_WRITE_SAFE;

        if (type & CMD_WRITE_SAFE) {

                if (file->f_mode & FMODE_WRITE)

                        return 0;

        } 

```

is effectively the same as

```

        /* Write-safe commands just require a writable open.. */

        type = CMD_WRITE_SAFE;

        if (type & CMD_WRITE_SAFE) {

                if (file->f_mode & FMODE_WRITE)

                        return 0;

        }

```

which is effectively the same as

```

        /* Write-safe commands just require a writable open.. */

        if (CMD_WRITE_SAFE & CMD_WRITE_SAFE) {

                if (file->f_mode & FMODE_WRITE)

                        return 0;

        }

```

which is effectively the same as

```

                if (file->f_mode & FMODE_WRITE)

                        return 0;

```

so, as long as you have write access to cd writer node, you can send anything...

----------

## rapsure

This is with my patch:

brian@rapsure cdimage $ ls -l /dev/hdc

brw-------  1 brian root 22, 0 Apr 30  2004 /dev/hdc

brian@rapsure cdimage $

```

brian@rapsure cdimage $ cdrecord dev=ATAPI:0,0,0 -dao -data install-x86-minimal-2004.2.iso

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

cdrecord: Warning: Running on Linux-2.6.10-rc2

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'.

Device type    : Removable CD-ROM

Version        : 0

Response Format: 2

Capabilities   :

Vendor_info    : 'BENQ    '

Identifikation : 'DVD DD DW1620   '

Revision       : 'B7P9'

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

cdrecord: Found DVD+ media but DVD+R/DVD+RW support code is missing.

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

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

cdrecord: Sorry, no CD/DVD-Recorder or unsupported CD/DVD-Recorder found on this target.

cdrecord: This version of cdrecord does not include DVD-R/DVD-RW support code.

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

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

Using generic SCSI-3/mmc   CD-ROM driver (mmc_cd).

Driver flags   : MMC-3 SWABAUDIO BURNFREE

Supported modes:

cdrecord: Drive does not support SAO recording.

cdrecord: Illegal write mode for this drive.

brian@rapsure cdimage $

```

dmesg output:

```

scsi: unknown opcode 0x55

verify_command: rejected command 55

verify_command: rejected command 55

scsi: unknown opcode 0x55

verify_command: rejected command 55

verify_command: rejected command 55

scsi: unknown opcode 0x55

verify_command: rejected command 55

verify_command: rejected command 55

scsi: unknown opcode 0x55

verify_command: rejected command 55

verify_command: rejected command 55

scsi: unknown opcode 0x55

verify_command: rejected command 55

verify_command: rejected command 55

```

Now I will run cdrecord again.

```

brian@rapsure cdimage $ cdrecord dev=/dev/hdc -dao -data install-x86-minimal-2004.2.iso

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

cdrecord: Warning: Running on Linux-2.6.10-rc2

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: '/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    : 'BENQ    '

Identifikation : 'DVD DD DW1620   '

Revision       : 'B7P9'

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

cdrecord: Found DVD+ media but DVD+R/DVD+RW support code is missing.

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

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

cdrecord: Sorry, no CD/DVD-Recorder or unsupported CD/DVD-Recorder found on this target.

cdrecord: This version of cdrecord does not include DVD-R/DVD-RW support code.

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

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

Using generic SCSI-3/mmc   CD-ROM driver (mmc_cd).

Driver flags   : MMC-3 SWABAUDIO BURNFREE

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

cdrecord: Unspecified command not implemented for this drive.

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.

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

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

cdrecord: Success. write_g1: scsi sendcmd: no error

CDB:  2A 00 FF FF FF 6A 00 00 1F 00

status: 0x2 (CHECK CONDITION)

Sense Bytes: 70 00 05 00 00 00 00 12 00 00 00 00 21 00 00 00

Sense Key: 0x5 Illegal Request, Segment 0

Sense Code: 0x21 Qual 0x00 (logical block address out of range) Fru 0x0

Sense flags: Blk 0 (not valid)

resid: 63488

cmd finished after 0.002s timeout 200s

write track pad data: error after 0 bytes

BFree: 672 K BSize: 672 K

Track 02: Total bytes read/written: 82278400/82278400 (40175 sectors).

brian@rapsure cdimage $

```

Now dmesg output:

```

```

Nothing rejected.

Now I will do it without the patch.

----------

## rapsure

```

brian@rapsure cdimage $ ls -l /dev/hdc

brw-------  1 brian root 22, 0 Apr 30  2004 /dev/hdc

brian@rapsure cdimage $

```

Here is the output of cdrecord:

```

brian@rapsure cdimage $ cdrecord dev=/dev/hdc -dao -driveropts=burnfree SimCity3000_Unlimited.iso

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

cdrecord: Warning: Running on Linux-2.6.10-rc2

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: '/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    : 'BENQ    '

Identifikation : 'DVD DD DW1620   '

Revision       : 'B7P9'

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

cdrecord: Found DVD+ media but DVD+R/DVD+RW support code is missing.

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

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

cdrecord: Sorry, no CD/DVD-Recorder or unsupported CD/DVD-Recorder found on this target.

cdrecord: This version of cdrecord does not include DVD-R/DVD-RW support code.

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

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

Using generic SCSI-3/mmc   CD-ROM driver (mmc_cd).

Driver flags   : MMC-3 SWABAUDIO BURNFREE

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

cdrecord: Unspecified command not implemented for this drive.

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.

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

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

cdrecord: Success. write_g1: scsi sendcmd: no error

CDB:  2A 00 FF FF FF 6A 00 00 1F 00

status: 0x2 (CHECK CONDITION)

Sense Bytes: 70 00 05 00 00 00 00 12 00 00 00 00 21 00 00 00

Sense Key: 0x5 Illegal Request, Segment 0

Sense Code: 0x21 Qual 0x00 (logical block address out of range) Fru 0x0

Sense flags: Blk 0 (not valid)

resid: 63488

cmd finished after 0.002s timeout 200s

write track pad data: error after 0 bytes

BFree: 672 K BSize: 672 K

Track 02: Total bytes read/written: 662077440/662077440 (323280 sectors).

brian@rapsure cdimage $

```

dmesg output:

```

scsi: unknown opcode 0x01

verify_command: rejected command 1

```

Now I went over the code too, but it wasn't working before.  I used gnome's nautilus cdburner utility, and it is smart enough not to make the same mistake of dev=ATAPI:0,0,0 and it wasn't working either back a couple of posts.  I think I know what the problem is.  GCC made a mistake or my computer is just stupid at compiling.

Conclusion:

If you have an MMC compliant drive it should burn using the following command line arguments for cdrecord.

```

cdrecord dev=/dev/hdc *.iso

```

If it doesn't work, or the nautilus cd burner utility doesn't work then you to have a dumb computer that won't compile the code correctly.  Maybe it is a gcc error.  I don't know.  Compile the kernel again could be the work around.  My GCC is Version 3.3.4.  So there you have it.

----------

## MaxDamage

 *dsd wrote:*   

> MaxDamage: you have to make sure that gtoaster uses device /dev/hdc (for example) as opposed to ATAPI:0,0,0

 

The problem is Gtoaster needs both the device name (set /dev/hdc) and the SCSI Id (ATAPI:0).

** EDIT **

No problem: I put /dev/hdc in both fields, and now everything works.

Wow, now old programs that were designed for SCSI burning and didn't allow use of "ATAPI:", are going to work again.

----------

## Tarball

I am having a problem burning a DVD using cdrecord-ProDVD.  I also get the 'Cannot init drive' when using dev=ATAPI:0,1,0

I also noticed that Mr Schilling seems to frown on the usage of dev=/dev/{device}/, and when using /dev/hd?/ cdrecord outputs the following message:

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

Unlocked features: ProDVD Clone

Limited  features:

This copy of cdrecord is licensed for: private/research/educational_non-commercial_use

TOC Type: 1 = CD-ROM

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: '/dev/hdb'

devname: '/dev/hdb'

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

Warning: Open by 'devname' is unintentional and not supported.       <---------- Should we be worried that this will stop working in the future?

Linux sg driver version: 3.5.27

Using libscg version 'schily-0.8'.

Using libscg transport code version 'schily-scsi-linux-sg.c-1.83'

Driveropts: 'burnproof'

```

any ideas why?

*EDIT*

Also, changing cdrecord to not use SUID is all very well but by not using SUID, cdrecord is no longer able to set its priority to RT therefore reducing the possibility of buffer underruns, is this now a likely occurance on slower machines?

Another point, I was under the impression that even though cdrecord has SUID bit set the code itself actually changed its EUID back to a lesser privilaged user after setting the runtime priority???

Machine Config:

Kernel: 2.6.9-gentoo-r5

Vendor_info    : 'PIONEER '

Identifikation : 'DVD-RW  DVR-105'

----------

## MaxDamage

 *Tarball wrote:*   

> Also, changing cdrecord to not use SUID is all very well but by not using SUID, cdrecord is no longer able to set its priority to RT therefore reducing the possibility of buffer underruns, is this now a likely occurance on slower machines?

 

I've also always seen that error about the scheduling. Is there a way to fix it when burning as normal user?

----------

## hielvc

No joy 

 *Quote:*   

> cdrecord dev=/dev/hdc -checkdrive
> 
> Cdrecord-Clone 2.01 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Schilling
> 
> cdrecord: Warning: Running on Linux-2.6.9-gentoo-r3n
> ...

 

and dmesg  *Quote:*   

> hdc: status error: status=0x58 { DriveReady SeekComplete DataRequest }
> 
> hdc: status error: error=0x00
> 
> hdc: drive not ready for command
> ...

 

 If you look I did get one more line outa cdrecord though.

----------

## jonfr

I get this.

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

cdrecord: Warning: Running on Linux-2.6.7

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: '/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: 1

Vendor_info    : 'ATAPI   '

Identifikation : 'DVD RW 8XMax    '

Revision       : '160D'

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

cdrecord: Found DVD media but DVD-R/DVD-RW support code is missing.

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

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

cdrecord: This version of cdrecord does not include DVD-R/DVD-RW support code.

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

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

Using generic SCSI-3/mmc   CD/DVD driver (checks media) (mmc_cd_dvd).

Driver flags   : MMC-3 SWABAUDIO BURNFREE

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

```

I guess i need to buy DVD+R Next time around.

I am using kernel 2.6.7 Vanilla and i get this in dmesg. 

```
ATAPI device hdc:

  Error: Not ready -- (Sense key=0x02)

  Incompatible medium installed -- (asc=0x30, ascq=0x00)

  The failed "Read Cd/Dvd Capacity" packet command was:

  "25 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "

```

----------

## Tarball

I am able to write CDs/DVDs as a normal user but if I am using the machine while a CD/DVD is burning I get warnings from cdrecord about predicted buffer underruns.

```

Blocks total: 2298496 Blocks current: 2298496 Blocks remaining: 470880

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.

Waiting for reader process to fill input buffer ... input buffer ready.

BURN-Free is ON.

Starting new track at sector: 0

Track 01: 3569 of 3569 MB written (fifo 100%) [buf  95%]   4.4x.

Track 01: Total bytes read/written: 3742957568/3742957568 (1827616 sectors).

Writing  time:  770.344s

Average write speed   3.5x.

Min drive buffer fill was 2%

Total of 5 possible drive buffer underruns predicted.

Fixating...

Fixating time:   35.119s

cdrecord-ProDVD: fifo had 58956 puts and 58956 gets.

cdrecord-ProDVD: fifo was 0 times empty and 14117 times full, min fill was 95%.

```

Is there anyway of increasing the priority as a 'normal' user?

----------

## Bekker

I have no problems with my IDE CD-RW with the stock 2.6.9-r1 kernel. I do have several issues with my external firewire DVD burner. They are 

neatly summed up by the creator of K3B on his page.

http://k3b.plainblack.com/index.pl/news2

Does the patch also address the problems with the external burners? Everything worked fine with the 2.6.8 gentoo releases.

regards

Chera

----------

## andrewbarr

```

abarr@tigris ~/download/images $ cdrecord -dummy dev=/dev/dvd systemrescuecd-x86-0.2.16_pre2.iso

cdrecord: No write mode specified.

cdrecord: Asuming -tao mode.

cdrecord: Future versions of cdrecord may have different drive dependent defaults.

cdrecord: Continuing in 5 seconds...

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

cdrecord: Warning: Running on Linux-2.6.9-andrew-r3

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: Warning: Linux-2.6.8 introduced incompatible interface changes.

cdrecord: Warning: SCSI transport does no longer work for suid root programs.

cdrecord: Warning: if cdrecord fails, try to run it from a root account.

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: '/dev/dvd'

devname: '/dev/dvd'

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        : 2

Response Format: 2

Capabilities   :

Vendor_info    : 'PHILIPS '

Identifikation : 'DVD+RW SDVD6004 '

Revision       : '1.03'

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/R96R

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.

Starting to write CD/DVD at speed 8 in dummy TAO mode for single session.

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

```

Should I just be ignoring the errors warning of buffer underrun risks? IIRC this is why cdrecord ran as setuid root before but now it seems this isn't kosher anymore. I turned off setuid to get cdrecord to work again but now I get these warnings.

----------

## JOS654

here worked perfectly the cd burning but i get too the warning about a possible buffer underun problem because the cdrecord binary isnt ejecuted with root privileges to change the priority

----------

## korngerd

Hi, I tried it on my machine (PLEXTOR CD-R PX-W4012A) on a 2.6.9-r6 gentoo-dev-sources kernel.  I issued the following command:

```
orangerd@nyamochan orangerd $ cdrecord dev=/dev/hdl -v -speed=8 -data debian/sarge-i386-netinst.iso
```

It basically fails and crashes the entire system (I get a whole bunch of Input/Output errors).  The output I get from cdrecord is:

```
orangerd@nyamochan orangerd $ cdrecord dev=/dev/hdl -v -speed=8 -data debian/sarge-i386-netinst.iso

cdrecord: No write mode specified.

cdrecord: Asuming -tao mode.

cdrecord: Future versions of cdrecord may have different drive dependent defaults.

cdrecord: Continuing in 5 seconds...

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

cdrecord: Warning: Running on Linux-2.6.9-gentoo-r6

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: Warning: Linux-2.6.8 introduced incompatible interface changes.

cdrecord: Warning: SCSI transport does no longer work for suid root programs.

cdrecord: Warning: if cdrecord fails, try to run it from a root account.

TOC Type: 1 = CD-ROM

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: '/dev/hdl'

devname: '/dev/hdl'

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'.

SCSI buffer size: 64512

atapi: 1

Device type    : Removable CD-ROM

Version        : 0

Response Format: 1

Vendor_info    : 'PLEXTOR '

Identifikation : 'CD-R   PX-W4012A'

Revision       : '1.05'

Device seems to be: Generic mmc CD-RW.

Current: 0x0009

Profile: 0x0008

Profile: 0x0009 (current)

Profile: 0x000A

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

Driver flags   : MMC-3 SWABAUDIO BURNFREE

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

Drive buf size : 2394336 = 2338 KB

cdrecord: Success. read buffer: scsi sendcmd: no error

CDB:  3C 00 00 00 00 00 00 FC 00 00

status: 0x2 (CHECK CONDITION)

Sense Bytes: 70 00 04 00 00 00 00 0A 00 00 00 00 1B 00 00 00

Sense Key: 0x4 Hardware Error, Segment 0

Sense Code: 0x1B Qual 0x00 (synchronous data transfer error) Fru 0x0

Sense flags: Blk 0 (not valid)

resid: 64512

cmd finished after 8.989s timeout 40s

FIFO size      : 4194304 = 4096 KB

Track 01: data   107 MB

Total size:      123 MB (12:14.66) = 55100 sectors

Lout start:      123 MB (12:16/50) = 55100 sectors

Current Secsize: 2048

ATIP info from disk:

  Indicated writing power: 6

  Is not unrestricted

  Is not erasable

  Disk sub type: Medium Type C, low Beta category (C-) (6)

  ATIP start of lead in:  -11231 (97:32/19)

  ATIP start of lead out: 359847 (79:59/72)

Disk type:    Short strategy type (Phthalocyanine or similar)

Manuf. index: 27

Manufacturer: Prodisc Technology Inc.

Blocks total: 359847 Blocks current: 359847 Blocks remaining: 304747

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.

Starting to write CD/DVD at speed 8 in real TAO mode for single session.

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

Waiting for reader process to fill input buffer ... input buffer ready.

BURN-Free is OFF.

Performing OPC...

Starting new track at sector: 0

Track 01:    0 of  107 MB written.cdrecord: Success. write_g1: scsi sendcmd: no error

CDB:  2A 00 00 00 00 00 00 00 1F 00

status: 0x2 (CHECK CONDITION)

Sense Bytes:

Sense Key: 0xFFFFFFFF [], Segment 0

Sense Code: 0x00 Qual 0x00 (no additional sense information) Fru 0x0

Sense flags: Blk 0 (not valid)

resid: 63488

cmd finished after 39.771s timeout 40s

write track data: error after 0 bytes

cdrecord: A write error occured.

cdrecord: Please properly read the error message above.

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 04 01 00 00

Sense Key: 0x2 Not Ready, Segment 0

Sense Code: 0x04 Qual 0x01 (logical unit is in process of becoming ready) Fru 0x0

Sense flags: Blk 0 (not valid)

cmd finished after 0.000s timeout 40s

cdrecord: Success. flush cache: scsi sendcmd: no error

CDB:  35 00 00 00 00 00 00 00 00 00

status: 0x2 (CHECK CONDITION)

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

Sense Key: 0x2 Not Ready, Segment 0

Sense Code: 0x04 Qual 0x01 (logical unit is in process of becoming ready) Fru 0x0

Sense flags: Blk 0 (not valid)

cmd finished after 0.000s timeout 120s

Trouble flushing the cache

Writing  time:   49.594s

Average write speed  16.4x.

Fixating...

cdrecord: Cannot fixate disk.

Fixating time:   13.026s

cdrecord: fifo had 64 puts and 1 gets.

cdrecord: fifo was 0 times empty and 0 times full, min fill was 100%.

```

It stopped for about 4-5 minutes at the

```
Manufacturer: Prodisc Technology Inc.
```

section.

I'll try it with my SONY DVD RW DRU-510A drive and post its outcome.

** EDIT **

Sorry, also I forgot to post my dmesg output:

```
Dec  1 08:42:15 [kernel] verify_command: rejected command e9

                - Last output repeated twice -

Dec  1 08:42:29 [kernel] hdl: status error: status=0x59 { DriveReady SeekComplete DataRequest Error }

Dec  1 08:42:30 [kernel] verify_command: rejected command 1

Dec  1 08:46:54 [kernel] hdl: lost interrupt

Dec  1 08:47:03 [kernel] verify_command: rejected command f5

Dec  1 08:47:03 [kernel] verify_command: rejected command e9

```

----------

## korngerd

OK, I issued the command:

```

orangerd@nyamochan orangerd $ cdrecord dev=/dev/hdj -v -speed=8 -data debian/sarge-i386-netinst.iso

```

This was using my SONY DVD RW DRU-510A drive (obviously the same kernel as above).

```

orangerd@nyamochan orangerd $ cdrecord dev=/dev/hdj -v -speed=8 -data debian/sarge-i386-netinst.iso

cdrecord: No write mode specified.

cdrecord: Asuming -tao mode.

cdrecord: Future versions of cdrecord may have different drive dependent defaults.

cdrecord: Continuing in 5 seconds...

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

cdrecord: Warning: Running on Linux-2.6.9-gentoo-r6

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: Warning: Linux-2.6.8 introduced incompatible interface changes.

cdrecord: Warning: SCSI transport does no longer work for suid root programs.

cdrecord: Warning: if cdrecord fails, try to run it from a root account.

TOC Type: 1 = CD-ROM

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: '/dev/hdj'

devname: '/dev/hdj'

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'.

SCSI buffer size: 64512

atapi: 1

Device type    : Removable CD-ROM

Version        : 0

Response Format: 2

Capabilities   :

Vendor_info    : 'SONY    '

Identifikation : 'DVD RW DRU-510A '

Revision       : '1.0f'

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

Current: 0x0009

Profile: 0x001B

Profile: 0x001A

Profile: 0x0014

Profile: 0x0013

Profile: 0x0011

Profile: 0x0010

Profile: 0x000A

Profile: 0x0009 (current)

Profile: 0x0008

cdrecord: This version of cdrecord does not include DVD-R/DVD-RW support code.

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

cdrecord: 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

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

Drive buf size : 8112896 = 7922 KB

Bus error

```

After this, I get a whole range of Input/Output errors:

```

root@nyamochan orangerd # shutdown -r now

bash: /sbin/shutdown: Input/output error

root@nyamochan orangerd # ls -la /

ls: /boot: Input/output error

```

dmesg also gives me:

```

Dec  1 09:11:40 [kernel] hdj: lost interrupt

Dec  1 09:12:20 [kernel] hdj: DMA timeout retry

Dec  1 09:12:40 [kernel] hdi: dma_timer_expiry: dma status == 0x21

Dec  1 10:24:24 [kernel] hdi: DMA timeout error

Dec  1 09:13:10 [kernel] hdi: dma_timer_expiry: dma status == 0x21

```

----------

## dsd

short update on all this :

cdrecord not running as root is a cdrecord bug. i can't remember exactly what it is doing wrong, but hopefully this will be fixed soon. on most systems, the extra priority it can get shouldnt really make a lot of difference

you can change a tasks priority while it is running. so you could start a burn as user, then use 'renice' (as root) to set that process to a high priority.  i have not tried this , just an idea ..

as mentioned elsewhere in this thread, plextor writers are basically standard cd drives with a few extra commands that are outside of the standard specifications. the kernel currently disallows these extra commands, and i get the picture that this doesnt allow plextor writers to work properly.

i will write a patch to allow the extra commands - i doubt it will be accepted upstream, but at least you plextor customers will be able to burn cd's without having to bypass the command filter entirely.

finally, i believe that a better solution is on its way which will hopefully be included in 2.6.11 - the command filter will be controlled in userspace and should allow for odd situations such as plextor burning.

----------

## ahorn

thanks for the tipp, helps me a lot and keeps my head cool  :Smile: 

1st i tought it's an udev problem, 2nd my burner is dead  :Cool:  (it's an old one)

anyway, thanks!

----------

## dsd

could people who own plextor drives and have trouble writing cd's please apply this patch and let me know if it helps or not:

http://www.reactivated.net/patches/linux-kernel/2.6.9/scsi_ioctl-permit-plextor.patch

----------

## ageb

Hi all,

I'm joining this thread because I can't burn successfully using kernel 2.6.9-r9 (also r4 and r :Cool:  cause me grief. I have tried to follow the advice in this thread and can now burn an image using 

```
cdrecord dev=/dev/hdc -dao -data my.iso
```

I am not so lucky while using xcdroast and k3b.

Xcdroast will only let me burn as root which if I understand causes problems with a bug in cdrecord. K3b seems to allow me to burn an iso and doesn't give any errors but then fails in the verification stage.

When I try and calulate an md5sum through the command line using

 *Quote:*   

> md5sum /dev/hdc

 

The program seems to run fine until it gets near the end of the disk and then fails with a device error. 

Checking dmesg produces the following error:

 *Quote:*   

> 
> 
> Buffer I/O error on device hdc, logical block 164587
> 
> hdc: command error: status=0x51 { DriveReady SeekComplete Error }
> ...

 

Any thoughts anyone as to what the cause of this may be?

Cheers

Adrian

----------

## Lokheed

Looks like there is still an issue with growisofs and the new kernel.

I am running 2.6.10-RC2 Vanilla Source and DVD+RW-TOOLS v5.21. Using K3b v0.11.17 and am coming into problems burning DVDs. I have an NEC 2500A drive.

I can burn the first disk fine, but if I choose to burn a second disk subsequetnly, I get;

```

:-( unable to PREVENT MEDIA REMOVAL: Operation not permitted

Fatal error at startup: OPERATION NOT PERMITTED

Unable to eject media

```

Like I said, this only happens after the first burn which works just as it should--so it looks like there is still some kind of permission issue happening somewhere as it works perfectly in root. I only get this error in my user account.

----------

## dsd

use 2.6.10-rc3. my medium removal patch is included in there.

----------

## Lokheed

 *dsd wrote:*   

> use 2.6.10-rc3. my medium removal patch is included in there.

 

Just noticed this in portage, emerging it as I type this. Will post back to see if it does indeed fix it. Thanks dsd.

----------

## Lokheed

No good. Still get the same error, RC3 didnt fix it. Any ideas?

----------

## COMKEEN

Hey dsd,

I have exactly the same problem as Lokheed:

Burning CDs was no problem with 2.6.10-rc[2|3] when you adhere to your howto in the original post (in short: Just remove the suid bits).

Burning DVDs just don't work:

* I don't know exactly which error messages I got with k3b 0.11.10, but finally had to upgrade dvd+rw-tools to the latest version (dvd+rw-tools-5.21.4.10. :Cool: .

* After that, k3b couldn't find dvd+rw-format which already was a known issue and could be solved by updating k3b from 0.11.10 to >= 0.11.13 (I am now using 0.11.17 because it was the one portage emerged automatically).

* I also added my username to "cdrom" and "cdrw" in /etc/group.

However, if I try to burn a DVD it only works the very first time. After the first DVD is finished I couldn't burn any other DVD until I reboot my machine.

The complete error log of k3b is:

```

System

-----------------------

K3b Version:0.11.17 

KDE Version: 3.1.5

QT Version: 3.3.2

growisofs

-----------------------

WARNING: /dev/hdc already carries isofs!

About to execute 'builtin_dd if=/tmp/kde-cmarker/DVD.iso of=/dev/hdc obs=32k seek=0'

:-( unable to PREVENT MEDIA REMOVAL: Operation not permitted

growisofs comand:

-----------------------

/usr/bin/growisofs -Z /dev/hdc=/tmp/kde-cmarker/DVD.iso -use-the-force-luke=notray -use-the-force-luke=tty -use-the-force-luke=dao -dvd-compat -speed=2.4 

mkisofs

-----------------------

/usr/bin/mkisofs: Warning: -follow-links does not always work correctly; be careful.

Warning: creating filesystem that does not conform to ISO-9660.

Warning: ISO-9660 filenames longer than 31 may cause buffer overflows in the OS.

Total translation table size: 0

Total rockridge attributes bytes: 331

Total directory bytes: 0

Path table size(bytes): 10

Max brk space used 0

186 extents written (0 MB)

mkisofs comand:

-----------------------

/usr/bin/mkisofs -gui -graft-points -volid DVD -volset  -appid K3b - Version 0.11.1 -publisher  -preparer K3b - Version 0.11.1 -sysid Linux -volset-size 1 -volset-seqno 1 -sort /tmp/kde-cmarker/k3bsGPYVa.tmp -rational-rock -hide-list /tmp/kde-cmarker/k3bBOl2mb.tmp -joliet -hide-joliet-list /tmp/kde-cmarker/k3by0iXwb.tmp -allow-leading-dots -full-iso9660-filenames -relaxed-filenames -allow-lowercase -no-iso-translate -allow-multidot -max-iso9660-filenames -follow-links -iso-level 3 -path-list /tmp/kde-cmarker/k3bl0bFbc.tmp /home/cmarker/.kde3.1/share/apps/k3b/temp/dummydir0/ 

```

----------

## dsd

are there any rejected commands in dmesg?

----------

## cmichal

I bet that the SCSI I/O buffer allocation failure that people see when cdrecord is suid is related to changes in mlockall that were made in 2.6.9.

Before 2.6.9, mlockall would only work for root.  Now it 'works' for all users, but the behaviour is different if you aren't root - there's a (very small) limit on how much memory a non-root user can lock.  cdrecord calls mlockall before dropping privilges, but then goes to allocate buffers afterwards.

A fix is to:

 struct rlimit   my_lim;

 my_lim.rlim_cur = RLIM_INFINITY;

 my_lim.rlim_max = RLIM_INFINITY;

 setrlimit(RLIMIT_MEMLOCK,&my_lim);

*before* dropping privileges.  This should allow cdrecord to be suid again, so that the scheduling priority can also be dealt with.

----------

## undrwater

 *dsd wrote:*   

> could people who own plextor drives and have trouble writing cd's please apply this patch and let me know if it helps or not:
> 
> http://www.reactivated.net/patches/linux-kernel/2.6.9/scsi_ioctl-permit-plextor.patch

 

Will try this when I get home!   :Very Happy: 

----------

## d_m

I just noticed this thread. My questions are:

1. I noticed my cdrecord is not setuid root, but rather setgid cdrw. I can't remember if this is something I did or that portage set up. Either way, should I remove the setgid bit? I don't think it will affect anything since my user owns the device, and it's in group root.

ls -l /dev/hdc (the burner):

```

brw-------  1 ${USER} root 22, 0 Apr 13  2004 /dev/hdc

```

ls -l /usr/bin/cdrecord:

```

-rwxr-sr-x  1 root cdrw 332868 Sep 21 12:09 /usr/bin/cdrecord*

```

2. I have been burning using my current kernel (2.6.9-r9). Can I do tests with that, and only compile in the debugging code if it seems to fail? I'd prefer to leave my kernel unpatched if possible, although I do want to help out. It seems like the debugging is only necessary if this burning has errors--is this true.

For what it's worth, currently burning works for any user using the dev=/dev/hdc syntax. Burning fails for normal users but works as root with the dev=ATAPI:0,0,0 syntax. In each case you also get Mr. Schiller's tirades about linux.  :Smile: 

[ EDIT: Some of the post was garbled--fixed. ]Last edited by d_m on Wed Dec 08, 2004 4:57 pm; edited 1 time in total

----------

## dsd

i'm fairly sure we permit all the standard commands and if cd writing is working then there is no issue

so dont worry too much about debugging it

----------

## COMKEEN

 *Quote:*   

> 
> 
> are there any rejected commands in dmesg?
> 
> 

 

There is only one single line that appeared after I fininished the first burn process, I even don't know if it's related to the problem:

```

$ tail -f /var/log/messages

[...]

Dec  7 21:28:49 $hostname scsi: unknown opcode 0x1e

```

```

$ dmesg

scsi: unknown opcode 0x1e

```

----------

## dsd

0x1e is PREVENT_ALLOW_MEDIUM_REMOVAL and definately (after my patch) is permitted in the kernel. however you need write access and the node must be opened in write mode. perhaps its not. 

 *Quote:*   

> growisofs
> 
> -----------------------
> 
> WARNING: /dev/hdc already carries isofs!
> ...

 

which package owns builtin_dd ?

----------

## COMKEEN

 *Quote:*   

> 
> 
> 0x1e is PREVENT_ALLOW_MEDIUM_REMOVAL and definately (after my patch) is permitted in the kernel.
> 
> 

 

I both tried development-sources-rc2 and development-sources-rc3 (which is my current kernel).

 *Quote:*   

> 
> 
> however you need write access and
> 
> 

 

I am pretty sure I have write access:

```

lrwxrwxrwx    1 root     root            3  7. Dez 22:24 cdrom -> hdc

lrwxrwxrwx    1 root     root            3  7. Dez 22:24 cdrw -> hdc

lrwxrwxrwx    1 root     root            3  7. Dez 22:24 dvd -> hdc

lrwxrwxrwx    1 root     root            3  7. Dez 22:24 dvdram -> hdc

lrwxrwxrwx    1 root     root            3  7. Dez 22:24 dvdrw -> hdc

brw-------    1 username  cdrom     22,   0  7. Dez 22:24 hdc

```

I also have chmodded hdc to 777 but the error still remains.

 *Quote:*   

> 
> 
> the node must be opened in write mode. perhaps its not.
> 
> 

 

How can I make sure the node is opened in write mode? I guess I can't influence this directly, right? Isn't that something k3b or growisofs should care about?

 *Quote:*   

> 
> 
> which package owns builtin_dd ?
> 
> 

 

I'm ashamed I can't find it:

```

$ locate builtin_dd

[nothing]

```

```

$ man builtin_dd

No manual entry for builtin_dd

```

```

$ built[TAB][TAB]

$ builtin

$ which builtin

which: no builtin in (/sbin:/bin:/usr/sbin:/usr/bin)

```

----------

## Lokheed

 *COMKEEN wrote:*   

> 
> 
> However, if I try to burn a DVD it only works the very first time. After the first DVD is finished I couldn't burn any other DVD until I reboot my machine.
> 
> 

 

Same deal here. First time works like a charm but only a reboot will allow the user to burn again after that...

----------

## mirko_3

builtin_dd is, well, builtin  :Wink: 

It's part of growisofs, which comes with dvd+rw-tools...

----------

## javac16

 *dsd wrote:*   

> could people who own plextor drives and have trouble writing cd's please apply this patch and let me know if it helps or not:
> 
> http://www.reactivated.net/patches/linux-kernel/2.6.9/scsi_ioctl-permit-plextor.patch

 

Gave this a try with 2.6.9-r9.  I was:

able to see Plextor drive again (it didn't show up in dmesg in -r9).

able to burn a audio CD with k3b.

Haven't tried a DVD yet.

----------

## undrwater

 *javac16 wrote:*   

>  *dsd wrote:*   could people who own plextor drives and have trouble writing cd's please apply this patch and let me know if it helps or not:
> 
> http://www.reactivated.net/patches/linux-kernel/2.6.9/scsi_ioctl-permit-plextor.patch 
> 
> Gave this a try with 2.6.9-r9.  I was:
> ...

 

I second that!  Thanks! ...no error messages either.

It also cleared up the freezing mentioned earlier...

----------

## korngerd

Got the Plextor patch into my kernel, tried recording, and got the following errors from dmesg:

spurious 8259A interrupt: IRQ7.

verify_command: rejected command 1

Running gentoo-dev-sources-2.6.9-r9 with a PLEXTOR CD-R PX-W4012A drive.  Any clues?

----------

## dsd

 *korngerd wrote:*   

> spurious 8259A interrupt: IRQ7.

 

unrelated to cd burning

 *Quote:*   

> verify_command: rejected command 1

 

harmless, to be expected (also appears with non-plextors)

did the burn fail?

----------

## COMKEEN

 *mirko_3 wrote:*   

> builtin_dd is, well, builtin 
> 
> It's part of growisofs, which comes with dvd+rw-tools...

 

Well, if it's built in dvd+rw-tools and I installed the latest version - why is it causing problems?   :Question:   :Confused:   :Question: 

----------

## dsd

 *COMKEEN wrote:*   

> Well, if it's built in dvd+rw-tools and I installed the latest version - why is it causing problems?    

 

lets find out.. could either you or someone else with this problem please apply this patch to dvd+rw-tools :

http://www.reactivated.net/patches/dvd+rw-tools/5.21.4.10.8/debug-fds.patch

it won't fix anything but will produce debugging output which i'd be interested to see

----------

## COMKEEN

 *dsd wrote:*   

>  *COMKEEN wrote:*   Well, if it's built in dvd+rw-tools and I installed the latest version - why is it causing problems?     
> 
> lets find out.. could either you or someone else with this problem please apply this patch to dvd+rw-tools :
> 
> http://www.reactivated.net/patches/dvd+rw-tools/5.21.4.10.8/debug-fds.patch
> ...

 

I applied the patch as described in https://forums.gentoo.org/viewtopic.php?t=99727.

Here is the debugging output:

This is what I get from k3b when started from a Console Window:

```

$ k3b

mcop warning: user defined signal handler found for SIG_PIPE, overriding

kdecore (KAction): WARNING: KActionCollection::KActionCollection( QObject *parent, const char *name, KInstance *instance )

k3b: WARNING: KDE detected X Error: BadMatch (invalid parameter attributes) \x08

  Major opcode:  *

```

And this is what I get inside k3b:

```

System

-----------------------

K3b Version:0.11.17 

KDE Version: 3.1.5

QT Version: 3.3.2

growisofs

-----------------------

6 opened 5

7 ioctl 5

WARNING: /dev/hdc already carries isofs!

About to execute 'builtin_dd if=/tmp/kde-cmarker/DVD.iso of=/dev/hdc obs=32k seek=0'

preventing removal on fd 5

:-( unable to PREVENT MEDIA REMOVAL: Operation not permitted

growisofs comand:

-----------------------

/usr/bin/growisofs -Z /dev/hdc=/tmp/kde-cmarker/DVD.iso -use-the-force-luke=notray -use-the-force-luke=tty -use-the-force-luke=dao -dvd-compat -speed=2.4

```

----------

## undrwater

 *dsd wrote:*   

> could people who own plextor drives and have trouble writing cd's please apply this patch and let me know if it helps or not:
> 
> http://www.reactivated.net/patches/linux-kernel/2.6.9/scsi_ioctl-permit-plextor.patch

 

Will this be available in later gentoo-dev-sources?

----------

## dsd

as long as the co-maintainer accepts my reasoning for it.. (we normally dont patch things that dont make it into linus's tree, and this one almost certainly wont..)

----------

## undrwater

 *dsd wrote:*   

> as long as the co-maintainer accepts my reasoning for it.. (we normally dont patch things that dont make it into linus's tree, and this one almost certainly wont..)

 

/me has fingers crossed

----------

## tristure

Hi,

I might be late on this topic, but I wanted to react on ageb's post (in page 4 of this thread).

I have the same kind of problem : the writing itself seems to work ok, but after that the check fails, and the CD is unusable anyway. Not always mind you, once in a while everything works fine...

It looks a bit different as other problems in this thread, but it's quite common as I have noticed browsing this forum for several hours.

I have this problem with 2.6.8-ck3, and tried another kernel (2.6.7 gentoo-dev-sources) with no further success!

Burning as root doesn't improve things much.

I'm pretty sure that it's not hardware related because I can burn things without problems in Knoppix.

Do any other people have this problem? Any ideas on this?

It's really annoying. I can use my digital camera, my usb key, my portable mp3, but I can't safely burn a CD right now?!?   :Crying or Very sad: 

Thanks for help and hints!

----------

## COMKEEN

Hey dsd,

you might be interested in this: I found out that my problem doesn't exist if I tell k3b not to eject the disc after burning (don't know what the english translation in the preferences dialog of k3b is but I'm sure you know what I mean). This said, I can burn one DVD after another.

Maybe a point to chew on?

----------

## Lokheed

NICE workaround...no longer have to burn as root...sweet. Good enough till they get a patch in there  :Smile: 

Thanks COMKEEN  :Very Happy: 

----------

## COMKEEN

Hi Lokheed,

I'm glad this works for you, too. I think now that the problem is encircled and one has a point to start from, it would be easier to fix; the problem is that I don't know whether it's

a) A bug of k3b

b) A bug regarding growisofs (or the dvd+rw-tools suite) or

c) A kernel bug.

I really hope it isn't a bug in the hardware/firmware! What DVD burner do you have, btw?

Looking at page 1 and 2 of this thread it seems the problem is caused by growisofs/dvd+rw-tools. However, the bug shouldn't exist in the latest version of dvd+rw-tools. I also have no chance to test DVD burning under 2.6.9-whatever, because these kernels always break my USB stuff (my machine is unable to boot properly), so I have to use 2.6.10-something...

----------

## Lokheed

I hated 2.6.8 and 2.6.9. I thought they were both very flakey and made me weary in testing 2.6.10 but I am glad I did, rock solid, just like 2.6.7 was for me.

I am using an NEC 2500A. I know its not the hardware or firmware. I believe its just a simple issue with permissions again. Since the first burn works fine, that would denote that there isnt a problem with any conflits anymore.

I think its a matter of permissions with the eject function and probably is burried somewhere and no one quite knows wether its K3b, growisofs or the kernel...my guess is it won't be to long before its fixed. Its not an issue to have my disks eject so this workaround will hold me off, but I think its minor, just hard to find  :Wink: 

----------

## korngerd

 *dsd wrote:*   

>  *korngerd wrote:*   spurious 8259A interrupt: IRQ7. 
> 
> unrelated to cd burning
> 
>  *Quote:*   verify_command: rejected command 1 
> ...

 

Sorry for the late reply, dsd: the burn failed & my system went down again.  I'm wondering if my problem is related to DMA or not...

----------

## mrsteven

 *dsd wrote:*   

> I removed the patch and tested writing on my new burner. It worked as expected, minus cdrdao not being able to read the buffer capacity. I wrote a kernel patch to allow it to be able to read that again,which got accepted into the 2.6.10 tree yesterday.

 

Did you talk about the 2.6.10 vanilla kernel or the gentoo kernel?

----------

## COMKEEN

```

strace growisofs -Z /dev/hdc=/tmp/kde-cmarker/ooo.iso

execve("/usr/bin/growisofs", ["growisofs", "-Z", "/dev/hdc=/tmp/kde-cmarker/ooo.iso"], [/* 54 vars */]) = 0

brk(0)                                  = 0x8057000

old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000

open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)

open("/etc/ld.so.cache", O_RDONLY)      = 3

fstat64(3, {st_mode=S_IFREG|0644, st_size=86946, ...}) = 0

old_mmap(NULL, 86946, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40018000

close(3)                                = 0

open("/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/libstdc++.so.5", O_RDONLY) = 3

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 \253\3"..., 512) = 512

fstat64(3, {st_mode=S_IFREG|0755, st_size=703284, ...}) = 0

old_mmap(NULL, 722368, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x4002e000

old_mmap(0x400d5000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xa6000) = 0x400d5000

old_mmap(0x400da000, 17856, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x400da000

close(3)                                = 0

open("/lib/libm.so.6", O_RDONLY)        = 3

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\3005\0"..., 512) = 512

fstat64(3, {st_mode=S_IFREG|0755, st_size=150760, ...}) = 0

old_mmap(NULL, 134496, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x400df000

old_mmap(0x400ff000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1f000) = 0x400ff000

close(3)                                = 0

open("/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/libgcc_s.so.1", O_RDONLY) = 3

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@\25\0\000"..., 512) = 512

fstat64(3, {st_mode=S_IFREG|0644, st_size=841088, ...}) = 0

old_mmap(NULL, 34380, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x40100000

old_mmap(0x40108000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x40108000

close(3)                                = 0

open("/lib/libc.so.6", O_RDONLY)        = 3

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\215T\1"..., 512) = 512

fstat64(3, {st_mode=S_IFREG|0755, st_size=1165916, ...}) = 0

old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40109000

old_mmap(NULL, 1104356, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x4010a000

old_mmap(0x40212000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x107000) = 0x40212000

old_mmap(0x40215000, 10724, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40215000

close(3)                                = 0

munmap(0x40018000, 86946)               = 0

brk(0)                                  = 0x8057000

brk(0x8078000)                          = 0x8078000

uname({sys="Linux", node="ares", ...})  = 0

open("/dev/urandom", O_RDONLY)          = 3

read(3, "\374\354M\35", 4)              = 4

close(3)                                = 0

mmap2(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40018000

geteuid32()                             = 1001

getuid32()                              = 1001

setresuid32(-1, 1001, -1)               = 0

access("/dev/hdc", F_OK)                = 0

open("/tmp/kde-cmarker/ooo.iso", O_RDONLY|O_LARGEFILE) = 3

setresuid32(-1, 1001, -1)               = 0

getuid32()                              = 1001

open("/dev/hdc", O_RDONLY|O_LARGEFILE)  = 4

fstat64(4, {st_mode=S_IFBLK|0600, st_rdev=makedev(22, 0), ...}) = 0

open("/dev/hdc", O_RDWR|O_NONBLOCK|O_LARGEFILE) = 5

ioctl(5, 0x2285, 0xbffff058)            = 0

ioctl(5, 0x2285, 0xbffff058)            = 0

ioctl(5, 0x2285, 0xbffff058)            = 0

ioctl(5, 0x2285, 0xbffff058)            = 0

ioctl(5, 0x2285, 0xbffff058)            = 0

ioctl(5, CDROM_MEDIA_CHANGED, 0x7fffffff) = 0

open("/dev/rawctl", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)

dup(5)                                  = 6

prctl(0x8, 0x1, 0x7fffffff, 0x40007de0, 0x8048a0f) = 0

capset(0x19980330, 0, {, CAP_SYS_RAWIO, }) = -1 EPERM (Operation not permitted)

setuid32(1001)                          = 0

pread(4, "\1CD001\1\0Linux                   "..., 2048, 32768) = 2048

open("/dev/tty", O_RDONLY|O_LARGEFILE)  = 7

ioctl(7, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0

close(7)                                = 0

write(2, "WARNING: /dev/hdc already carrie"..., 41WARNING: /dev/hdc already carries isofs!

) = 41

fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 1), ...}) = 0

old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40028000

write(1, "About to execute \'builtin_dd if="..., 85About to execute 'builtin_dd if=/tmp/kde-cmarker/ooo.iso of=/dev/hdc obs=32k seek=0'

) = 85

write(2, "Sleeping for 5 sec...\7", 22Sleeping for 5 sec...) = 22

poll(0, 0, 1000

)                       = 0

write(2, "\10\10\10\10\10\10\10\0104 sec..4 sec...) = 17

poll(0, 0, 1000

)                       = 0

write(2, "\10\10\10\10\10\10\10\0103 sec..3 sec...) = 17

poll(0, 0, 1000

)                       = 0

write(2, "\10\10\10\10\10\10\10\0102 sec..2 sec...) = 17

poll(0, 0, 1000

)                       = 0

write(2, "\10\10\10\10\10\10\10\0101 sec..1 sec...) = 17

poll(0, 0, 1000

)                       = 0

) = 172, "\10\10\10\10\10\10\10\0100 sec..0 sec...

fcntl64(4, F_GETFD)                     = 0

fcntl64(4, F_SETFD, FD_CLOEXEC)         = 0

fcntl64(6, F_GETFD)                     = 0

fcntl64(6, F_SETFD, FD_CLOEXEC)         = 0

fcntl64(5, F_GETFD)                     = 0

fcntl64(5, F_SETFD, FD_CLOEXEC)         = 0

fork()                                  = 14485

--- SIGCHLD (Child exited) @ 0 (0) ---

waitpid(14485, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0) = 14485

getpid()                                = 14484

gettimeofday({1103571906, 808805}, NULL) = 0

getpid()                                = 14484

open("/tmp/dvd+rw.yFpBs9", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600) = 7

ftruncate64(7, 20)                      = 0

unlink("/tmp/dvd+rw.yFpBs9")            = 0

mmap2(NULL, 20, PROT_READ|PROT_WRITE, MAP_SHARED, 7, 0) = 0x40029000

close(7)                                = 0

fstat64(3, {st_mode=S_IFREG|0644, st_size=631676928, ...}) = 0

fork()                                  = 14486

read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 65536) = 65536

ioctl(5, 0x2285, 0xbffff048)            = -1 EPERM (Operation not permitted)

write(2, ":-( unable to PREVENT MEDIA REMO"..., 37:-( unable to PREVENT MEDIA REMOVAL: ) = 37

write(2, "Operation not permitted\n", 24Operation not permitted

) = 24

munmap(0x40028000, 4096)                = 0

exit_group(129)                         = ?

```

```

$ dmesg

[...]

scsi: unknown opcode 0x1e

```

----------

## COMKEEN

Lokheed,

I found another workaround: Set growisofs suid root. I am sure it wasn't meant to be running as root (on the other hand cdrecord was until 2.6.9, so it shouldn't be an issue).

```

# ls -lah | grep growisofs

-rwxr-xr-x    1 root     root          57K 12. Dez 13:13 growisofs

# chmod +s growisofs

ls -lah | grep growisofs

-rwsr-sr-x    1 root     root          57K 12. Dez 13:13 growisofs

```

It should work now.

----------

## Lokheed

 *COMKEEN wrote:*   

> Lokheed,
> 
> I found another workaround: Set growisofs suid root. I am sure it wasn't meant to be running as root (on the other hand cdrecord was until 2.6.9, so it shouldn't be an issue).
> 
> ```
> ...

 

Thanks CK. I will give this a try. I would actually like this one better then to restrict the eject function after a burn. I have been having some flaky burns lately with K3b so I started burning in command line but will test this out.

It should work now.

----------

## gregy_

Hi,

I have a CD-RW/DVD-ROM and a DVD-RW IDE drives.

Somewhere after moving from 2.6.7 to 2.6.9 DVD burning stopped working.

I have myself added to "cdrom" and "cdrw" groups.

CDRW burning on the DVD-RW drive seems to work OK, but DVD-RW failes if not executed by root (growisofs prints an error about "failed SELECT with ...").

Changing permissions on the /dev/hdd or setting SUID bits on growisofs don't seem to help - only the root can burn DVD successfully...

Any ideas on how to fix that?

Thanks in advance,

Gregory.

----------

## gregy_

Ok. The problem was resolved.

Appearently now stable version of dvd-rw tools is not updated enough to work with 2.6.9-r9 kernel. You'll need to emerge the update (I used dvd+rw-tools-5.21.4.10. :Cool:  to make sure growisofs opens the DVD for writing.

----------

## agnitio

Hi, I don't really know if this is the right thread to post this in, I'm experiencing similar problems as the others in here but not quite the same.

If I run cdrecord dev=/dev/hdc -checkdrive I get this:

```

$ cdrecord dev=/dev/hdc -checkdrive

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

cdrecord: Warning: Running on Linux-2.6.10-gentoo

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: '/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    : 'QSI     '

Identifikation : 'DVD/CDRW SBW-161'

Revision       : 'SE02'

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:

```

The "Supported modes"-line is empty and thus it's impossible to get cdrecord to burn anything. This happend very recently as I've been able to burn cd:s in the past. I'm using gentoo-dev-sources-2.6.10.

If I try to blank a disk I get the same output with one additional line:

```

cdrecord: Cannot init drive.

```

----------

## dsd

anything appearing at the end of dmesg? something like "unknown opcode 0xXX" ?

----------

## agnitio

Sometimes, although very rarely, I get the output:

```

scsi: unknown opcode 0x01

```

or

```

scsi: unknown opcode 0x55

```

I haven't been able to figure out when it outputs and when it does not.

----------

## dsd

sounds like another cdrecord bug, 0x55 is definately permitted by the kernel but only if the program opens the cd writer for write access. your /dev/hdc is defiantely user-writable, yes?

btw, you will only be warned once (the first time) for each opcode unless you reboot the system.

----------

## agnitio

Yes my hdc is user writeable. For some reason it sets my user as the owner, don't know if I put that in some udev rule or something. I can't find anything about it atm. though. Anyway I've tried using sudo and as root and the results are the same.

Using cdrdao I successfully blanked a disc so I suppose it's a cdrecord error. I guess I'll have to switch to and learn cdrdao.

 *dsd wrote:*   

> 
> 
> btw, you will only be warned once (the first time) for each opcode unless you reboot the system.
> 
> 

 

Ah, thanks for clearing that up. That explains why I couldn't reproduce them. :)

----------

## GentooMik

Telling you people, we need another program to cdrtools. It is a pain all frontends for it seem to have broke.  Even 2.4 kernels, can be flaky once in a while. Sadly I have no skills to code with you would throw myself to  help otherwise. The way Schiley is rushing to fix this  gives linux burning a bad name. <sigh>   :Sad:   Just was browsing this forum  for the same exact cause, only I am booted into another distro. Does not make a difference   same problem with then all! Only difference is gentoo is working at faster pace to resolve or work around this issue.

Why is  Dev=/dev/hXX    so bad  want to hear that from developers? Why does the Author of cdrtools find it so scary? Is their a reasoning behind  this? Or, it is just for the sake "because" ?

----------

## javac16

Just got 2.6.9-r13.  For those interested you need to apply the PLEXTOR patch again.

----------

## mirko_3

So, is this patch now in mainstream? (not the plextor one, the other one)

----------

## dsd

2 of my patches are in the mainline kernel. the plextor one is not. are people still having the same issues with plextor on unpatched 2.6.10? i have not heard anything for a while...

----------

## dsd

this patch may be useful for those who were getting buffer underruns as non-root (but not sure at all..)

http://marc.theaimsgroup.com/?l=linux-kernel&m=110528493819718&w=2

----------

## undrwater

 *dsd wrote:*   

> 2 of my patches are in the mainline kernel. the plextor one is not. are people still having the same issues with plextor on unpatched 2.6.10? i have not heard anything for a while...

 

I'll test this today and get back with you.

----------

## wantilles

Since I do not have the time and patience to read the thread from the beginning, I would like to report that I have had no problems so far with DVD recording, throughtout kernels 2.6.7 and greater.

Writer

Plextor PX-708A (latest firmware)

Media

- Taiyo Yuden DVD +R 8x

- TDK DVD +RW 4x

Software

- latest ~x86 k3b & dvd+rw-tools via Gnome 2.8.x as a regular user.

----------

## undrwater

 *undrwater wrote:*   

>  *dsd wrote:*   2 of my patches are in the mainline kernel. the plextor one is not. are people still having the same issues with plextor on unpatched 2.6.10? i have not heard anything for a while... 
> 
> I'll test this today and get back with you.

 

All appears well and good with 2.6.10-gentoo-r4.  No burn issues at all.

----------

## contextswitch

 *agnitio wrote:*   

> Yes my hdc is user writeable. For some reason it sets my user as the owner, don't know if I put that in some udev rule or something. 

 

It's probably PAM setting the owner when you log in.

-- 

Geoff

----------

## contextswitch

 *agnitio wrote:*   

> Yes my hdc is user writeable. For some reason it sets my user as the owner, don't know if I put that in some udev rule or something. 

 

It's probably PAM setting the owner when you log in.

-- 

Geoff

----------

## mrsteven

It is a PAM setting. Delete the line 

```
#<console>  0600 <cdrom>      0660 root.cdrom
```

 in /etc/security/console.perms, if you don't want this.

----------

## tcbounce

Hello,

Thanks for the info on this problem. I hit is as well and my cdrom burner (a Korean LG) hang and reported similar messages. I'll upgrade from 2.6.10-r1 and make the appropriate changes.

I saw some debian forums have a winge about this same issue. The people here generally take a DIY approach fixing problems and then share their knowledge with the gentoo userbase, rather than doing the former. 

For number hours saved finding resolutions to problems on this forum, I'll try and contribute back more!!

"ide-scsi is and always has been a dirty, dirty hack, and its death is appreciated by many, myself included.

Jörg's an asshole and Linus is stubborn, but stubbornly right, imho." 

Last question: Which is the best way to use my ATAPI device. I read if you enable ide-scsi in the kernel and use a boot time argument I heard it turns of DMA. Should I use atapi or ide-scsi module (does the latter work with DMA). I want to use modules, because it's reconmended to DMA when watching DVDs for example with xine, so I'd like to switch between the two.

Cheers,

Luke

----------

## bwins46

I have a LITE-ON DVD/CDRW drive that fails when attempting power calibration (OPC).  It seems like the drive actually does the proper thing but cdrecord is mishandling the returned status.

```

Performing OPC...

/usr/bin/cdrecord: Success. send opc: scsi sendcmd: no error

CDB:  54 01 00 00 00 00 00 00 00 00

status: 0x4 (CONDITION MET/GOOD)

cmd finished after 60.041s timeout 60s

/usr/bin/cdrecord: OPC failed.

```

I've not worked in SCSI for a while but if I remember, a normal GOOD status was a 0x0, my drive appears to be returning a 0x4 (CONDITION MET/GOOD).  I'm going to guess that the manufacturer believes that CONDITION MET/GOOD should be interpreted as power calibration succeeded.  It looks like cdrtools is treating the return code as an error and hence aborts without writing the CD.

cdrtools is treating the drive as generic..

```

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

```

----------

## dsd

i stand corrected, it was an evil kernel bug causing the growisofs error mentioned many times in this thread.

this patch should solve it:

http://dev.gentoo.org/~dsd/gentoo-dev-sources/release-10.08/dist/1915_cdrw-filter-warnings.patch

----------

## beu

Got another report of command '1e' being filtered.  This is while attempting to burn a CD-R (using k3b and cdrtools only) on a CyberDrv CW088D/Generic MMC 3, though.  I've patched cdrtools to open the device read/write, too.

Ahem, last edit:

This is all on g-d-s-2.6.10-r7 with cdrtools-2.01.01_alpha1 and k3b-0.11.20.

----------

## mrsteven

I've just noticed something interesting:

If you try to burn a CDR as non-root with cdrecord dev=ATAPI:0,0,0 it will not work, as we well know. But if you try to burn with cdrecord dev=/dev/cdrom after that, it will not work anymore.

```
bash-2.05b$ cdrecord -v dev=/dev/cdrom blank=fast

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

cdrecord: Warning: Running on Linux-2.6.10

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

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

TOC Type: 1 = CD-ROM

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: '/dev/cdrom'

devname: '/dev/cdrom'

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'.

SCSI buffer size: 64512

atapi: 1

Device type    : Removable CD-ROM

Version        : 0

Response Format: 2

Capabilities   :

Vendor_info    : 'TOSHIBA '

Identifikation : 'DVD-ROM SD-R2512'

Revision       : '1720'

Device seems to be: Generic mmc2 DVD-ROM.

Current: 0x000A

Profile: 0x0010

Profile: 0x0008

Profile: 0x0009

Profile: 0x000A (current)

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

Driver flags   : MMC-3 SWABAUDIO BURNFREE

Supported modes:

Drive buf size : 1791936 = 1749 KB

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

Current Secsize: 2048

ATIP info from disk:

  Indicated writing power: 3

  Reference speed: 6

  Is not unrestricted

  Is erasable

  Disk sub type: High speed Rewritable (CAV) media (1)

  ATIP start of lead in:  -11596 (97:27/29)

  ATIP start of lead out: 359849 (79:59/74)

  1T speed low:  4 1T speed high: 10

  2T speed low:  4 2T speed high:  0 (reserved val  6)

  power mult factor: 1 5

  recommended erase/write power: 4

  A1 values: 24 1A C8

  A2 values: 26 B2 4A

Disk type:    Phase change

Manuf. index: 20

Manufacturer: Princo Corporation

cdrecord: Cannot init drive.
```

dmesg output:

```
scsi: unknown opcode 0x01

scsi: unknown opcode 0x55

scsi: unknown opcode 0x1e

scsi: unknown opcode 0x35

scsi: unknown opcode 0xbb
```

----------

## dsd

this is fixed in 2.6.10-r7

----------

## mrsteven

Ok, clear answer, thank you. I think it will also be fixed in vanilla-2.6.11, right?

----------

## dsd

yes

----------

## robet

Simple question here:

To burn a bootable CD, must it be burned -dao? I burned an .iso with "cdrecord dev=/dev/hda /path/to/iso" (which I think assumes tao) and... no boot.

If dao IS required, is there any way I can reburn that same CD dao (i.e... without using another).

----------

## AgenT

 *robet wrote:*   

> Simple question here:
> 
> To burn a bootable CD, must it be burned -dao? I burned an .iso with "cdrecord dev=/dev/hda /path/to/iso" (which I think assumes tao) and... no boot.
> 
> If dao IS required, is there any way I can reburn that same CD dao (i.e... without using another).

 

I could be wrong but... if the iso itself is bootable (that is, the iso itself has files that let it boot) then if you burn the iso in a regular fashion it should be bootable. If the iso is not bootable, then you will not be able to boot the iso cd regardless I think. You would have to remake the iso with a boot option and then burn it.

----------

## louman

First off, I'm pretty sure it's not a problem with the hardware, or medium, considering I've successfully used both to burn the gentoo liveCD under wind0ws.

I've been having lots of problems burning... I've only been using 2.6.9, and now I have 2.6.10 (gentoo-sources). I tried using bashburn, here are the nice messages:

(ran as root, same problem if ran as user)

```
Not enabling overburn...

cdrecord: No write mode specified.

cdrecord: Asuming -tao mode.

cdrecord: Future versions of cdrecord may have different drive dependent default s.

cdrecord: Continuing in 5 seconds...

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

cdrecord: Warning: Running on Linux-2.6.10-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.

TOC Type: 1 = CD-ROM

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'.

SCSI buffer size: 64512

atapi: 1

Device type    : Removable CD-ROM

Version        : 0

Response Format: 1

Vendor_info    : 'TDK     '

Identifikation : 'CDRW121032A     '

Revision       : '1.00'

Device seems to be: Generic mmc CD-RW.

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

Driver flags   : MMC SWABAUDIO BURNFREE

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

Drive buf size : 1359872 = 1328 KB

FIFO size      : 4194304 = 4096 KB

Track 01: data   687 MB

Total size:      789 MB (78:12.21) = 351916 sectors

Lout start:      789 MB (78:14/16) = 351916 sectors

Current Secsize: 2048

ATIP info from disk:

  Indicated writing power: 4

  Is unrestricted

  Is not erasable

  Disk sub type: Medium Type A, low Beta category (A-) (2)

  ATIP start of lead in:  -11634 (97:26/66)

  ATIP start of lead out: 359849 (79:59/74)

Disk type:    Short strategy type (Phthalocyanine or similar)

Manuf. index: 3

Manufacturer: CMC Magnetics Corporation

Blocks total: 359849 Blocks current: 359849 Blocks remaining: 7933

Starting to write CD/DVD at speed 12 in real TAO mode for single session.

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

Waiting for reader process to fill input buffer ... input buffer ready.

BURN-Free is OFF.

Performing OPC...

Starting new track at sector: 0

Track 01:    9 of  687 MB written (fifo 100%) [buf   4%]   9.3x.cdrecord: Succes s. write_g1: scsi sendcmd: no error

CDB:  2A 00 00 00 12 2A 00 00 1F 00

status: 0x2 (CHECK CONDITION)

Sense Bytes: F0 00 05 00 00 12 2D 0C 00 00 00 00 10 02 00 00

Sense Key: 0x5 Illegal Request, Segment 0

Sense Code: 0x10 Qual 0x02 (id crc or ecc error) [No matching qualifier] Fru 0x0

Sense flags: Blk 4653 (valid)

cmd finished after 0.032s timeout 40s

write track data: error after 9523200 bytes

cdrecord: A write error occured.

cdrecord: Please properly read the error message above.

Writing  time:   16.362s

Average write speed 371.5x.

Min drive buffer fill was 4%

Total of 1 possible drive buffer underruns predicted.

Fixating...

Fixating time:   21.872s

cdrecord: fifo had 214 puts and 151 gets.

cdrecord: fifo was 0 times empty and 128 times full, min fill was 90%.

Burning failed. Check docs for info.

Press [ENTER] to return to main menu.

```

after that, dmesg still didn't show anything.

then I tried running a simulation with cdrdao (since i've created around 10 coasters so far.)

```
bash-2.05b$ cdrdao simulate --device /dev/hdc --driver generic-mmc-raw /tmp/burn

/iso.toc

Cdrdao version 1.1.9 - (C) Andreas Mueller <andreas@daneb.de>

  SCSI interface library - (C) Joerg Schilling

  Paranoia DAE library - (C) Monty

Check http://cdrdao.sourceforge.net/drives.html#dt for current driver tables.

Using libscg version 'schily-0.8'

/dev/hdc: TDK CDRW121032A       Rev: 1.00

Using driver: Generic SCSI-3/MMC (raw writing) - Version 2.0 (options 0x0000)

Burning entire 79 mins disc.

Starting write simulation at speed 12...

Pausing 10 seconds - hit CTRL-C to abort.

Process can be aborted with QUIT signal (usually CTRL-\).

Using 96 byte raw P-W sub-channel data mode.

WARNING: No super user permission to setup real time scheduling.

Writing lead-in and gap...

Writing track 01 (mode MODE1/AUDIO )...

ERROR: Write data failed.s 100%   6%).

ERROR: Writing failed - buffer under run?

ERROR: Simulation failed.

```

again... nothing from dmesg. i think i might have a problem with that even -_-

any insight whatsoever would be appreciated

EDIT: I just successfully blanked a CD-RW using cdrecord -v -dev=/dev/hdc blank=fast... o_0 and testing another......... works again! now let me see if i can write... eh i'll come back in the morning. (burner max rw speed is 4x ><, its 3am)

----------

