Linux Tips for CDROM burning
-=> By Dave Bechtel <=-

This HTML document is released under the Gnu Public License (GPL);
Check The GNU site for details.

Additional license info:

The GNU Copyleft
Zoom to the bottom to see the GNU Public License for Linux Tips.

To contact me with questions, updates, etc: EMail me
I am actively soliciting interesting and useful command line examples.
Please include a detailed explanation of what your command does when you submit it. :)


= CD-R/W Burning Subsection:


  • NOTE: You are well advised to use CDRECORD from a virtual (text) terminal, NOT FROM A GUI - if your GUI hangs up (guess what - mine did) you're looking at a possible coaster unless you were using a CDRW. I have had occasions where I had to use ' blank=all ' because it was THAT screwed up. Fortunately the "all" got it back to a usable state.
     Dedicating a partition for CD images:
    	Assuming an 8.4 Gig drive with the following example partitions:
    	# fdisk -l /dev/hdc
    
    	Disk /dev/hdc: 255 heads, 63 sectors, 1027 cylinders
    	Units = cylinders of 16065 * 512 bytes
    	
    	   Device Boot    Start       End    Blocks   Id  System
    	/dev/hdc1   *         2       550   4409842+   5  Extended
    	/dev/hdc2           551       633    666697+  14  Hidden FAT16 <32M
    	/dev/hdc3           634      1027   3164805   83  Linux
    	/dev/hdc5             2       193   1542208+   b  Win95 FAT32
    	/dev/hdc6           194       512   2562336    b  Win95 FAT32
    	/dev/hdc7           513       514     16033+  83  Linux
    	/dev/hdc8           515       550    289138+  82  Linux swap
    


  • If making a dedicated EXT2FS partition to store raw images on:
    ' mke2fs -c -i 32768 -m 1 -v /dev/hdc2 ' Create EXT2 filesystem
    -c == Check for badblocks
    -i 32768 == Make sparse inodes for more accessible space
    -m 1 == Reserve only 1% space for superuser instead of the 5% default
    -v == Verbose output
    /dev/xxxx == Which drive and partition to create the fs on ( /dev/hdc2 == Example )


  • However, I prefer to use a hidden Win95 FAT32 (type '1b') or hidden Fat16 partition because you get more usable space:

    (Note: Some older versions of FDISK don't know about hidden W95 Fat32 - including Mandrake 5.3 FDISK.
    + Also, don't worry much about the ' <32M ' advisory - since it's hidden, Win won't complain about it.
    + If you're really worried, make it a hidden Fat32 instead of Fat16 -- it also doesn't have to be hidden
    + in case you want to share it with Windows, but be aware that this can do a number on your drive letters.)

    ' mkdosfs -s 64 -v /dev/hdc2 ' == Using these options on the above 650Meg partition gets you 666592 usable bytes under Fat16!
    -s 64 == 64 sectors per cluster
    (Since all you are making is one big file, more sectors per cluster is better. As of this writing, you can go up to 128, but I thought 64 was a good middle ground.)
    (DISCLAIMER: I haven't tried this particular one yet, but you might also want to attempt ' -r 1 ' as an option, to only allow 1 file in the filesystem. Might net you a few extra bytes.)


  • CDRECORD - Scanning the system bus for target IDs:
    ' cdrecord -scanbus ' == Scan all SCSI busses for suitable writing devices


     This is how my system looks:
    $ dmesg
    *** (snip)***
    
    hda: QUANTUM FIREBALL CX6.4A, ATA DISK drive
    hdb: WDC AC31200F, ATA DISK drive
    hdc: Maxtor 90845D4, ATA DISK drive
    hdd: YAMAHA CRW2216E, ATAPI CDROM drive
    ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
    ide1 at 0x170-0x177,0x376 on irq 15
    hda: QUANTUM FIREBALL CX6.4A, 6149MB w/418kB Cache, CHS=784/255/63, UDMA
    hdb: WDC AC31200F, 1222MB w/64kB Cache, CHS=621/64/63
    hdc: Maxtor 90845D4, 8063MB w/256kB Cache, CHS=16383/16/63, UDMA
    Floppy drive(s): fd0 is 1.44M
    FDC 0 is a post-1991 82077
    Configuring Adaptec (SCSI-ID 7) at IO:330, IRQ 11, DMA priority 5
    ppa: Version 2.03 (for Linux 2.2.x)
    ppa: Found device at ID 6, Attempting to use EPP 32 bit
    ppa: Communication established with ID 6 using EPP 32 bit
    scsi0 : Adaptec 1542
    scsi1 : SCSI host adapter emulation for IDE ATAPI devices
    scsi2 : Iomega VPI0 (ppa) interface
    scsi : 3 hosts.
      Vendor: NEC       Model: CD-ROM DRIVE:502  Rev: 2.3 
      Type:   CD-ROM                             ANSI SCSI revision: 02
    Detected scsi CD-ROM sr0 at scsi0, channel 0, id 1, lun 0
      Vendor: YAMAHA    Model: CRW2216E          Rev: 1.0g
      Type:   CD-ROM                             ANSI SCSI revision: 02
    Detected scsi CD-ROM sr1 at scsi1, channel 0, id 0, lun 0
      Vendor: IOMEGA    Model: ZIP 100           Rev: L.01
      Type:   Direct-Access                      ANSI SCSI revision: 02
    Detected scsi removable disk sda at scsi2, channel 0, id 6, lun 0
    scsi : detected 2 SCSI cdroms 1 SCSI disk total.
    Uniform CDROM driver Revision: 2.55
    sr1: scsi3-mmc drive: 16x/16x writer cd/rw xa/form2 cdda tray
    
    *** (snip) ***
    
    $ cdrecord -scanbus
    Cdrecord release 1.8a22 Copyright (C) 1995-1999 Jörg Schilling
    scsibus0:
                      0) *
                      1) 'NEC     ' 'CD-ROM DRIVE:502' '2.3 ' Removable CD-ROM
                      2) *
                      3) *
                      4) *
                      5) *
                      6) *
                      7) *
    scsibus1:
                    100) 'YAMAHA  ' 'CRW2216E        ' '1.0g' Removable CD-ROM
                    101) *
                    102) *
                    103) *
                    104) *
                    105) *
                    106) *
                    107) *
    scsibus2:
                    200) *
                    201) *
                    202) *
                    203) *
                    204) *
                    205) *
                    206) 'IOMEGA  ' 'ZIP 100         ' 'L.01' Removable Disk
                    207) *
    

  • CDRECORD - Common options:
    ' cdrecord -v[v] -eject \ Verbose, Eject when done...
    -multi \ Optional; create a multi-session CD or append to existing multisess
    (Omit this when writing the last in a series of sessions to the same disk, to close it.)
    speed=2 \ 2,4,6, etc (For writing, not reading) - Whatever you got
    .
    blank=fast (OR:) For CDRW, fast-blank media
    blank=all \ For CDRW, can take a long time, but ensures disk is totally wiped
    .
    dev=1,0,0 \ Where the CDR Burner device lives (This particular number only applies to my config (see SCANBUS, above))
    cdimage1.raw == Filename of raw image data to record to disk


  • MKISOFS - Make an ISO9660 filesystem suitable for disk burning

    ' mkisofs -R -o cdimage1.raw /dirtobkp ' == Use RockRidge extensions, and copy the contents of ' dirtobkp ' to the output file cdimage1.raw

  • CD-Recording on the fly:

    ' mkisofs -R /dirtobkp | cdrecord speed=2 -vv -eject dev=1,0,0 - '

  • To fast-blank a CDRW media and that's all:

    ' cdrecord -v -eject speed=2 blank=fast dev=1,0,0 '

  • CD-Recording on the fly, cwazy-style! (Copying a CDROM from a 2nd drive directly to the burner)

    The following command worked on a P233 with 32M of RAM, a 6X SCSI CDROM, and a 2-speed Yamaha CDRW, as root:
    ' dd if=/dev/cdrom2 | \ ' (continued - hit Enter)
    +'cdrecord -vv -eject speed=2 fs=6m dev=1,0,0 - ' DirectDump from cdrom2 (not a "mount"ed CDROM, mind you) and pipe to cdrecord with a 6Meg FIFO buffer.

  • HOWEVER... ' dd ' hung up my SCSI CDROM drive after that. You might want to try ' cat /dev/scd0 > cdimage1.raw instead, and then use cdrecord.


    Linux Tips - Tips for Linux/Unix users and newbies
    Copyright (C) 1999, 2000 David J Bechtel
    
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.