
                               CD-Writing HOWTO
                                       
ߣWinfried Trper <winni@xpilot.org>
ߣƸǿ <wfkwong@net.polyu.edu.hk>

   v2.4.1, 16 December 1997
     _________________________________________________________________
   
   һļ LINUX д CDs ¶
     _________________________________________________________________
   
1. 

     * 1.1 汾 ( β )
     * 1.2 Suggested readings
     * 1.3 ʽ ( β )
     * 1.4 ֧ԮĹ¼
     * 1.5 ֧Ԯ
     * 1.6 ͨѶ̳
     * 1.7 ɵ
       
2. 趨 Linux ϵͳ¼

     * 2.1 趨 Linux 
     * 2.2 Ӳ devicefiles
     * 2.3 ȡ¼
       
3. ¼

     * 3.1 ¼Ƭ ()
     * 3.2 ¼ֹ
     * 3.3 ʽ
       
4. ⼰

     * 4.1 "¼ж"
     * 4.2 "fragmentation Ӱأ"
     * 4.3 "ǷԽӰ񵵴 UMSDOS ϵͳأ "
     * 4.4 "޷Կ˷ iso9660 ƣ"
     * 4.5 "ȡдֹ"
     * 4.6 "ϵͳѰSCSI-devices?"
     * 4.7 "ԽһһĹƣ"
     * 4.8 "Linux ɲԶȡ Joliet "
     * 4.9 "ÿдȡ"
     * 4.10 "ŶЩϵУ"
     * 4.11 "How to make bootable CD-ROMs?"
     * 4.12 "How to make CD-ROMs writable somehow?"
     * 4.13 "Is it possible to use several writers at once?"
     * 4.14 "Which media is the best?"
       
5. 

     * 5.1  Linux ²
     * 5.2 Error-message: No read access for 'dev=2,0'.
     * 5.3  DOS һʹ
     * 5.4 ¼ SCSI 
       
6. л (β)
     _________________________________________________________________
   
1. 

   кܶʹ Linux ¼ΪȽȶסûɫ
   ûҳӲϵѡֻҪһȷ趨֮ʹá
   CD-Writing HOWTO趨ϷϹԼһЩȤ
   ʽ
   
1.1 汾 ( β )

   Copyright Winfried Trper 1996,1997,1998,1999. All rights reserved.
   
   Redistribution and use, with or without modification, are permitted
   provided that the name of the author may not be used to endorse or
   promote products derived from this software without specific prior
   written permission.
   
   The author disclaims all warranties with regard to this document,
   including all implied warranties of merchantability and fitness for a
   certain purpose; in no event shall the author be liable for any
   special, indirect or consequential damages or any damages whatsoever
   resulting from loss of use, data or profits, whether in an action of
   contract, negligence or other tortious action, arising out of or in
   connection with the use of this document.
   
   Short: read and use at your own risk.
   
1.2 Suggested readings

   ַ [1]CD-R FAQ һ FAQ 춿հ׹¼¼
    
   
   ҪĹܹȡҪ Linux CD-ROM HOWTO Linux SCSI
   HOWTO  Linux Kernel HOWTO.
   
1.3 ʽ ( β )

   CD-ROM stands for Compact Disc Read Only Memory, a storage medium
   utilizing an optical laser to sense microscopic pits on a silver
   shimmering disk. The silver shimmering comes from an aluminized layer
   which is the carrier. The pits represent the bits of the information
   (in some way) and are so petite that some billions of them fit on the
   disc. Thus a CD is a mass-storage medium.
   
   The term CD-R is a short form of CD-ROM recordable and refers to a CD
   that doesn't have those "microscopic pits" on it's surface. Thus it's
   empty. Instead of the silver aluminium layer a CD-R has a special film
   (colored) into which "microscopic pits" can be burned in. This is done
   by giving the laser which normally only senses the pits a little bit
   more power so he burns the pits. This action can only be taken once on
   a CD-R, although you can leave out some areas for later writing,
   creating a so called multi-session CD.
   
   The CD-ROM rewritable (short: CD-RW) was developed to come around the
   limitation of CD-R media. Here the laser can not even burn pits into
   the media, but it can also melt the media back into it's original
   state. This is possible, because the laser does not really burn holes
   into the media - you do not see a puff of smoke while burning and no
   voice from above tells you "target destroyed". What the laser really
   does is to trigger a phase change, thus the name "phase change
   devices" for CD-RW-writers. An example for a very similar technique
   used in daily life is the cleaning car in an ice-hockey stadion:
   during the pauses of the game, the car drives over the ice and fills
   the scratches in the ice (-> bits containing some sort of information
   about the game... hehehe) with melted splinter.
   
   This HOWTO deals with the task of writing CD-Rs and CD-RWs. Welcome on
   board, captain.
   
1.4 ֧ԮĹ¼

   õһ꾡üڸ unix ҵϵͳͺб
   [2]http://www.guug.de:8080/cgi-bin/winni/lsc.pl.
   
   һܹ cdrecord ʹõͺŴдб
   
Acer:           CDRW 6206A
BTC:            BCE 621E (IDE)
Compro:         CW-7502, CW-7502B
Dysan:          CRW-1622
Elite:          Elite b444.41
Grundig:        CDR 100 IPW
Guillemot:      Maxi CD-R 4X/8X
HP:             SureStore 4020i, SureStore 6020i,
                C4324, C4325
                CD-Writer+ 7100, CD-Writer+ 7200i,
                CD-Writer+ 8100i, CD-Writer+ 8110i,
Hi-Val:         CDD-3610
JVC:            XR-W2001, XR-W2010, XR-W2042, R-2626
Kodak:          PCD 200, PCD 225, PCD 260, PCD 600
Matsushita:     CW-7502
Memorex:        CRW-620, CRW-1622
Microboards:    PlayWrite 2000, PlayWrite 4000RW, PlayWrite 4001RW
MicroNet:       MasterCD Plus 4x4, MasterCD Plus 4x6
Mitsubishi:     CDRW-226
Mitsumi:        CR-2401-TS, CR-2600 TE,  CR-2801 TE, CR-4801 TE
Nomai:          680.RW
OTI:            CDRW 965
Olympus:        CDS 615E, CDS 620E
Optima:         DisKovery 650 CD-R
OTI:            CDRW 965
Panasonic:      CW-7502, CW-7582
Philips:        CDD-521/10, CDD-522
                CDD-2000, CDD-2600, CDD-3600, CDD-3610
                Omniwriter 26, Omniwriter 26A
Plasmon:        CDR 480, CDR 4220, RF-4100, RF-4102, CDR 4400
Plextor:        CDR PX-24 CS, PX-412 C, PX-R412 C
                PX-R810Ti, PleXwriter 412C
Procom:         PCDR 4
Ricoh:          RO-1420C+, MP 1420C, MP 6200S, MP 6201S
Sanyo:          CRD-R24S
Smart and
Friendly:       CD-RW226, CD-R1002, CD-R1002/PRO, CD-R1004,
                CD-R2004, CD-R2006 PLUS, CD-R2006 PRO,
                CD-R4000, CD-R4006, CD-R4012
Sony:           CDU 920S, CDU 924, CDU 926S, CDU-928E,
                CDU 948S, CDRX 100E
Taiyo Yuden:    EW-50
TEAC:           CD-R50S, CD-R55S, CDR-55S
Traxdata:       CRW 2260, CDR 4120, CDRW 4260,
Turtle Beach:   2040R
WPI (Wearnes):  CDRW-622, CDR-632P
YAMAHA:         CDR-100, CDR 102, CDR-200, CDR-200t, CDR-200tx
                CDR-400, CDR-400c, CDR-400t, CDR-400tx, CDR-400Atx
                CRW-2260, CRW-2260t,
                CRW-4250tx, CRW-4260 t, CRW-4260 tx, CRW-4261,
                CRW-4416 S

     Table 1: CD-writers supported under Linux
     
   Ӳ֧ԮĻȻ Linux Ӱ񵵲Ҫ
    DOS Ӱ¼ CD-R 
   
1.5 ֧Ԯ

   Ĺ¼ CD-Rs ӲʽϸʽӲʽ
   ֧ԮµĹܣ
   
Supported Feature   cdwrite-2.1     cdrecord-1.6
------------------------------------------------
IDE/ATAPI           no              yes
Parallel Port       no              yes
CD-RW               no              yes
Multisession        only partial    yes

     Table 2: 
     
   cdwrite һɵֻΪѡʹ
   cdrecord 棬Ϊ֧Ԯ϶Ĺ¼н϶Ĺܡϸʽ
   ĿҪ֯ϵ ( һϵͳڹ )
   
Feature         mkisofs         mkhybrid
--------------------------------------------
ISO 9660        yes             yes
RockRidge       yes             yes
El Torito       yes             yes
HFS             no              yes
Joliet          no              yes

     Table 3: 
     
   ISO 9660 ϵͳ Extended-2 ϵͳֱ춣һ㽫д
   ھͲ޸ġISO 9660 ϵͳ¼
   
     * Ŀ¼ֻ 8 Ŀ¼ (ɹĸĿ¼ʼ) ( RockRidge Ϳ
       ͻ)
     * ֻ 32 Ԫ
     * 650 MB 
       
   RockRidge һ ISO-9660 ϵͳ֧ԮĿ¼ṹ
    DOS  Windows ¶ȡʱЩ춼ǲõġ
   
   El Torito һܹ¼졣ĸ˵ /ϵͳ
   Ҳ֧ԮԡԵ˵Ψ 忪ʼ 1.44 Mbyte 
   ƬӰ񡣻 /ϵͳӰƬ
   
   
   HFS  macintosh ȡڵϣڵ  HFS ϵͳ
   (  MacOS ԭϵͳ )
   
   Joliet ѳ Windows °汾 (95, 98, NT) ֪ʱ
   ûһֹܹ DOS  Windows 3.11 ֧Ԯ 
   
    2.8 ᵽ嶼һһг
   
1.6 ͨѶ̳

   μӿŶ (һ  ǵ), 
   cdwrite-request@other.debian.org ڵд subscribe
   
1.7 ɵ

   ļ°汾ɾ
   [3]http://www.guug.de/~winni/linux/.
   
2. 趨 Linux ϵͳ¼

   ɹ趨Ӳ Linux ϵͳŲݣ  cdrecord -
   scanbus 㿴һдװõб  ½ڵĿҪ趨
   Linux ϵͳʱ㣬ῴ µѶϢ
   
shell> cdrecord -scanbus
Cdrecord release 1.7a1 Copyright (C) 1995-1998 Jg Schilling
scsibus0:
          0) 'Quantum ' 'XP34300         ' 'F76D' Disk
          1) 'SEAGATE ' 'ST11200N        ' '8334' Disk
          2) *
          3) 'TOSHIBA ' 'MK537FB/        ' '6258' Disk
          4) 'WANGTEK ' '5150ES SCSI-36  ' 'ESB6' Removable Tape
          5) 'EXABYTE ' 'EXB-8500-85QUE  ' '0428' Removable Tape
          6) 'TOSHIBA ' 'XM-3401TASUNSLCD' '3593' Removable CD-ROM
          7) *
scsibus1:
        100) 'Quantum ' 'XP31070W        ' 'L912' Disk
        101) *
        102) *
        103) 'TEAC    ' 'CD-R55S         ' '1.0H' Removable CD-ROM
        104) 'MATSHITA' 'CD-R   CW-7502  ' '4.02' Removable CD-ROM
        105) *
        106) 'YAMAHA  ' 'CDR400t         ' '1.0d' Removable CD-ROM
        107) *

     Listing 1: Detecting devices on your SCSI-bus
     
    Jg Schilling ģڻῴһĸ ¼
   ȻǲֱܷһǷΪһд ڲƷ
   ʶпһΨдǿ д
   
2.1 趨 Linux 

   һ Linux Ŀ԰ܶʽ͹ܡԽЩʽ 
   ӰлԽǱģ飬ȻҪʱ Ž
   Сķǽزٵʽ ġһ
   IDE  HarddiskһIDE Harddisk ʽ ( Ҫ
   ģ )
   
   ִĹ¼SCSIIDE/ATAPI ƽвչʾ 
   趨 Linux ĺ֧Ԯ⼸ֹ¼ĵһ趨ѡ 
   ҵйص趨ĵڶǹ˵ĵ ģ
   
   
   Y ǺζӦð޷ġM ģζӦð
   ģ顣 Y/M ֮һյ趨ǧҪĶ
   ĶܳɹĵĻӡ
   
   ҪЩʽĺ ( Ǿ̬̬ )Կ
    /dev/devices ҪЩģ룬 'lsmod'Ҫ
   Щ ģ  Ļ'modprobe -l'Ҫģ鲻 ϵͳ
   Ҫ±ļװԲο Kernel-HOWTO  ±
   ġйģѶԲο Module-HOWTO
   
Sect.  Description                 Module   SCSI  IDE   PP
------------------------------------------------------------
BLOCK  Enhanced IDE/MFM/RLL...                     Y
BLOCK  IDE/ATAPI CDROM             ide-cd        M/N/Y
BLOCK  SCSI hostadaptor emulation  ide-scsi        M
BLOCK  Loopback device             loop       M    M     M

PARIDE Parallel port IDE device    paride               Y/M
PARIDE Parallel port ATAPI CD-ROMs                       M
PARIDE Parallel port generic ATAPI                       M
PARIDE (select a low-level driver)                       Y

SCSI   SCSI support                scsi_mod  Y/M  Y/M
SCSI   SCSI CD-ROM support         sr_mod    Y/M  Y/M
SCSI     Enable vendor-specific               Y    Y
SCSI   SCSI generic support        sg        Y/M  Y/M
SCSI   (select a low-level driver)            Y

FS     ISO 9660 CDROM filesystem   iso9660    Y    Y     Y
FS     Microsoft Joliet cdrom...   joliet     M    M     M

     Table 4: 
     
   ɹҵģ֮ᣬɽǵƼ /etc/modules
   Զ (kmod,kerneld)㲻϶Ļο Linux 
    е˵
   
   "SCSI hostadaptor emulation" ֮ǰİ汾ǽ "SCSI
   emulation" (  2.0.36 )ѡҪIDE/ATAPI 
   ʽ ģ顣ҪȻҪȡʹ SCSI Ĺʽ
   Ϊ 2.2 ϵ ĺѲͬʱʹ IDE  SCSI ʽͬһӲ
    ( ʹ 2.0.36 ĵĻ뿴µ˵ )
   
   Loopback device һѡԵĹܣܰ¼Ӱ֮ǰһ
   Ӱ񵵡
   
   ҪȡҪ ISO 9660 ϵͳ֧Ԯʽ
   RockRidge 졣ҪMS Joliet 죬ҪΪģ
   Ȼ
   
   κε㶼Ҫһͽ׵ʽͽָǸʽֱ
   Ӳ 幵ͨ SCSI ƽвкܶͽ׵ʽã뿴µ˵
   
   
   2.2 ϵͳرʾ
  
   ںİ汾 2.2.1 УҪͬʱCONFIG_SCSI_MULTI_LUN ide-scsi
   support ѡΪ ide-scsi СΣ
   ҶѺ Ϊ 2.2.5 
   
   һЩû˵ѱõ cdrecord  2.2 гͻ Linux ĵ
   ⡣ķ£
   
     * ٴα cdrecord Ӧ linux/include/scsi/sg.h 
       ֵᣬͿܽˡ Ϊ sg ʹ߽ƵģЩֵһ
       ҪͺеֵһС
     *  sg ʽȡ㹻ļ DMAJg
       Schillings FTP-site :
       [4]ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/alpha/ ȡ sg_buffer
       patch ⡣
       
   2.0 ϵеرʾ
  
   ں 2.0.31 ǰкܶܶȡһ
    2.0.36
   
    2.0.36 ϵİ汾ѡʽ(IDE or SCSI) Ǹ
   ATAPI-deviceʹáȷ˵Լ"SCSI emulation" ܵ
   ĺкںиض device ģ ( ϵͳ
   ǰ )Ĺ¼ devicefile /dev/hdb
   µľ hdb=ide-scsi
   
image=/boot/zImage-2.0.36
  label=Linux
  read-only
  append="hdb=ide-scsi"

     Listing 2: Example configuration for lilo (/etc/lilo.conf)
     
linux "Linux 2.0.36" {
        image=/boot/zImage-2.0.36
        cmdline= root=/dev/hda5 readonly hdb=ide-scsi
}

     Listing 3: Example configuration for chos (/etc/chos.conf)
     
2.2 Ӳ devicefiles

   㰲װбʽ, ºġӦᲿ
    Ҫйܡ
   
   [  devfs ʹߣͲҪֶ趨 device files Ĳ
   裬Ϊ devfs Ϊһе顣]
   
    /dev Ŀ¼Ȼһû loopback devices Ȼⲻ̫
   ûЩ devicesǾͻ᷽һЩ (뿴 3.5 ) 
   ǵĻῴ ls ָʾloop0-loop7
   
shell> cd /dev
shell> ls loop*
loop0 loop1 loop2 loop3 loop4 loop5 loop6 loop7

     Listing: devicefiles for loopback
     
   ûЩ device-files Ļ/dev/MAKEDEV-script 
   ǣ
   
shell> cd /dev/
shell> modprobe loop
shell> ./MAKEDEV loop

     Listing: commands to create loopback devices
     
   loop ģģָſԳɹִС 
   й loop-devicefiles ķͬӦ devicefiles
   (sg*, pg*, hd*, ...) ½ھͲȷ˵
   
  IDE/ATAPI ¼
  
   ATAPI  "SCSI  IDE-bus ִ"仰˵IDE/ATAPI 
   ¼˵ SCSI Э(һЩ)Ǽģɺһ SCSI
   ¼һ
   
    Linux ֻҪ"SCSI (hostadaptor) emulation" Ĺ
   Ϳ IDE ¼ͬ SCSI-devices ʹ
   ide-scsi ģĻͻӵһ SCSI ¼
   
  SCSI ¼
  
   ȷĹ¼ܹԵĻ/ϵͳ֧Ԯͱá
   ˼ ӵӲֲ֧Ԯ
   
   뽫 SCSI-drive ԵƽвϵĻҪر
   رĺʽַ
   [5]http://www.torque.net/parport/parscsi.html ȡøϡ
   
  һ SCSI devices
  
   /dev/sd*  /dev/sr* Щ devicefiles ȡ SCSI Ӳ SCSI 
    SCSI Ĵȡֻ block-oriented ϴ͡ʹ 
   ٺʺϴ洢¼һӸӵ 
   飬block-oriented ϴ򵥡Ҫʹ sd*  sr* devices 
   ǬͿ٣һµװ  generic SCSI-devices Ϊ
    SCSI ӲĲ͸ generic devices ɶû ض
   ĿǾͽ generic
   
   ҪЩ deviceԵ /dev Ŀ¼
   
shell> cd /dev
shell> ls sg*
sg0  sg1  sg2  sg3  sg4  sg5  sg6  sg7

   ûЩ device-files е script the
   /dev/MAKEDEV-script:
   
shell> cd /dev/
shell> ./MAKEDEV sg

  ƽвĹ¼
  
   ԲûⷽĽ 뿴
   [6]http://www.torque.net/parport/paride.html 㱾ĵ
   /usr/src/linux/Documentation/paride.txt.
   
2.3 ȡ¼

   ҵһϵ¼
   [7]http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling
   /private/cdb.html.The CD building project for UNIX
   
  й
  
   Ҫ³ʽ֮һԭͣ
   
     [8]ftp://tsx-11.mit.edu/pub/linux/packages/mkisofs/ (mkisofs)
     
     [9]ftp://ftp.ge.ucl.ac.uk/pub/mkhfs (mkhybrid)
     
   Ĺ¼ͺŶҪ֮һʽԭд룺
   
     [10]ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/ (cdrecord)
     
   ǧҪmkisofs ɵ˵˵Ҫ cdwrite 汾 1.5 ֻҪ
   cdrecord ͺˡע⣺cdrecord  mkiosfs һЩӵĹܣ
   
  Graphical user interfaces (optional)
  
   Front-ends  Linux ֻ front-endsȻҪװй
    һϺõĽѡ
   
   X-CD-Roast һ Linux ¼ĳʽ cdrecord 
   mkisofs һĽС
   
     [11]http://www.fh-muenchen.de/home/ze/rz/services/projects/xcdroast
     /e_overview.html
     
   BurnIT һ cdrecord, mksiofs and cdda2wav-0.95  JAVA front-end 
   ʹΪһ Unix ƽ̨Ĺ¼װȡã
   
     [12]http://sunsite.auc.dk/BurnIT/
     
3. ¼

     "If to smoke you turn I shall not cease to fiddle while you burn."
     (Roman emperor Nero about burning his own classic-CDs, AD64. He
     misunderstood it completely.)
     
    Linux ¼裺
   
     * ʡ ( ֻȫ ) װһЩرʽĵ
     * cdrecord ЩдС
       
   һ»꾡¼ϼֹĲ衣
   
3.1 ¼Ƭ ()

   ⣬ռʱܻԤеĳʴһҪǵ 
   ⣬ڲҵĵдԭ¼¼Ĺ
   
   <!- дʱڿŵλдϣֻҪûйرչ
    һ򣬱multi-session дϣҲ
   ȱ㣬ǻ˷ѵĿ¼Ŀռ䡣 --> ҪǹһĿռ
   ISO-9660-ϵͳϣͨ MBһֻ650MBĹ
   ʵֻԼ620MBá
   
  Ӱ
  
   κһִý壬ƬӲֻʹǰȽ ϵ
   ͳDOSԼʽʹӵһϵͳϵͳ ֯
   ϲýϵĵ
   
   һʽӲָĹ߶дһյĵϵͳӲָ
   У ȻᱻϺʹʱųдСһֻ¼
   ֻ дһΣдһյĵϵͳͻᱻʽ  
   Զ һֻյĹдĹһģΪ㲻ܸı
   arbritary sectors  ֻݡ
   
   Ҫһܹһ߳дһ߽ϵͳ У⹤߽
    mkisofs¾⹤ߵʹ ӣ
   
mkisofs  -r   -o cd_image   private_collection/
              `---------'   `-----------------'
                   |               |
                д      Ŀ¼

   '-r' ѡ趨ڹеĵΪڿɶͿ Rock Ridge 졣 
   ܶҪĶʹǰ϶֪Լʲᡣ (ʾû
   '-r' ѡĻǸ mount-point ͻ private_collection!)
   
   mkisofs ᳢ԽеתΪ DOS 8.3ʽȷߵļԡ 
   ͻ (ͬͬ)ʱͻڵʹֶйظõ 
   Ͼͻ STDERR (ͨөĻ) ʾ Ҫģ Linux Զ
   ῴ 8.3 ʽĵΪ Linux ʹ Rock Ridge е
   ϶  Rock Ridge  (ʹȨޣƣȵ)
   
   ܻΪʲ mkisofs ֱддС 
   ԭ
   
     * mkisofs д
     * Ҫ¼ǰһӰ񵵡
     * ĻɿЩ (½ 4.).
       
   潲¼һֻ
   
   Щ˿ܻ벻罨һķָдӰԴ浵 Ҳͬ
   ͬΪд뵽ķָ(ɴִ)Ļ ʧ
    Linux ϵͳ (ҾԹ)ߣɴŵ ռ˷Ϊ
   ӰһʱԵϣ¼ɾ Ӳ
   Խʡɾһ 650 MB ʱ䡣 ( һķָ
   ʡɾӰ񵵵ʱ䡣)
   
  ԹӰ
  
   Linux Ժƴŵָ㽫ϡһܺõĹ 
   Ŀ¼ú͵ʹȨǲҪȻڵĹܱˣ 
   ¼ȻǺܷʱģҪһٵĲԡ
   
   Ҫ Ӱ  /cdrom µָ
   
mount -t iso9660 -o ro,loop=/dev/loop0 cd_image /cdrom

   ڿ /cdrom ¼ĵ  ڵλñ 
   еλáҪжӰ񵵣ֻҪ umount /cdrom (棺
   ʹ Linux  2.0.31 ǰİ汾пܿ ļ
   ʹýµĺġ The option -pad for cdrecord applies to audio-CDs
   only and the optional option -pad for mkisofs requires a patch, which
   is as much work to apply than to upgrade to a bug-free Linux-kernel.)
   
   ע:
   
     ȽϾɵ mount ǲܴ loopback-devicesʹþɵ mount
     Ļʱ Linux ˡ
     
     кܶ˶һЩȡ mout ߵ 
     mini-HOWTO СҶһһܾ Linux ׼ ˾ɰ汾
     mountһ  Linux ׼ǲ
     һ
     
     ҽйƲ Linux ׼ϣ mini-HOWTO
     ͻúܳĶ
     
  дӰ񵽹
  
   û̫ĶҪδԹָʱ
   
cdrecord -scanbus

   ָĿдǹǸ SCIS-device С ĳ
   ԷѾɾ (ǹ generic SCSI devices   (naming
   scheme) Σշ)
   
   ڽһָǰ£ΪдĻ Ǻ
   ٣Ҫġˣ¼ Ĺǲ
   ϵģ¼ʧܡɾһܴĵ ͻж
   磺ɾһ 650 MB Сʱ ıҪӲԼ 650,000
    blocks (ĵϵͳ 1k һ block Ļ) Ҫܳʱͺ
   ܻӳټ 롣һܿĵϿʣҳ
    Ӱ¼
   
   עûһ¼λúܷ ܸŵĵ
   ν¼Ժε𶯻ײʹ ¼Ĺܵƻ
   
   ׼õĻµָ
   
shell> SCSI_BUS=0   # taken from listing 1 "scsibus0:"
shell> SCSI_ID=6    # taken from listing 1 "TOSHIBA XM-3401"
shell> SCSI_LUN=0
shell> cdrecord -v speed=2 dev=$SCSI_BUS,$SCSI_ID,$SCSI_LUN \
                   -data  cd_image

# ͬһЩ
shell> cdrecord -v speed=2 dev=0,6,0  -data  cd_image

   ΪӿɶԣдѶУ SCSI_BUS,
   SCSI_ID, SCSI_LUNѡ -data ¼Ϲ õġ
   
   ʹ cdrecord д CD-RWһҪ "blank= . . ." ɾ
   оݡ뿴 man-page ѧϰʲ᷽ CD-RW ݡ
   
   һ 400 Mhz ԣԽ mkisofs ֱ cdrecord
   У
   
shell> IMG_SIZE=`mkisofs -R -q -print-size private_collection/`
shell> mkisofs -r  private_collection/  \
|cdrecord  speed=2  dev=0,6,0
            tsize=${IMG_SIZE}s  -data  -
#       don't forget the s --^         ^-- read data from STDIN

   һָֻһ¹Ӱݲûʵ; (Ҫ
   cdrecord-distribution е mkisofs ſʹָ)Ŀд 
   ܲҪ֪Ӱ񵵵ĴС㲻Ҫָ ĴС
    tsize-parameter ݸ cdrecord (Ǵ  IMG_SIZE 
   )ָ pipe  mkisofs  cdrecord ָ
   
3.2 ¼ֹ

   Ҫ¼һֹֻĲ¼ϹĲ趼ͬС졣 ҪĶ
   ֮һֹ죬Щ֯ Ӱ
   ¼ʮĻҪʮӰ һֱǹӰĸʽ
   ISO-9660 (Ҫĸ)  "16 bit stereo samples in PCM
   coding at 44100 samples/second (44,1 kHz)".
   
   һ sox ԽֵתΪĸʽ ÷Ǻܼ
   ֱӣ
   
shell> sox  killing-my-software.wav  killing-my-software.cdr

   ָὫ killing-my-software ׸ WAV ʽתΪ CDR ʽ 뿴
   man-page ȡøй sox ȷϵĸʽ쵵Ϊת Ҫ
   Ӳռ䣬 cdrecord ڽ֧Ԯ WAV  AU ʽˡ 
   ֵ .wav  .au (and the samplerate "stereo, 16 bit, 44,1 kHz")
   Ļ㲻Ҫת
   
    -audio ѡcdrecord ͻὫӰ¼졣ѡ
   ͬ¼һһ (зرҪ)ָͬĲ
   Ƕȡֵͬʽ
   
shell> cdrecord -v speed=2 dev=0,6,0  -audio  track1.cdr track2.cdr...
shell> cdrecord -v speed=2 dev=0,6,0  -audio  track1.wav track2.wav...
shell> cdrecord -v speed=2 dev=0,6,0  -audio  track1.au  track2.au...

   һر MPEG-3  "mpg123 -s track1.mp3 >
   track.cdr" תҪĸʽһ "8hz-mp3" ת WAV
   ʽ
   
   ¼ֹĻ֮ᷢ 2 ӳ١ 
   д֧Ԯ "disc at once" (DAO) ĻԳµ
   cdrecord һ⡣
   
3.3 ʽ

   û̫Ҫ˵ֻʾʹ -data͡-audio ѡԴﵽ¼
   
   
cdrecord  -v dev=0,6,0  -data  cd_image  -audio  track*.cdr

4. ⼰

4.1 "¼ж"

   𰸣Ҫ¼ˡͨµͺŶ 1MB ࣬
    ֧ 1-2 ûϡõ̻򿴿Ӳ
   ֲᡣ
   
   ЩϻĴС㶼Ҫ֤һʱ 300 kb/s  600
   kb/s ľ 
   
   һЩӲܼĹ locate-Ͽ⡣  maxium flow rate Ϳ϶
   Ĺ¼ǰ cron at  anacron һ
   зִЩ
   
   һ棬Щ˵һһ¼ûκ⡣ ȷ
   ҪһܿĻʵ顣
   
4.2 "fragmentation Ӱأ"

   Fragmentation ͨӰԺ pathological
   cases of fragmentation ӲԼ 100 kbyte/secondǧ
   Ҫ:-)
   
   ǵģӲ fragmented ʹáԽfragmentedǵ
   ϵͳԽ  10%  20% Ŀռ䣬¼ûˡ
   
   㲻϶ĻԿʱѶϢͿԿĵϵͳм
   ŵռ fragmentation İٷݱȡһǳΣյָ
   
shell> e2fsck -n  /dev/sda5        # '-n' is important!
[stuff deleted - ignore any errors]
/dev/sda5: 73/12288 files (12.3% non-contiguous)

   дŵռƺǳɢ  ֻ 73 ǳСĵ
   ϵͳУֻһٵֵ
   
   һʵԵĹ e2defrag  defragment
   extended-2 ϵͳڵİ汾˽˻лǲȶ
   defragment  ĵϵͳȱ (ã) restore ݣȻ
   Ὠһµĵϵ ͳ (ƻе)  restore ݡ֮
   ȫļɡ
   
4.3 "ǷԽӰ񵵴 UMSDOS ϵͳأ "

   ԡֻһϵͳǲܿɿͿ¼ģ network
   filesystem (NFS)
   
   һ (486/66) PC ʹ UMSDOS Linux  DOS/Win ŵ
   ռ䣬ⲿ 486 ר¼õġ
   
4.4 "޷Կ˷ iso9660 ƣ"

   ԡκһϵͳ¼㲻Ĳϵͳ
   ʹ ֻ
   
   ˣ
   
     * һ 650 MB Ŀյ
       
dd if=/dev/zero of="empty_file" bs=1024k count=650

     * ȻὨһextended-2 ϵͳ֮
       
bash> /sbin/mke2fs  empty_file
empty_file is not a block special device.
Proceed anyway? (y,n) y

     * loopback-devices 
       
mount -t ext2 -o loop=/dev/loop1 empty_file /mnt

     * дһЩ /mnt Ȼж
     *  cdwrite  cdrecord  ( ڸòǿյ ) ǲ
       iso9660-Ӱ
       
   /etc/fstab һڸֻĻҪȡֻ
   ļ飬磺
   
/dev/cdrom  /cdrom  ext2  defaults,ro  0 0

   һ "Ҫ dumps" ڶ "ʱҪ" (
   fsck ڵĴ ) 
   
4.5 "ȡдֹ"

   жµĽ "cdpranoia" µط
   
     [13]http://www.mit.edu/afs/sipb/user/xiphmont/cdparanoia/index.html
     
   Գ "cdda2wav"  "sox" ϣ sunsite 
   mirror ȡ
   
     [14]ftp://sunsite.unc.edu/pub/Linux/apps/sound/cdrom/cdda2wav0.71.s
     rc.tar.gz
     
     [15]ftp://sunsite.unc.edu/pub/Linux/apps/sound/convert/sox-11gamma-
     cb3.tar.gz
     
   cdda2wav ɹץȡһض(һ)Ȼ ת
   Ϊ .wav  sox Խ wav תֹcdda ʽ Ȼ
   cdwrite ¼ڹϡ ʹ°汾cdrecord 㲻Ҫ
   ʹ sox Ϊ cdrecord ֧Ԯ .au  .wav 
   
4.6 "ϵͳѰSCSI-devices?"

   drivers/scsi/scsi.c Ҫϡ
   
/*
 * Usage: echo "scsi add-single-device 0 1 2 3" >/proc/scsi/scsi
 * with  "0 1 2 3" replaced by your "Host Channel Id Lun".
 * Consider this feature BETA.
 *     CAUTION: This is not for hotplugging your peripherals. As
 *     SCSI was not designed for this you could damage your
 *     hardware !
 * However perhaps it is legal to switch on an
 * already connected device. It is perhaps not
 * guaranteed this device doesn't corrupt an ongoing data transfer.
 */

   Please note that this should only be used if your add SCSI-devices at
   the end of the chain. Inserting new SCSI-devices into an existing
   chain disturbs the naming of devices (directory /dev) and may destroy
   the complete content of your harddisk.
   
4.7 "ԽһһĹƣ"

   ԡҪעȡʱκεĴдʧ
   ܡ
   
   һһдһΨµָ
   
cdwrite -v -D /dev/sgc --pad -b  $(isosize  /dev/scd0) /dev/scd0
or
cdrecord -v dev=3,0 speed=2 -isosize /dev/scd0

   Դ/dev/scd0 ȡȻֱӾ/dev/sgc дС
   
   ڶûһΨҪÿдȡ
   
dd if=/dev/scd0 of=cdimage bs=1c count=`isosize  /dev/scd0`

   ָͬ mkisofs õἰķ µĹ
   עǲֹ
   
4.8 "Linux ɲԶȡ Joliet "

   ԡµĺ (2.0.36 ) ֧Ԯ joliet ʽҪ
   /etc/fstab ʹ iso9660  joliet ѡҪȡøϣԿ
   [16]http://www-plateau.cs.berkeley.edu/people/chaffee/joliet.html.
   
4.9 "ÿдȡ"

   ͬʹͨΨһûκεرעҪʹ
   scd-devices (Ψ) ȡ±/etc/fstab еġ
   
/dev/scd0  /cdrom  iso9660  ro,user,noauto  0  0

4.10 "ŶЩϵУ"

    bzip2 ȡѹ gzip  pkzipʡ30%Ĵŵռ䡣
   µط
   
     [17]http://www.muraroa.demon.co.uk/
     
   Instead of writing a true audio-CD, you can optionally convert your
   wav-audio-files into mp3-audio-files and store them on a ISO-9660
   filesystem as regular files. Usually MPEG III gives you a compression
   of 1:10.
   
   Of course, most CD-players are not able to read files... this is the
   drawback. On the other hand, why not running the music for your next
   party from harddisk? 18 Gbyte are enough for 3000-4000 titles. :-)
   
   A software MPEG III-encoder is available from
   
     [18]http://www.stud.ifi.uio.no/~larsi/other/8hz-mp3-cheng.tar.gz
     
   A MPEG III-player is available from
   
     [19]http://homepages.uni-tuebingen.de/student/michael.hipp/mpg123/
     
   For recorded speech, you may want to try to reduce its size using
   shorten or "GSM lossy speech compression":
   
     [20]ftp://svr-ftp.eng.cam.ac.uk/pub/comp.speech/
     
     [21]http://kbs.cs.tu-berlin.de/~jutta/toast.html
     
4.11 "How to make bootable CD-ROMs?"

   You must have an 1.44 MB bootable floppy-disk. Create an exact image
   of this floppy-disk by issuing the command
   
dd if=/dev/fd0 of=boot.img bs=18k

   Place this floppy-image into the directory holding the collection of
   your files (or into a subdirectory of it, just as you like). Tell
   mkisofs about this file with the option '-b' and also use '-c'. For
   details read the file README.eltorito in the mkisofs-distribution.
   
   An interesting application for a custom bootable CD is as a virus-safe
   DOS- or Windows-system. It saves you the money for the harddisks (if
   you have a network and use samba to put the user-data on a
   fileserver). However, this is purely theoretical as nobody reported an
   actual recipe to me.
   
   Some details about the bootable RedHat CD-ROM is available from
   [22]http://www.channel1.com/users/rodsmith/rhjol-technical.html.
   
4.12 "How to make CD-ROMs writable somehow?"

   There is an overlay-filesystem available for Linux, which is mounted
   over the CD-ROM and intercepts all writing operations. New and
   modified files are stored elsewhere, but for the user it looks like
   the CD-ROM is modified. For more information, see
   [23]http://home.att.net/~artnaseef/ovlfs/ovlfs.html.
   
   If that is not enough for your needs: wait for the UDF-filesystem to
   be supported by Linux or help developing it (see
   [24]http://trylinux.com/projects/udf/.
   
4.13 "Is it possible to use several writers at once?"

   Yes. However, it has been only tested with two writers yet. And you
   need a kernel patch for more buffers in the SCSI-generic driver (
   [25]ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/alpha).
   
4.14 "Which media is the best?"

   The german computer magazine "c't" had a list of tips regarding the
   blank CD-Rs in their november 1996 issue:
   
     * "No-name" discs are generally not of highest quality and should
       better not be used.
     * If a recordable CD is defective, this is likely to apply to the
       whole batch (if you bought more than one at a time); maybe you are
       lucky and can at least use the first 500MB of such CD-Rs ...
     * Don't touch the CD-Rs at their shimmering side before writing.
       
5. 

   Always remember, that you can still use corrupt CD-ROMs as coasters.
   :-)
   
5.1  Linux ²

   ȼĿдܲϵͳʹ
   
   Ȼµ飺
   
     * ܷȷ SCSI device?
     * ʽܷȷĿд
     * ɲø͵¼
       
   ĿдĲϵͳʹõĻܿӲ ͻ
   һӲ
   
   If it works under the other operating system and you use loadlin to
   boot Linux, then that is your problem. Loadlin makes a warm-boot with
   most of the hardware already initialized and that confuses the
   Linux-kernel.
   
5.2 Error-message: No read access for 'dev=2,0'.

   Under Linux, some versions of the C-library are incompatible (buggy),
   so that an application linked against one version will not work with
   another. An example for an error triggered by pre-compiled binaries is
   the following:
   
[root@Blue /dev]# cdrecord -eject dev=2,0
cdrecord: No such file or directory. No read access for 'dev=2,0'.

5.3  DOS һʹ

   ʹ Linux  DOS °װ趨 SCSI ʽһѵ 
    Linux ҲǺܸӵ𣿹
   
5.4 ¼ SCSI 

   ͨЩµ״ɵ
   
     * SCSI bus ȱdis-/reconnect 
     * Ӳɢ
     * Ӳ (Ӧÿ5.1. ķ)
       
   ںܶ SCSI devices Ҫ SCSI bus  dis- and reconnect Լ
   ȱܵĻЩд¼ʱ⡣
   
   NCR 53c7,8xx SCSI ʽԤܣȼһ£
   
NCR53c7,8xx SCSI support                  [N/y/m/?] y
   always negotiate synchronous transfers [N/y/?] (NEW) n
   allow FAST-SCSI [10MHz]                [N/y/?] (NEW) y
   allow DISCONNECT                       [N/y/?] (NEW) y

6. л (β)

   Alan Brown <alan@manawatu.net.nz>
          
   Art Stone <stone@math.ubc.ca>
          had the idea to put non-ISO-9660 filesystems on a CD
          
   Bartosz Maruszewski <B.Maruszewski@zsmeie.torun.pl>
          reported spelling mistakes
          
   Bernhard Gubanka <beg@ipp-garching.mpg.de>
          noticed the need of a recent version of mount to utilize the
          loopback device
          
   Robert Doolittle <bob.doolittle@sun.com>
          good arguments for dropping cdwrite from the HOWTO
          
   Brian H. Toby
          polished the wording.
          
   Martin Schulze <joey@Infodrom.North.DE>
          gave information about the cdwrite-mailinglist
          
   Dale Scheetz <dwarf@polaris.net>
          helped improving the section about creating the cdimage.
          
   Don H. Olive <don@andromeda.campbellsvil.edu>
          URL of the mkhybrid tool
          
   Erwin Zoer <ezoer@wxs.nl>
          
   Gerald C Snyder <gcsnyd@loop.com>
          tested writing of an ext2 CD-ROM (see 4.4)
          
   Janne Himanka <shem@oyt.oulu.fi>
          pointer to kernel patch to read Joliet CD-ROMs
          
   Joerg Schilling <schilling@fokus.gmd.de>
          information about cdrecord
          
   Jos van Geffen <jos@tnj.phys.tue.nl>
          noted the problem in 4.9.
          
   Markus Dickebohm <m.dickebohm@uni-koeln.de>
          
   Jesper Pedersen <jews@imada.ou.dk>
          
   Pierre Pfister <pp@uplift.fr>
          helped to develop the recipe on 1:1 copies.
          
   Rick Cochran <rick@msc.cornell.edu>
          hint about dis-/reconnect disabled by default in the ncr driver
          
   Stephan Noy <stnoy@mi.uni-koeln.de>
          information and experience about writing audio-CDs
          
   Stephen Harris <sweh@mpn.com>
          contributed hint about writing audio-CDs
          
   The Sheepy One <kero@escape.com>
          suggested using defective CD-ROMs as coasters for drinks
          
   Martti.Rahkila@hut.fi
          Reported problem with pre-initialized writers when booting via
          loadlin.
          
   End of the Linux CD-Writing HOWTO

References

   1. http://www.fadden.com/cdrfaq/
   2. http://www.guug.de:8080/cgi-bin/winni/lsc.pl
   3. http://www.guug.de/~winni/linux/
   4. ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/alpha/
   5. http://www.torque.net/parport/parscsi.html
   6. http://www.torque.net/parport/paride.html
   7. http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdb.html
   8. ftp://tsx-11.mit.edu/pub/linux/packages/mkisofs/
   9. ftp://ftp.ge.ucl.ac.uk/pub/mkhfs
  10. ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/
  11. http://www.fh-muenchen.de/home/ze/rz/services/projects/xcdroast/e_overview.html
  12. http://sunsite.auc.dk/BurnIT/
  13. http://www.mit.edu/afs/sipb/user/xiphmont/cdparanoia/index.html
  14. ftp://sunsite.unc.edu/pub/Linux/apps/sound/cdrom/cdda2wav0.71.src.tar.gz
  15. ftp://sunsite.unc.edu/pub/Linux/apps/sound/convert/sox-11gamma-cb3.tar.gz
  16. http://www-plateau.cs.berkeley.edu/people/chaffee/joliet.html
  17. http://www.muraroa.demon.co.uk/
  18. http://www.stud.ifi.uio.no/~larsi/other/8hz-mp3-cheng.tar.gz
  19. http://homepages.uni-tuebingen.de/student/michael.hipp/mpg123/
  20. ftp://svr-ftp.eng.cam.ac.uk/pub/comp.speech/
  21. http://kbs.cs.tu-berlin.de/~jutta/toast.html
  22. http://www.channel1.com/users/rodsmith/rhjol-technical.html
  23. http://home.att.net/~artnaseef/ovlfs/ovlfs.html
  24. http://trylinux.com/projects/udf/
  25. ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/alpha
