Version: 0.12.10 (using KDE KDE 3.5.0) Installed from: Debian testing/unstable Packages OS: Linux Stefanos Harhalakis <v13@it.teithe.gr> reported the following on the Debian bug tracking system (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=354118): When trying to write a cd using a sata drive, k3b fails. A log is included in the message. The failed command is: /usr/bin/cdrecord.mmap -v gracetime=2 dev=1,0,0 speed=4 -dao driveropts=burnfree-eject -data just.an.iso This problem has the following side effects: 1) It requires that module 'sg' is loaded for /dev/sgX to be present 2) It requires that all /dev/sgX devices are readable from cdrecord. In my case, /dev/sg0 is for /dev/sda and /dev/sg1 is for /dev/scd0: crw-rw---- 1 root root 21, 0 Feb 23 15:06 /dev/sg0 crw-rw---- 1 root cdrom 21, 1 Feb 23 15:06 /dev/sg1 brw-rw---- 1 root disk 8, 0 Feb 23 14:20 /dev/sda brw-rw---- 1 root cdrom 11, 0 Feb 23 14:21 /dev/scd0 Of course, there should be no need for cdrecord to be able to read /dev/sg0. This is probably a bug of cdrecord. 3) It doesn't allow me to write anyt cdrom. Now, if i use the following command from command line: /usr/bin/cdrecord.mmap -v gracetime=2 dev=/dev/scd0 speed=4 -dao driveropts=burnfree -eject -data just.an.iso it simply works. The only difference is that dev=1,0,0 is replaced by /dev/scd0. If I remember correctly k3b uses the device name instead of the device id for atapi drivers. I believe that this should happen for for sata drives too. This also solves the /dev/sgX problem because cdrecord will not look it up. Tested using k3b from stable and testing/unstable/experimental (same version) too. The failed log: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- System ----------------------- K3b Version: 0.12.10 KDE Version: 3.5.1 QT Version: 3.3.5 Kernel: 2.6.15-1-686-smp Devices ----------------------- HL-DT-ST DVDRAM GSA-4163B A103 (/dev/scd0, /dev/sg1) at [CD-R; CD-RW; CD-ROM; DVD-ROM; DVD-RAM; DVD-R; DVD-RW; DVD+R; DVD+RW; DVD+R DL] [DVD-ROM; DVD-R Sequential; DVD-RAM; DVD-RW Restricted Overwrite; DVD-RW Sequential; DVD+RW; DVD+R; DVD+R Double Layer; CD-ROM; CD-R; CD-RW] [SAO; TAO; RAW; SAO/R96P; SAO/R96R; RAW/R16; RAW/R96P; RAW/R96R; Restricted Overwrite] Used versions ----------------------- cdrecord: 2.1.1a03 cdrecord ----------------------- /usr/bin/cdrecord: Warning: Running on Linux-2.6.15-1-686-smp /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. scsidev: '1,0,0' scsibus: 1 target: 0 lun: 0 Linux sg driver version: 3.5.33 SCSI buffer size: 64512 /usr/bin/cdrecord: This version of cdrecord does not include DVD-R/DVD-RW support code. /usr/bin/cdrecord: See /usr/share/doc/cdrecord/README.DVD.Debian for details on DVD support. Cdrecord-Clone 2.01.01a01 (i686-pc-linux-gnu) Copyright (C) 1995-2004 J?rg Schilling NOTE: this version of cdrecord is an inofficial (modified) release of cdrecord and thus may have bugs that are not present in the original version. Please send bug reports and support requests to <cdrtools@packages.debian.org>. The original author should not be bothered with problems of this version. TOC Type: 1 = CD-ROM Using libscg version 'schily-0.8'. Driveropts: 'burnfree' atapi: 1 Device type : Removable CD-ROM Version : 5 Response Format: 2 Capabilities : Vendor_info : 'HL-DT-ST' Identifikation : 'DVDRAM GSA-4163B' Revision : 'A103' Device seems to be: Generic mmc2 DVD-R/DVD-RW. Current: 0x000A Profile: 0x0012 Profile: 0x0011 Profile: 0x0014 Profile: 0x0013 Profile: 0x001A Profile: 0x001B Profile: 0x002B Profile: 0x0010 Profile: 0x0009 Profile: 0x000A (current) Profile: 0x0008 Profile: 0x0002 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 : 1053696 = 1029 KB Drive DMA Speed: 13843 kB/s 78x CD 9x DVD FIFO size : 4194304 = 4096 KB Track 01: data 496 MB Total size: 570 MB (56:29.81) = 254236 sectors Lout start: 570 MB (56:31/61) = 254236 sectors Current Secsize: 2048 ATIP info from disk: Indicated writing power: 6 Reference speed: 2 Is not unrestricted Is erasable ATIP start of lead in: -11680 (97:26/20) ATIP start of lead out: 337348 (74:59/73) 1T speed low: 0 (reserved val 0) 1T speed high: 4 2T speed low: 0 (reserved val 5) 2T speed high: 0 (reserved val 12) power mult factor: 4 5 recommended erase/write power: 3 A1 values: 02 4A B0 A2 values: 5C D8 26 Disk type: Phase change Manuf. index: 23 Manufacturer: SKC Co., Ltd. Blocks total: 337348 Blocks current: 337348 Blocks remaining: 83112 Starting to write CD/DVD at speed 4 in real SAO mode for single session. Last chance to quit, starting real write in 2 seconds. 1 seconds. 0 seconds. Operation starts. Waiting for reader process to fill input buffer ... input buffer ready. BURN-Free is OFF. Turning BURN-Free on Performing OPC... Sending CUE sheet... /usr/bin/cdrecord: WARNING: Drive returns wrong startsec (0) using -150 /usr/bin/cdrecord: Input/output error. 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 10 2A 00 00 90 30 05 00 00 Sense Key: 0x5 Illegal Request, Segment 0 Sense Code: 0x30 Qual 0x05 (cannot write medium - incompatible format) Fru 0x0 Sense flags: Blk 0 (not valid) cmd finished after 0.013s timeout 200s Writing pregap for track 1 at -150 write track pad data: error after 0 bytes BFree: 1029 K BSize: 1029 K Starting new track at sector: 0 Track 01: 0 of 496 MB written. /usr/bin/cdrecord: Input/output error. write_g1: scsi sendcmd: no error CDB: 2A 00 00 00 00 00 00 00 1F 00 status: 0x2 (CHECK CONDITION) Sense Bytes: 70 00 05 00 00 00 00 10 2A 00 00 90 30 05 00 00 Sense Key: 0x5 Illegal Request, Segment 0 Sense Code: 0x30 Qual 0x05 (cannot write medium - incompatible format) Fru 0x0 Sense flags: Blk 0 (not valid) cmd finished after 0.014s timeout 200s /usr/bin/cdrecord: A write error occured. /usr/bin/cdrecord: Please properly read the error message above. write track data: error after 0 bytes Writing time: 71.597s Average write speed 47.4x. Fixating... Fixating time: 0.004s /usr/bin/cdrecord: fifo had 64 puts and 1 gets. /usr/bin/cdrecord: fifo was 0 times empty and 0 times full, min fill was 100%. cdrecord command: ----------------------- /usr/bin/cdrecord.mmap -v gracetime=2 dev=1,0,0 speed=4 -dao driveropts=burnfree-eject -data /home/studin/knoppix-std-0.1.iso -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
On Thursday 23 February 2006 17:06, Francois Marier wrote: > Of course, there should be no need for cdrecord to be able to read > /dev/sg0. This is probably a bug of cdrecord. Actually cdrecord uses the generic scsi interface if called with a bus,id,lun parameter, so yes, it needs to read and write the sg device. > 3) It doesn't allow me to write anyt cdrom. just set the proper permissions. Once I know how to determine if using /dev/sxxx as a device parameter works I can change K3b accordingly but for now I have no idea which combination of kernel/cdrecord/device allows what...
I didn't made clear some things: 1) The user that tried to write the cd had read and write permissions to the dvdrw device files (he belongs to group cdrom). He didn't had permissions for the disks (/dev/sda, /dev/sg0) which should not be needed. 2) No matter what I did the user could not write the cdrom. Even with cdrecord (and cdrecord.mmap for debian) suid and full write access to all /dev/sgX devices. I tried about 4 times to burn an iso image with the loose permissions (read/write for the user to all /dev/sgX) and the disks were destryed. It seemed to start writting and then stop. As for the solutions/workaround: Perhaps you could add an option (maybe with some kernel-version pair guidelines) and let the user decide. Thanks for your work...
> 1) The user that tried to write the cd had read and write permissions to > the dvdrw device files (he belongs to group cdrom). He didn't had > permissions for the disks (/dev/sda, /dev/sg0) which should not be needed. wrong. as i said: cdrecord uses the generic scsi interface, thus it needs access to the sg devices. > 2) No matter what I did the user could not write the cdrom. Even with > cdrecord (and cdrecord.mmap for debian) suid and full write access to all > /dev/sgX devices. I tried about 4 times to burn an iso image with the loose > permissions (read/write for the user to all /dev/sgX) and the disks were > destryed. It seemed to start writting and then stop. and with /dev/scdX it worked? Well... > Perhaps you could add an option (maybe with some kernel-version pair > guidelines) and let the user decide. nope, that's not the k3b way. I will have to create a real fix.
Just for PoC, here is a session trying to write a cd as root. You can see: * A try to burn the cdrom using dev=1,0,0 (failed) * A try to burn the cdrom using dev=/dev/scd0 (failed because the disk is left unusable from the previous try) * A disk blanking using dev=1,0,0 (worked) * A disk write using dev=/dev/scd0 (worked) step 1 ------ # cdrecord dev=1,0,0 gracetime=2 -dao -data knoppix-std-0.1.iso Cdrecord-Clone 2.01.01a03 (i686-pc-linux-gnu) Copyright (C) 1995-2005 Joerg Schilling NOTE: this version of cdrecord is an inofficial (modified) release of cdrecord and thus may have bugs that are not present in the original version. Please send bug reports and support requests to <cdrtools@packages.debian.org>. The original author should not be bothered with problems of this version. cdrecord: Warning: Running on Linux-2.6.15-1-686-smp 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: '1,0,0' scsibus: 1 target: 0 lun: 0 Linux sg driver version: 3.5.33 Using libscg version 'debian-0.8debian2'. cdrecord: Warning: using inofficial version of libscg (debian-0.8debian2 '@(#)scsitransp.c 1.91 04/06/17 Copyright 1988,1 95,2000-2004 J. Schilling'). Device type : Removable CD-ROM Version : 5 Response Format: 2 Capabilities : Vendor_info : 'HL-DT-ST' Identifikation : 'DVDRAM GSA-4163B' Revision : 'A103' 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: See /usr/share/doc/cdrecord/README.DVD.Debian for details on DVD support. 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 Starting to write CD/DVD at speed 4 in real SAO mode for single session. Last chance to quit, starting real write 0 seconds. Operation starts. Turning BURN-Free off cdrecord: WARNING: Drive returns wrong startsec (0) using -150 cdrecord: Input/output error. 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 10 2A 00 00 90 30 05 00 00 Sense Key: 0x5 Illegal Request, Segment 0 Sense Code: 0x30 Qual 0x05 (cannot write medium - incompatible format) Fru 0x0 Sense flags: Blk 0 (not valid) cmd finished after 0.007s timeout 200s write track pad data: error after 0 bytes BFree: 1029 K BSize: 1029 K cdrecord: Input/output error. write_g1: scsi sendcmd: no error CDB: 2A 00 00 00 00 00 00 00 1F 00 status: 0x2 (CHECK CONDITION) Sense Bytes: 70 00 05 00 00 00 00 10 2A 00 00 90 30 05 00 00 Sense Key: 0x5 Illegal Request, Segment 0 Sense Code: 0x30 Qual 0x05 (cannot write medium - incompatible format) Fru 0x0 Sense flags: Blk 0 (not valid) cmd finished after 0.006s timeout 200s write track data: error after 0 bytes cdrecord: A write error occured. cdrecord: Please properly read the error message above. step 2 ------ # cdrecord dev=/dev/scd0 gracetime=2 -dao -data knoppix-std-0.1.iso Cdrecord-Clone 2.01.01a03 (i686-pc-linux-gnu) Copyright (C) 1995-2005 Joerg Schilling NOTE: this version of cdrecord is an inofficial (modified) release of cdrecord and thus may have bugs that are not present in the original version. Please send bug reports and support requests to <cdrtools@packages.debian.org>. The original author should not be bothered with problems of this version. cdrecord: Warning: Running on Linux-2.6.15-1-686-smp 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/scd0' devname: '/dev/scd0' 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 'debian-0.8debian2'. cdrecord: Warning: using inofficial version of libscg (debian-0.8debian2 '@(#)scsitransp.c 1.91 04/06/17 Copyright 1988,1995,2000-2004 J. Schilling'). Device type : Removable CD-ROM Version : 5 Response Format: 2 Capabilities : Vendor_info : 'HL-DT-ST' Identifikation : 'DVDRAM GSA-4163B' Revision : 'A103' 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: See /usr/share/doc/cdrecord/README.DVD.Debian for details on DVD support. 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 cdrecord: Drive needs to reload the media to return to proper status. cdrecord: Cannot get next writable address for 'invisible' track. cdrecord: This means that we are checking recorded media. cdrecord: This media cannot be written in streaming mode anymore. cdrecord: If you like to write to 'preformatted' RW media, try to blank the media first. 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. cdrecord: CUE sheet not accepted. Retrying with minimum pregapsize = 1. cdrecord: Input/output error. send_cue_sheet: scsi sendcmd: no error CDB: 5D 00 00 00 00 00 00 00 20 00 status: 0x2 (CHECK CONDITION) Sense Bytes: 70 00 05 00 00 00 00 10 5D 00 00 90 30 05 00 00 Sense Key: 0x5 Illegal Request, Segment 0 Sense Code: 0x30 Qual 0x05 (cannot write medium - incompatible format) Fru 0x0 Sense flags: Blk 0 (not valid) resid: 32 cmd finished after 0.005s timeout 200s cdrecord: CUE sheet still not accepted. Please try to write in RAW (-raw96r) mode. cdrecord: Cannot send CUE sheet. cdrecord: Could not write Lead-in. step 3 ------ # cdrecord dev=1,0,0 blank=fast Cdrecord-Clone 2.01.01a03 (i686-pc-linux-gnu) Copyright (C) 1995-2005 Joerg Schilling NOTE: this version of cdrecord is an inofficial (modified) release of cdrecord and thus may have bugs that are not present in the original version. Please send bug reports and support requests to <cdrtools@packages.debian.org>. The original author should not be bothered with problems of this version. cdrecord: Warning: Running on Linux-2.6.15-1-686-smp 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: '1,0,0' scsibus: 1 target: 0 lun: 0 Linux sg driver version: 3.5.33 Using libscg version 'debian-0.8debian2'. cdrecord: Warning: using inofficial version of libscg (debian-0.8debian2 '@(#)scsitransp.c 1.91 04/06/17 Copyright 1988,1995,2000-2004 J. Schilling'). Device type : Removable CD-ROM Version : 5 Response Format: 2 Capabilities : Vendor_info : 'HL-DT-ST' Identifikation : 'DVDRAM GSA-4163B' Revision : 'A103' 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: See /usr/share/doc/cdrecord/README.DVD.Debian for details on DVD support. 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 Starting to write CD/DVD at speed 4 in real BLANK mode for single session. Last chance to quit, starting real write 0 seconds. Operation starts. step 4 ------ # cdrecord dev=/dev/scd0 gracetime=2 -dao -data knoppix-std-0.1.iso Cdrecord-Clone 2.01.01a03 (i686-pc-linux-gnu) Copyright (C) 1995-2005 Joerg Schilling NOTE: this version of cdrecord is an inofficial (modified) release of cdrecord and thus may have bugs that are not present in the original version. Please send bug reports and support requests to <cdrtools@packages.debian.org>. The original author should not be bothered with problems of this version. cdrecord: Warning: Running on Linux-2.6.15-1-686-smp 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/scd0' devname: '/dev/scd0' 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 'debian-0.8debian2'. cdrecord: Warning: using inofficial version of libscg (debian-0.8debian2 '@(#)scsitransp.c 1.91 04/06/17 Copyright 1988,1995,2000-2004 J. Schilling'). Device type : Removable CD-ROM Version : 5 Response Format: 2 Capabilities : Vendor_info : 'HL-DT-ST' Identifikation : 'DVDRAM GSA-4163B' Revision : 'A103' 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: See /usr/share/doc/cdrecord/README.DVD.Debian for details on DVD support. 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 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. cdrecord: WARNING: Drive returns wrong startsec (0) using -150 Track 01: Total bytes read/written: 520675328/520675328 (254236 sectors). Hope it helps...
Created attachment 17005 [details] Use device name instead of device numbers on kernel 2.6.x I had the same issue with an external USB writer (Linux 2.6.x PREEMPT x86_64 Debian GNU/Linux). Burning CDs works with the device file name, but not with the device numbers. The attached patch uses the device file name instead of the device numbers if the device is an SCSI-device and the kernel version is larger than 2.6.0. (One interesting thing is that I had this issue only when running the x86_64 kernel, when running the i386 kernel with the same version on the same machine it also worked with the device numbers).
the problem is that using the block device can result in failures with cdrecord. At least on my system it only works with the bus,lun,id syntax. That is why I don't want to include this patch without knowing more about the issue.
I had the same issue with my external usb writer on /dev/sr0, my solution for the moment is to add in Options>Programms>Parameter for cdrecord dev=/dev/sr0 no it works...
Does this still happen with K3b 0.12.17? And if so, what about 1.0pre2?
It happens also with 0.12.17, tell you later about the 1.0pre2 if i had the time for test it. It is also not a k3b bug only a little problem, the bug seems to be in the kernels usb drivers, mr. schilling wrotes about :-), but the postings does not solve it. if i connect the drive to internal ide all works. Attachet to usb: cdrecord dev=5,0,0 -msinfo has failures cdrecord dev=/dev/sr0 -msinfo works
*** This bug has been confirmed by popular vote. ***
SVN commit 600463 by trueg: Use the /dev/sXX syntax instead of bus,id,lun. Joerg says it should be the same, but then there is bug 122568 and I had problems with the /dev syntax. Seems to work now though.... maybe we should try again... BUG: 122568 M +1 -1 k3bglobals.cpp --- trunk/extragear/multimedia/k3b/libk3b/core/k3bglobals.cpp #600462:600463 @@ -359,7 +359,7 @@ // // experimental: always use block devices on 2.6 kernels // - if( 0 && simpleKernelVersion() >= K3bVersion( 2, 6, 0 ) ) + if( simpleKernelVersion() >= K3bVersion( 2, 6, 0 ) ) return dev->blockDeviceName(); else if( dev->interfaceType() == K3bDevice::SCSI ) return dev->busTargetLun();
tnx!