
                               CD-Writing HOWTO
                                       
@̡GWinfried Trmper <winni@xpilot.org>
Ķ̡GIj <wfkwong@net.polyu.edu.hk>

   v2.4.1, 16 December 1997
     _________________________________________________________________
   
   o@Bzb LINUX ؼg CDs ƨE
     _________________________________________________________________
   
1. ²

     * 1.1 n ( oqĶ )
     * 1.2 Suggested readings
     * 1.3 W ( oqĶ )
     * 1.4 䴩пN
     * 1.5 䴩S
     * 1.6 qT׾
     * 1.7 io
       
2. ]wA Linux tΨӿN

     * 2.1 ]w Linux ֤
     * 2.2 wM devicefiles
     * 2.3 onӿN
       
3. N

     * 3.1 NФ (¸)
     * 3.2 N֥
     * 3.3 VX
       
4. `ݰDε

     * 4.1 "N{ǦhӷP"
     * 4.2 "fragmentation |_vTXOH"
     * 4.3 "O_iHNмvxsb UMSDOS ɮרtΤOH "
     * 4.4 "LkiHJA iso9660 H"
     * 4.5 "ŪμgJ֥СH"
     * 4.6 "ҰʨtΫ˧MSCSI-devices?"
     * 4.7 "iHi@@нƻsH"
     * 4.8 "Linux iiHŪ Joliet СH"
     * 4.9 "˥ΥigоŪСH"
     * 4.10 "˩hǸƨФH"
     * 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. DѨM

     * 5.1 b Linux U
     * 5.2 Error-message: No read access for 'dev=2,0'.
     * 5.3 b DOS @ϥ
     * 5.4 NL{ SCSI ~
       
6.  (oqĶ)
     _________________________________________________________________
   
1. ²

   {bܦhHϥ Linux ӿNЬO]íwMeCSŦeM
   SXnwզXxCunA@T]wnNϥΡCo
   CD-Writing HOWTOF˳]wA˱NƩWФWHΤФ@Ǧ쪺
   {C
   
1.1 n ( oqĶ )

   Copyright Winfried Trmper 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

   o} [1]CD-R FAQ ئ@몺 FAQ ťեСAпNMNЩ
   ݪn C
   
   nOAЯŪСAA_Xn Linux CD-ROM HOWTO Linux SCSI
   HOWTO M Linux Kernel HOWTO.
   
1.3 W ( oqĶ )

   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 䴩пN

   AiHboرo@ӸԺɥiΤΤiΦbU unix @~tΪC
   [2]http://www.guug.de:8080/cgi-bin/winni/lsc.pl.
   
   HUO@ӯb cdrecord UϥΪgCG
   
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
     
   pGAw󤣳Q䴩ܡAAMiH Linux ӫإߥмvɤLAݭn
    DOS nӱNoӥмvɿN CD-R E
   
1.5 䴩S

   {buΧ@N CD-Rs GwXʵ{MƮ榡ơCwXʵ{
   䴩HU\G
   
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 O@ªnAboشXuLOFӤwCШϥ
   cdrecord ӥNA]䴩hпNMh\CƮ榡
   ƪتOn´ФW ( @ɮרtΦbФW )
   
Feature         mkisofs         mkhybrid
--------------------------------------------
ISO 9660        yes             yes
RockRidge       yes             yes
El Torito       yes             yes
HFS             no              yes
Joliet          no              yes

     Table 3: 
     
   ISO 9660 ɮרtΩM Extended-2 ɮרtΪ̤jObA@ANƼgJ
   ФN@קCISO 9660 ɮרtΪHUXӡG
   
     * ؿu঳ 8 Ӥlؿ (ѥЪڥؿ}l_) ( RockRidge Ni
       H}oӭ)
     * ɦW̪u঳ 32 Ӧr
     * 650 MB eq
       
   RockRidge O@ӯO ISO-9660 ɮרtΤ䴩ɦWθ`hؿc
   CAb DOS  Windows UŪЮɳoǩOiΪC
   
   El Torito O@ӯN}ЪCAӤHq 򥻿J/Xt
   ]䴩oӯSʡCʲaAаŪO }l 1.44 Mbyte tѧA
   ѵnϤϽLvC򥻿 J/Xtη|oӼv@nϤҰʥ
   C
   
   HFS  macintosh ŪФơApGФ O HFS ɮרtΪ
   ܡE( oO MacOS ɮרt )C
   
   Joliet ɦWa Windows s (95, 98, NT)Eڧ@ ̩ҪAȮ
   S@ؤuO DOS  Windows 3.11 䴩 WC
   
    2.8 ⴣ쪺n鳣@@CXC
   
1.6 qT׾

   pGAQѥ[}oζ (@ӥD U L̪), ql
   cdwrite-request@other.debian.org MbqlegW subscribeC
   
1.7 io

   o󪺳̷sig`boo
   [3]http://www.guug.de/~winni/linux/.
   
2. ]wA Linux tΨӿN

   pGA\]wAwMA Linux tΪlA RO cdrecord -
   scanbus |Aݨ@ӥigJ˸mCC o `تOnb]wA
   Linux tήɾɤާAA]̫A|ݨ pUTG
   
shell> cdrecord -scanbus
Cdrecord release 1.7a1 Copyright (C) 1995-1998 Jrg 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
     
   oӨҤlO Jrg Schilling VѪAA{b|ݨ@@|ӥiN C
   MA{bOO@ӥоO_@ӥigJ ALAiHb~
   ѧOݥXO@ӰŪBigάOi gоC
   
2.1 ]w Linux ֤

   @ Linux ֤ߥiH]tܦhXʵ{M\CAiHNXʵ{ sĶi
   ֤߼vΪ̧AiHN̽sĶҲաAMݦݭnɭ ~N̸J
   ߤCӫĳkONi֪Xʵ{sĶi ߡC|ҡApGA@
   IDE  HarddiskAA@wNIDE Harddisk Xʵ{sĶi֤ߤ ( ns
   ĶҲ )C
   
   {sTпNGSCSIAIDE/ATAPI M~mC|iܥX 
   ]w Linux ֤ߨӤ䴩oXإпNC檺Ĥ@CO]w AAi
   Hbo˧즳]wC檺ĤGCO\໡C檺ĤTCO ҲզW
   C
   
   Y NOMNۧAӧoө~J֤ߡCM NҲթMNۧAӧ⥦
   sĶҲաC Y/M NAiHb̤ܨ@CŪ]wNdUnʡA
   ʥiHOAন\sĶ֤ߪ|W[C
   
   nˬdXʵ{bA֤ߤ ( ׬ORAΰʺAJ )AAiHݳo
   ɮ /dev/devices CnˬdǼҲդwJAAiH 'lsmod'Cnˬd
     iH JܡAJ'modprobe -l'CpGAݭnҲդbA tΪ
   ܡAANnssĶ֤ߤΦw˥CAiHѦ Kernel-HOWTO UA ss
   Ķ֤ߡC˳Bz֤߼Ҳժ̷sTAiHѦ Module-HOWTOC
   
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: 
     
   pxA\إߩΧһݪҲդAAiN̪W٥[J /etc/modules
   Ѧ۰ʤuӸJ (kmod,kerneld)CpGA֩wܡAаѦ Linux M
    ɡC
   
   "SCSI hostadaptor emulation" oӥ\beOs "SCSI
   emulation" ( jO 2.0.36 )CpxA}oӿﶵAANnNIDE/ATAPI 
   ЪXʵ{ sĶҲաCnMANnNMϥ SCSI Xʵ{
   C] 2.2 tC ֤ߤwPɨϥ IDE M SCSI Xʵ{bP@ӵw
   W ( pxAOϥ 2.0.36 ֤ߪܡAЬݥHU )C
   
   Loopback device O@ӿܩʪ\AAbNveդ@UA
   vɡC
   
   pGAnŪСAANݭn ISO 9660 ɮרtΪ䴩CoXʵ{w
   ʥ]tRockRidge CpGAݭnMS Joliet ЩAAKݭnsĶ
   յMJC
   
   b󪺱pUAݭn@ӧCXʵ{CCOXʵ{|P
   w 鷾qCܩ SCSI MAܦhCXʵ{iΡAЬݥHU
   C
   
   2.2 tΪSO
  
   b֤ߪ 2.2.1 AnPɥ}CONFIG_SCSI_MULTI_LUN Mide-scsi
   support oӿﶵA] ide-scsi ΦӦܤo˰CLצpAĳ
   ja֤ ɯŬ 2.2.5 C
   
   @ǥΤiwsĶn cdrecord M 2.2 ֤ߦĬCoO Linux ֤ߪ
   DCѨMkpUG
   
     * AAsĶ cdrecord HOAb linux/include/scsi/sg.h تu
       ƭȫADNiѨMFC ] sg ϥΪ̤OתAҥHǼƭȤ@
       wnM֤ߤƭȤ@ˤ~C
     * oiѩ sg Xʵ{oOӵ DMACJrg
       Schillings FTP-site :
       [4]ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/alpha/  sg_buffer
       patch ӸѨMoӰDC
       
   2.0 tCSO
  
   b֤ 2.0.31 HeOܦhΤަܤŪФ̫@ɮסCФɯŨ
    2.0.36C
   
    2.0.36 ΥHWAAiHܨXʵ{(IDE or SCSI) b
   ATAPI-deviceWϥΡCTaAAiH[J"SCSI emulation" oӥ\
   A֤ߤMAiHb֤ߩROCSw device Ұʼ ( btαҰ
   eαҰʤ )C|ҡApGAпNo devicefile /dev/hdbAo
   [JHUyl hdb=ide-scsiC
   
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 wM devicefiles

   bAw˩ҦݪXʵ{H, soӷs֤ߡCӦAb᳡
    nҦ\C
   
   [ pGAO devfs ϥΪ̡AANݭnz|HUʳ]w device files B
   JA] devfs |Az@ƱC]
   
   iJ /dev ؿMˬd@UAS loopback devicesC MoOӤj
   DpGASo devicesAOF̴N|K@ (Ь 3.5 )E pGA
   ̪ܧA|ݨ ls Oloop0-loop7G
   
shell> cd /dev
shell> ls loop*
loop0 loop1 loop2 loop3 loop4 loop5 loop6 loop7

     Listing: devicefiles for loopback
     
   pGASo device-files ܡAAiH/dev/MAKEDEV-script ӫإߥ
   ̡G
   
shell> cd /dev/
shell> modprobe loop
shell> ./MAKEDEV loop

     Listing: commands to create loopback devices
     
   pGAloop ҲսsĶi֤ߡA̫᪺OA~iH\CAbo جݨ
   ˳Bz loop-devicefiles kAP˥iHΦbL devicefiles
   (sg*, pg*, hd*, ...) LbH᪺`N|TC
   
  IDE/ATAPI пN
  
   ATAPI N "SCSI ROb IDE-bus W"CyܻAAIDE/ATAPI 
   N| SCSI w(La@ǭ)AYO|n@ SCSI
   пN@ˡC
   
   b Linux UunAB"SCSI (hostadaptor) emulation" oӮ֤ߥ\਺A
   NiHOA IDE пNX{pP SCSI-devices ˡCpGA
   ide-scsi ֤߼Ҳլʰ_ӪܡAAN|n֦@ SCSI пNˡC
   
  SCSI пN
  
   нTwAпNQAq򥻿J/XtΤ䴩CƱNܱoNN
    pGA֦wӹqS䴩C
   
   pxAQNA SCSI-drive sܧAqWܡAAݭnSOlu
   MSO֤Xʵ{CݳoӺ}
   [5]http://www.torque.net/parport/parscsi.html HohơC
   
  @ SCSI devices
  
   /dev/sd* M /dev/sr* o devicefiles OΨӦs SCSI wЩM SCSI 
   XʾL SCSI Xʾsu block-oriented ƶǰeCo 
   ֳ̨tMAXƦsxCLXʥпNpgO@[ 
   AӤOblock-oriented ƶǰe²Cn sd* M sr* devices O
   bMֳtA@طs˸m w generic SCSI-devicesNlͥXӡC ]Ҧ
    SCSI w骺ާ@iHzL generic devices ӹFӥ̤SS Sw
   تҥH̴Ns genericE
   
   pGAno deviceAAiH /dev ؿG
   
shell> cd /dev
shell> ls sg*
sg0  sg1  sg2  sg3  sg4  sg5  sg6  sg7

   pGASo device-files AAiHbΤUC script ӫإߥthe
   /dev/MAKEDEV-script:
   
shell> cd /dev/
shell> ./MAKEDEV sg

  𪺥пN
  
   u藍_AڨSo譱ѨMסC Ь
   [6]http://www.torque.net/parport/paride.html ΧAϪ
   /usr/src/linux/Documentation/paride.txt.
   
2.3 onӿN

   AiHboا@tCNЪn
   [7]http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling
   /private/cdb.html.The CD building project for UNIX
   
  ROCu
  
   AݭnHU{]ܨ@ӲͥЭ쫬G
   
     [8]ftp://tsx-11.mit.edu/pub/linux/packages/mkisofs/ (mkisofs)
     
     [9]ftp://ftp.ge.ucl.ac.uk/pub/mkhfs (mkhybrid)
     
   AпNөwAAݭnHU䤤@ӵ{ӱNЭ쫬gJG
   
     [10]ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/ (cdrecord)
     
   dUn۫Hmkisofs ªɡAAݭn cdwrite  1.5 AAuݭn
   cdrecord NnFC`NGcdrecord ҥ]A mkiosfs @Ǫ[\E
   
  Graphical user interfaces (optional)
  
   Front-ends b Linux uuO front-endsCYOAMݭnw˩ROCu
   A LAiHΤ@ӸnӤwC
   
   X-CD-Roast O@Ӧb Linux UeNЪ{CXF cdrecord M
   mkisofs b@ӬRHC
   
     [11]http://www.fh-muenchen.de/home/ze/rz/services/projects/xcdroast
     /e_overview.html
     
   BurnIT O@ cdrecord, mksiofs and cdda2wav-0.95  JAVA front-end A
   Aoϥ@Ӧb Unix xU㪺пN]ˡAAiHboبoG
   
     [12]http://sunsite.auc.dk/BurnIT/
     
3. N

     "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.)
     
   b Linux UNЦHUӨBJG
   
     * Nһݪͨ ( ɮסA֩Υ ) ]˦@ǯSO榡ɮסC
     * cdrecord Noɮ׼gJФC
       
   o@|ԺѿNƤέ֥ЪBJC
   
3.1 NФ (¸)

   ЯdNAѩ󦬶nһݪɶ`|wpAG@ӻݭnҼ{ 
   DAKO~쪺ɮפgJNLΤwNСC
   
   <!- igHɳiHbžlmgJơAunASСAAb
    ж}@ӰϰAܦmulti-session СAKigJơALoӰk]
   IANO|OɮץؿŶC --> ٭nOФ@weqŶ
   |Χ@xsISO-9660-ɮרtΪơAq `|ΤWMBAҥH@650MB
   AڤWu620MBiΡC
   
  إߥмv
  
   @xsCA׳nAwСAΥСAbϥΫeإ ɮרt
   ΡAbDOSӨY榡ơAϨ֦@ɮרtΡCoɮרt N|Χ@´
   ΦXxsCWɮסC
   
   @ΨӮ榡ƵwоΰϪu㳣|gJ@ӪŪɮרtΨwФΰ
   A MᥦK|QWMbϥΪ̦ݪɤ~ۼgɮצb䤤CL@iN
   Хu gJ@ApGڭ̼gJ@ӪŪɮרtΡAN|Q榡 w L
   û|O @ŪСCigгO@˪A]A
   arbritary sectors A LAiH㰦ЪeC
   
   ҥHڭ̻ݭn@Ӥu@ۼgɮפ@إɮרtΦb ФEous
    mkisofsEHUNOou㪺ϥ ҤlG
   
mkisofs  -r   -o cd_image   private_collection/
              `---------'   `-----------------'
                   |               |
                gJ      HoӥؿJ

   '-r' ﶵ]wҦbФɮ׬iŪM} Rock Ridge C oO
   ܦhHQnF褣LϥΫeA֩wDAۤvbC (ܡGS
   '-r' ﶵܨ mount-point N|ܦ private_collection!)C
   
   mkisofs |ձNҦɮתର DOS 8.3榡HTO̰ݮeʡC YJW
   RWĬ (PɮצۦPW)AoɴN|bɮפϥμƦrӦ 
   ƴN|b STDERR (q`Où) ܡC nߡGb Linux Aû
   |ݨ 8.3 榡ɮצ] Linux |ϥ Rock Ridge өҦɮת
   Ƴ |b Rock Ridge  (ϥvAɮצW١A)C
   
   {bAi|ݬ mkisofs XgJigоCo 
   ]G
   
     * mkisofs oXʥigСC
     * AiݭnbNeդ@UvɡC
     * bC|ia (ݳ` 4.).
       
   |bUz˿N@СC
   
   ǤHi|Qpإߤ@ӿWߪΰϨӼgJvHNɮסC ڨä٦P
   oPk]pGAgJ~ΰ(ѥr~ҳy) AAK|
    Linux t (ڴNչLop)CA̡Ao˰|yϺ ŶO]
   мvO@ؼȮɩʪơAQNЫᥦKiHR CLεwФ
   ΰϥiH`٧AR@ 650 MB ɮתɶC (LpG A@B~
   ϥiHOA`٧RvɪɶC)
   
  եмv
  
   Linux iHnϺФΰϯNɮױWCoO@ӫܦnΪ\०iHΨ 
   dؿtmMɮרϥvOOAҭnDˡCM{bЫܫKyA O
   NL{̵MOܶOɪAҥHA_Xݭn@ӧֳtաC
   
   nN мv W /cdrom AХΥHUO
   
mount -t iso9660 -o ro,loop=/dev/loop0 cd_image /cdrom

   A{biHb /cdrom UˬdUAɮ w {bmKO ̦bu
   mCnмvɡAAuݭn umount /cdrom C(ĵiGpGAO
   ϥ Linux ֤ 2.0.31 ΥHeAANiݤ ̫᪺XɮסC
   Шϥθs֤ߡC 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.)
   
   `N:
   
     ª mount OBz loopback-devicesCpGAOϥª mount
     ܲ{bOɭԧsA Linux FC
     
     ܦhHĳڼW[@po̷s mout u㪺 bo
     mini-HOWTO Cڳ@@ڵCpxA Linux M eFª
     mountGioO@ӯΡCpGA A Linux MO໴ɯšA
     ioO@ӯΡC
     
     pGڱNҦ˧󥿳]p} Linux M󪺸ơAo mini-HOWTO
     N|ܱoܪΫ\ŪC
     
  gJмvФ
  
   SӦhFnCpGAչLoӫOA{bOɭԸդUդF
   
cdrecord -scanbus

   oӫO|iDAAigоOb SCIS-device CҦ L
   դkwgQR (רO generic SCSI devices R WWh (naming
   scheme) MIk)C
   
   Lbг̫@ӫeڴAơA]igJоw İϬO
   ֡AҥHnDҿJƬyOs򪺡C]pAbN L{Oi
   _A_h|NѡCpGAR@ӫܤjɮ N|ܮe_ƬyC
   pGAR@ 650 MB jpɮתɭԡA ֤߫KݭnswФj 650,000
    blocks (]AɮרtάO 1k @ block ) oݭnܪɶM
   i|OƬyX CLApGb@ܧ֪qWݹqlAs
   ƦܽsĶ֤ |vTN{ǡC
   
   Ъ`N@WOS@ӿNiHmpgmM^ zZIWA
   iNCҥH_ʩμϧA bNШ}aC
   
   pGAǳƦnܡAAiHUHUG
   
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

# PW@ˡALuǡG
shell> cdrecord -v speed=2 dev=0,6,0  -data  cd_image

   FW[iŪʡAigJоTxsboTܼƤG SCSI_BUS,
   SCSI_ID, SCSI_LUNCӿﶵ -data hOΨӿNƥ ХΪC
   
   pGAOϥ cdrecord мg CD-RWAA@wn "blank= . . ." ӧR
   ¦eCЬ man-page ӾǲߦkӲMҦ CD-RW ҦeC
   
   pGA@ 400 Mhz qAAiHN mkisofs XX cdrecord
   G
   
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

   Ĥ@ӫOuOΨˬd@UмveèSγ~ (Aݭn
   cdrecord-distribution  mkisofs ~iϥγoӫO)CAigJ Хi
   णݭnDмvɪjpAo˧AKݭnUoӫOC Xjp
    tsize-parameter Ӷǻ cdrecordC (oӼƦrOx s IMG_SIZE o
   ܼƤ)C̫᪺OO pipe Ӧs mkisofs M cdrecord oӫOC
   
3.2 N֥

   nN@֥ЪBJPNƥЪBJjPpC ̥DnGӤ
   O@O֥Х]tyAӳoǭyݲ´ WߪvCҥHpGAQ
   NQyܡAANnإߤQӼv ɡCt@ӤOOмv榡O
   ISO-9660 (Ϊ̧AQn)A LO "16 bit stereo samples in PCM
   coding at 44100 samples/second (44,1 kHz)".
   
   䤤@ӳns sox iHNɮରһݪ榡C ΪkO²
   G
   
shell> sox  killing-my-software.wav  killing-my-software.cdr

   oӫO|N killing-my-software oq WAV 榡ର CDR 榡C Ь
   man-page Өoh sox ҽT{榡ΩɦWC] L{ݭn
   εwЪŶAҥH cdrecord wؤ䴩 WAV M AU 榡FC ҥHpGA
   ɮצ .wav  .au (and the samplerate "stereo, 16 bit, 44,1 kHz")
   ܡAAKݭnHഫC
   
   pGA -audio ﶵAcdrecord N|NvɿNyCӨLﶵ
   NpPN@Ƥ@ (DADSOnD)CHUTӫOOۦP
   LŪPɮ׮榡G
   
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...

   䤤@ӯSOҤlO MPEG-3 ɮסAiH "mpg123 -s track1.mp3 >
   track.cdr" ഫһݭn榡Ct@ӤkO "8hz-mp3" ഫ WAV
   ɮ׮榡C
   
   pGA{bN֥ЪܡAA|o{y| 2 C pGA
   igJо䴩 "disc at once" (DAO) ܡAAiHեγ̷s
   cdrecord ӸѨM@DC
   
3.3 VX

   SӦhnCuܽdF˲VXϥ -data@M@-audio ﶵHFNVX
   СG
   
cdrecord  -v dev=0,6,0  -data  cd_image  -audio  track*.cdr

4. `ݰDε

4.1 "N{ǦhӷP"

   סGoNnݧANFCq`s| 1MB ΧhAo˥Ki
   H  1-2 SơCpGAQohƧAiHݥͲөάݬݵw
   UC
   
   ިǸƽwľjppAݭnOҤ@Ӫɶ 300 kb/s  600
   kb/s g` XC
   
   @ǵwбKu@Ҧps locate-ƮwC C maxium flow rate N֩w
   |laAСFA̦nbNЫe cronA at  anacron ˬd@UA
   _oǤu@C
   
   t@譱AǤHL̯@sĶ֤ߤ@NгSDC TA
   n@ܧ֪~వoӹC
   
4.2 "fragmentation |_vTXOH"

   Fragmentation q`|vTXCLAiHܮey pathological
   cases of fragmentation ӴCAwпXj 100 kbyte/secondCҥHd
   Uno˰C:-)
   
   OAAwз| fragmented gLg~ϥΡCpGVfragmentedAɮ
   tΫKV Cg`O 10%  20% ŶAo˿NЫKSDFC
   
   pGA֩wܧAiHݬݱҰʮɪTAANiHݨAɮרtΦXh
   ϺЪŶ fragmentation ʥCAiHΤ@ӫD`MIO
   
shell> e2fsck -n  /dev/sda5        # '-n' is important!
[stuff deleted - ignore any errors]
/dev/sda5: 73/12288 files (12.3% non-contiguous)

   boӽdҤϺЪŶGD`P w Loإu 73 ӫD`pɮצbo
   ɮרtΤAҥHoӥuLO@ӫܤ֪ȡC
   
   {b@ӹʪuns e2defrag iHΨ defragment
   extended-2 ɮרtΡCL{bbpHҤ٬OíwCpGAuQ
   defragment A ɮרtΡAХƥ (̦nG)A restore ƥAM
   إߤ@ӷsɮרt  (|}a¦) ̫A restore ƥC`oO
   wޥC
   
4.3 "O_iHNмvxsb UMSDOS ɮרtΤOH "

   iHCu@ɮרtάOiaMֳtӿNЪAoNO network
   filesystem (NFS)C
   
   ڲ{bOb@ (486/66) PC ϥ UMSDOS Linux M DOS/Win @ɺϺ
   ŶAӳo 486 OMӿNХΪC
   
4.4 "LkiHJA iso9660 H"

   iHCAiHΥ@ɮרtΨӿNСCLAbLާ@tΤ
    γoСC
   
   γoӤkNFG
   
     * إߤ@ 650 MB ɮסC
       
dd if=/dev/zero of="empty_file" bs=1024k count=650

     * Mإߤ@extended-2 ɮרtΦboɮפW
       
bash> /sbin/mke2fs  empty_file
empty_file is not a block special device.
Proceed anyway? (y,n) y

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

     * ۼg@ɮר /mnt MC
     *  cdwrite  cdrecord Ӭݬݳoɮ ( {bӤOŪ ) OO
       iso9660-vC
       
   pxAQb/etc/fstab [@ӥXJfЪܡAAKݭn墨
   ЪˬdAҦpG
   
/dev/cdrom  /cdrom  ext2  defaults,ro  0 0

   Ĥ@ӹsN "n]tb dumps" AĤGӹsN "bҰʮɤn˿~" (
   fsck N|ˬdФB ) C
   
4.5 "ŪμgJ֥СH"

   {bhӳnC̷ss@ "cdpranoia" iHbHUaU
   
     [13]http://www.mit.edu/afs/sipb/user/xiphmont/cdparanoia/index.html
     
   Ϊ̧AiH "cdda2wav" M "sox" զXAiHb sunsite M
   mirror o
   
     [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 OAiHѥФ@qSw(Τ@)yMiH N
    .wav ɮסC sox iHN wav ɮ^֥Ъcdda 榡A MiH
   cdwrite NNbФWC pGAOϥγ̷scdrecord AAKݭn
   ϥ sox ] cdrecord wm䴩 .au M .wav ɮסC
   
4.6 "ҰʨtΫ˧MSCSI-devices?"

   drivers/scsi/scsi.c һݭnơ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 "iHi@@нƻsH"

   iHCLAn`NOpGŪЮɦ󪺿~o͡AiOWg
   ѡC
   
   Ĥ@ӱpGA@ӥigоM@ӰŪоCAiHΥHUO
   
cdwrite -v -D /dev/sgc --pad -b  $(isosize  /dev/scd0) /dev/scd0
or
cdrecord -v dev=3,0 speed=2 -isosize /dev/scd0

   AiHq/dev/scd0 ŪƬyM᪽g/dev/sgc gJФC
   
   ĤGӱpGASt@ӰŪСCAKݭnΥigоŪСG
   
dd if=/dev/scd0 of=cdimage bs=1c count=`isosize  /dev/scd0`

   oӫOP mkisofs AҥHAiHβĤTҴΪk~ lUu@
   CЪ`NoӤkOAΩ󭵼֥СC
   
4.8 "Linux iiHŪ Joliet СH"

   iHC̷s֤ (2.0.36 MH) wm䴩 joliet 榡CаOۧAnb
   /etc/fstab ϥ iso9660 M joliet ӿﶵCnohơAAiH
   [16]http://www-plateau.cs.berkeley.edu/people/chaffee/joliet.html.
   
4.9 "˥ΥigоŪСH"

   NpPAϥδqŪо@ˡCS󪺯SOC`NAn
   scd-devices (Ūо) ŪСCHUKOb/etc/fstab dҡG
   
/dev/scd0  /cdrom  iso9660  ro,user,noauto  0  0

4.10 "˩hǸƨФH"

    bzip2 HNLYn gzip  pkzipCo|`30%ϺЪŶC
   AiHbHUaU
   
     [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. DѨM

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

   ХˬdAigоणbLާ@tΤϥ
   
   MˬdHUƱG
   
     * _T{A SCSI device?
     * Xʵ{_T{AigоH
     * iiHΪenNСH
       
   pGAigbLާ@tΤϥΪܡAܥiAw ΧARF
   @awC
   
   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 b DOS @ϥ

   ըϥ Linux Cb DOS Uwˤγ]w SCSI Xʵ{O@ܧx u@
   C Linux ]OܽܡHI
   
5.4 NL{ SCSI ~

   q`oǿ~OѥHUpҰ
   
     * SCSI bus ʥFdis-/reconnect \
     * w󴲼
     * wla (ӥiH5.1. kd)
       
   bܦhpU SCSI devices ݭn SCSI bus  dis- and reconnect ۤvC
   pGʤֳoӥ\઺ܡAǥigJоib¶ЮɵoͰDC
   
   רONCR 53c7,8xx SCSI Xʵ{|w]oӥ\AA̦nˬd@UG
   
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.  (oqĶ)

   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
