|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Phlucks (phlucks
dqc.org)Date: Fri Dec 21 2001 - 00:22:25 CST
Creating a CD image from a CD,
Blanking/Erasing a CD-RW,
Burning a CD image with cdrecord with an ATAPI drive.
Please note all examples were done on OpenBSD 3.0-current
as of Nov 19th 2001.
I've been getting bits and pieces of this info for several
days and I've been getting lots of help from many people.
So I sat down, tried everything out and this is what worked
for me.
--Creating a CD image from a CD--
First get some info on your CD with disklabel.
--- prompt% sudo disklabel cd0 # /dev/rcd0c: type: ATAPI disk: Galactic Civiliz label: ations Gold flags: removable bytes/sector: 2048 sectors/track: 100 tracks/cylinder: 1 sectors/cylinder: 100 cylinders: 1121 total sectors: 112026 rpm: 300 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # microseconds track-to-track seek: 0 # microseconds drivedata: 03 partitions: # size offset fstype [fsize bsize cpg] a: 112026 0 ISO9660 # (Cyl. 0 - 1120*) c: 112026 0 ISO9660 # (Cyl. 0 - 1120*) ---
All iso9660 CDs have 2048 bytes per sector (I think), the total sectors is what we want here. So now we can do this...
--- prompt% sudo dd if=/dev/rcd0c of=image.raw bs=2048 count=112026 112026+0 records in 112026+0 records out 229429248 bytes transferred in 109.160 secs (2101760 bytes/sec) ---
I highly recommend outputting the image to a filesystem with soft updates enabled. It seems to go MUCH faster.
Now, to burn the CD on an ATAPI burner, such as my Plextor, first get your SCSI device info from dmesg.
--- cd0 at scsibus0 targ 0 lun 0: <PLEXTOR, CD-R PX-W1210A, 1.08> SCSI0 5/cdrom removable atapiscsi1 at pciide0 channel 1 drive 1 scsibus1 at atapiscsi1: 2 targets cd0(pciide0:1:0): using PIO mode 4, DMA mode 2 atapiscsi1(pciide0:1:1): using PIO mode 3, Ultra-DMA mode 2 cd1 at scsibus1 targ 0 lun 0: <TOSHIBA, CD-ROM XM-6702B, 1007> SCSI0 5/cdrom removable cd0(pciide0:1:0): using PIO mode 4, DMA mode 2 cd1(pciide0:1:1): using PIO mode 3, Ultra-DMA mode 2 ---
I've got two drives here, but the CD-R is obviously the one we are interested in and it says "scsibus0 targ 0 lun 0". That's easy enough.
We're going to use the raw device again, only with the SCSI information. See man cdrecord for details.
--- prompt% sudo cdrecord dev=/dev/rcd0c:0,0,0 speed=10 image.raw Cdrecord 1.9 (i386-unknown-openbsd3.0) Copyright (C) 1995-2000 Jrg Schilling scsidev: '/dev/rcd0c:0,0,0' devname: '/dev/rcd0c' scsibus: 0 target: 0 lun: 0 Using libscg version 'schily-0.1' Device type : Removable CD-ROM Version : 0 Response Format: 1 Vendor_info : 'PLEXTOR ' Identifikation : 'CD-R PX-W1210A' Revision : '1.08' Device seems to be: Generic mmc CD-RW. Using generic SCSI-3/mmc CD-R driver (mmc_cdr). Driver flags : SWABAUDIO Starting to write CD/DVD at speed 10 in write mode for single session. Last chance to quit, starting real write in 1 seconds. Track 01: Total bytes read/written: 229429248/229429248 (112026 sectors). cdrecord: Input/output error. prevent/allow medium removal: scsi sendcmd: retryable error CDB: 1E 00 00 00 00 00 status: 0x0 (GOOD STATUS) cmd finished after 0.016s timeout 40s ---
In this example, I'm burning to a high speed CR-RW. Thus the 10x speed.
To blank the CD-RW, we do something simular...
--- prompt% sudo cdrecord dev=/dev/rcd0c:0,0,0 blank=all speed=10 Cdrecord 1.9 (i386-unknown-openbsd3.0) Copyright (C) 1995-2000 Jrg Schilling scsidev: '/dev/rcd0c:0,0,0' devname: '/dev/rcd0c' scsibus: 0 target: 0 lun: 0 Using libscg version 'schily-0.1' Device type : Removable CD-ROM Version : 0 Response Format: 1 Vendor_info : 'PLEXTOR ' Identifikation : 'CD-R PX-W1210A' Revision : '1.08' Device seems to be: Generic mmc CD-RW. Using generic SCSI-3/mmc CD-R driver (mmc_cdr). Driver flags : SWABAUDIO cdrecord: Drive needs to reload the media to return to proper status. Starting to write CD/DVD at speed 10 in write mode for single session. Last chance to quit, starting real write in 1 seconds. cdrecord: Input/output error. prevent/allow medium removal: scsi sendcmd: retryable error CDB: 1E 00 00 00 00 00 status: 0x0 (GOOD STATUS) cmd finished after 0.016s timeout 40s ---
Now it's ready for another go. Notice where it says "...Drive needs to reload media"... It spit the CD out and sucked it back in at that point to "return to proper status". Go fig.
My hope is that this can/will be searched out to answer future questions.
-TimH
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]