Summary: | fails to burn cds on sata writer using cdrecord because it prefers dev=X, Y, Z instead of dev=/dev/scd0 | ||
---|---|---|---|
Product: | [Applications] k3b | Reporter: | Francois Marier <francois> |
Component: | general | Assignee: | Sebastian Trueg <trueg> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ana, v13 |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Use device name instead of device numbers on kernel 2.6.x |
Description
Francois Marier
2006-02-23 17:06:26 UTC
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! |