Writing Data DVDs (on Red Hat Linux 9)
David N. Lombard
Original source: http://www.lombardsnest.com/dnl/writing-dvds.html
Last updated:


email me...

Introduction

This document describes how to write data DVDs on Red Hat Linux 9 using various tools. They are, in the order I figured out to use them,

Disclaimer: These work for me and the DVD+R writer I have at home and the DVD±R writer I use at work; don't be surprised if you waste a DVD or cause unspeakable calamaties – you've been warned.

Note: At the time of writing, there appears to be problems with the CD and DVD writers on Fedora Core 2 with the 2.6 kernel; these procedures do not work. Please let me know if you get this working on FC2.

Preliminaries

  1. Make sure your DVD writer is properly configured. You should be able to write CD-R discs (with either cdrecord-ProDVD or cdrecord 2.01); if you can't, then fix that first. Most likely, you need to specify something like
    hdc=ide-scsi
    on the kernel command line. This example is for the master drive of the secondary UDMA channel. As I have a DVD writer and a CD writer, my kernel command line includes
    hdc=ide-scsi hdd=ide-scsi
  2. You also need the appropriate device entries. I have two, as so
    
    lrwxrwxrwx    1 root     root            9 Oct 21  2003 /dev/dvd -> /dev/scd0
    lrwxrwxrwx    1 root     root            9 Oct 21  2003 /dev/cdrom -> /dev/scd1
    
    brw-------    1 dnl      disk      11,   0 Jan 30  2003 /dev/scd0
    brw-------    1 dnl      disk      11,   1 Jan 30  2003 /dev/scd1
        
    Clearly, the first two entries are abstract names for the benefit of various software and myself; the last two entries are the actual block devices, via the IDE-SCSI layer.

  3. Finally, I have the following in my /etc/fstab:
    
    /dev/dvd    /mnt/dvd    iso9660,udf  noauto,owner,kudzu,ro  0 0
    /dev/cdrom  /mnt/cdrom  iso9660      noauto,owner,kudzu,ro  0 0
          
    The order of iso9660,udf is important; this way, the ISO 9660 format is seen first and the disc mounted as such if possible.

    Now, why do I do this when the normal order, e.g., as specified by the RHL9 installer, puts udf first? The so-called Universal Disk Format is supposed to be an improvement on IS0 9660. Well, perhaps, but for my needs, ISO 9660 with Rock Ridge extentions is much better for backup purposes as it permits you to preserve file ownership and permissions (see here for more info).

Procedures

cdrecord-ProDVD

  1. Determine if your current cdrecord binary groks your DVD writer. It probably doesn't if you have the standard RHL 9 version of cdrecord; the output will look like
    
    # cdrecord -scanbus
    Cdrecord 2.0 (i686-pc-linux-gnu) Copyright (C) 1995-2002 Jrg Schilling
    scsidev: '1,0,0'
    scsibus: 1 target: 0 lun: 0
    Linux sg driver version: 3.1.24
    cdrecord: No such device. Cannot open '/dev/pg0'. Cannot open SCSI driver.
    cdrecord: For possible targets try 'cdrecord -scanbus'. Make sure you are root.
    cdrecord: For possible transport specifiers try 'cdrecord dev=help'.
    #
        
    Note the message about /dev/pg0 – ignore this, it's an unintentional red herring.

    If your version of cdrecord properly identified your DVD writer, you can skip to step 7.

  2. Download the following from Jeorg Schilling's web site:

    Note: You may need a different cdrecord-ProDVD binary.

  3. Copy the binary to /usr/local/bin, thus
    # cp cdrecord-prodvd-2.01b31-i686-pc-linux-gnu /usr/local/bin/cdrecord-ProDVD
  4. Assuming you're using this for your own personal, private, non-commercial use, you can now install the key. Otherwise, you'll need to poke around here, here, or maybe here to find out what you need to do. Alternately, you may be able to use growisofs – that's what I do at work.

    The key can be installed several ways, the more popular are:

    1. Download the cdrecord-wrapper.sh shell script and use it whenever you want to write a DVD.
    2. Set the environment variable $CDR_SECURITY as follows:
      export CDR_SECURITY=8:dvd,clone:sparc-...SF7W2NAIDkJ/A
      Note, the actual key is very long, make sure you get it right; the best thing to do is copy it out of the README file. I just put the export in ~root/.bash_profile, but you could put in /etc/profile. Of course, this assumes you use bash, the one true shell. If you use csh, you're on your own (of course, you probably use emacs too) ;-)

  5. Now, finally, you will get output that looks something like this:
    
    # cdrecord-ProDVD -scanbus
    Cdrecord-ProDVD-Clone 2.01b31 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jrg Schilling
    Unlocked features: ProDVD Clone
    Limited  features:
    This copy of cdrecord is licensed for: private/research/educational_non-commercial_use
    Linux sg driver version: 3.1.24
    Using libscg version 'schily-0.8'.
    scsibus0:
            0,0,0     0) 'HP      ' 'DVD Writer 200j ' '1.27' Removable CD-ROM
            0,1,0     1) 'TEAC    ' 'CD-W552E        ' '1.09' Removable CD-ROM
            0,2,0     2) *
            0,3,0     3) *
            0,4,0     4) *
            0,5,0     5) *
            0,6,0     6) *
            0,7,0     7) *
    #
        
    The key points are the DVD writer was correctly identified and the Unlocked features lists "ProDVD".

  6. You're now ready to create the DVD image file. This is just like creating an ISO 9660 image. For example,
    
    # mkisofs -R -o /tmp/dvd.iso /some/path
    Using MOZIL000.TGZ;1 for  /some/path/mozilla-i686-pc-linux-gnu-1.7.2-installer.tar.gz (mozilla-i686-pc-linux-gnu-1.7-installer.tar.gz)
      3.92% done, estimate finish Mon Sep 20 22:42:26 2004
      7.84% done, estimate finish Mon Sep 20 22:42:38 2004
     11.75% done, estimate finish Mon Sep 20 22:42:34 2004
      ...
     90.03% done, estimate finish Mon Sep 20 22:42:51 2004
     93.95% done, estimate finish Mon Sep 20 22:42:51 2004
     97.86% done, estimate finish Mon Sep 20 22:42:51 2004
    Total translation table size: 0
    Total rockridge attributes bytes: 33887
    Total directory bytes: 182272
    Path table size(bytes): 1386
    Max brk space used 37024
    127744 extents written (249 Mb)
    #
        
    Note the use of -R instead of -r. The upper-case version leaves the existing permissions, uid, and gid intact (which can result in the odd situation of writable permissions on read-only media); the lower-case version will clear all the write modes, change the uid and gid to 0 (root), and do other things which aid in portability. So, if you want to use the DVD as a faithful backup, use -R; if you want to use the DVD to move files to other machines, or you only need the file content maintained (i.e., you don't care if the permissions and ownership are mangled) use -r.

    Also note that I did not specify -udf. You can additionally specify -udf to make a disc with both formats for increased portability. Be sure though, that you explicitly mount with -tiso9660 or specify iso9660 in /etc/fstab, as shown here, if you care about permissions and ownership...

  7. As usual, you can mount the image on a loopback device to validate it before you burn one of those pricey DVD±R discs...
    
    # mount -tiso9660 -oloop /tmp/dvd.iso /mnt/loop
    # mount | grep loop
    /tmp/dvd.iso on /mnt/loop type iso9660 (rw,loop=/dev/loop0)
    # umount /mnt/loop
        

  8. Finally, you can burn that DVD. This is very much like burning a CD-R, but you add the -dao option to enable "session at once" mode.
    
    # cdrecord-ProDVD -dao dev=0,0,0 -v /tmp/dvd.iso
    Cdrecord-ProDVD-Clone 2.01b31 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jrg Schilling
    Unlocked features:
    Limited  features:
    TOC Type: 1 = CD-ROM
    scsidev: '0,0,0'
    scsibus: 0 target: 0 lun: 0
    Linux sg driver version: 3.1.24
    Using libscg version 'schily-0.8'.
    SCSI buffer size: 64512
    atapi: 1
    Device type    : Removable CD-ROM
    Version        : 0
    Response Format: 2
    Capabilities   :
    Vendor_info    : 'HP      '
    Identifikation : 'DVD Writer 200j '
    Revision       : '1.27'
    Device seems to be: Generic mmc2 DVD-ROM.
    Current: DVD+R
    Profile: DVD+R (current)
    Profile: DVD+RW
    Profile: DVD-ROM
    Profile: CD-RW
    Profile: CD-R
    Profile: CD-ROM
    Using generic SCSI-3/mmc-3 DVD+R driver (mmc_dvdplusr).
    Driver flags   : DVD MMC-3 SWABAUDIO BURNFREE
    Supported modes: PACKET SAO
    Drive buf size : 1310720 = 1280 KB
    FIFO size      : 4194304 = 4096 KB
    Track 01: data   249 MB
    Total size:      249 MB = 127744 sectors
    Current Secsize: 2048
    Blocks total: 2295104 Blocks current: 2295104 Blocks remaining: 2167360
    Starting to write CD/DVD at speed 0 in real SAO mode for single session.
    Last chance to quit, starting real write    0 seconds. Operation starts.
    Waiting for reader process to fill input buffer ... input buffer ready.
    Starting new track at sector: 0
    Track 01:  249 of  249 MB written (fifo 100%) [buf  99%]   2.0x.
    Track 01: Total bytes read/written: 261619712/261619712 (127744 sectors).
    Writing  time:  136.670s
    Average write speed   1.4x.
    Min drive buffer fill was 97%
    Fixating...
    Fixating time:   62.459s
    cdrecord-ProDVD: fifo had 4121 puts and 4121 gets.
    cdrecord-ProDVD: fifo was 0 times empty and 3066 times full, min fill was 82%.
    #
        

    Note, there will be a long delay after it writes out
    Track 01: 0 of n MB written
    before it continues and completes the disk, just be patient. Also note the fixating time can be long – be patient here too...

    Oh, in case you're thinking, Hey, you only wrote 249MB, what does that prove? OK, so here's an extract for a 1.8GB DVD:
    
    # cdrecord-ProDVD -dao dev=0,0,0 -v /tmp/dvd.iso
    Cdrecord-ProDVD-Clone 2.01b31 (i686-pc-linux-gnu) Copyright (C)
    1995-2004 Jrg Schilling
    ...
    Waiting for reader process to fill input buffer ...  input buffer ready.
    Starting new track at sector: 0
    ...
    Track 01: Total bytes read/written: 1911685120/1911685120 (933440 sectors).
    Writing  time:  773.933s
    Average write speed   1.8x.
    Min drive buffer fill was 97%
    Fixating...
    Fixating time:   86.575s
    cdrecord-ProDVD: fifo had 30111 puts and 30111 gets.
    cdrecord-ProDVD: fifo was 0 times empty and 22013 times full, min fill was 76%.
    #
        

  9. And you're done!

  10. Validate your masterpiece:
    
    # mount /mnt/dvd
    # mount | grep dvd
    /dev/dvd on /mnt/dvd type iso9660 (ro,nosuid,nodev)
    #
        

  11. Read Jeorg's README file for more information.

growisofs

  1. Download dvd+rw-tools from Andy Polyakov's web site.

  2. Build and install the package:
    
    $ tar xfz dvd+rw-tools-5.21.4.10.8.tar.gz
    $ cd dvd+rw-tools-5.21.4.10.8/
    $ ls
    btcflash.cpp         dvd+rw-mediainfo.cpp  growisofs_mmc.cpp  Makefile.m4
    dvd-ram-control.cpp  dvd+rw-tools.spec     index.html         rpl8.cpp
    dvd+rw-booktype.cpp  growisofs.1           LICENSE            transport.hxx
    dvd+rw-format.cpp    growisofs.c           Makefile
    $ make
    make[1]: Entering directory `/home/dnl/sw/dvd+rw-tools-5.21.4.10.8'
    gcc  -O2   -c -o growisofs.o growisofs.c
    g++  -O2 -fno-exceptions   -c -o growisofs_mmc.o growisofs_mmc.cpp
    g++  -O2 -fno-exceptions    growisofs.o growisofs_mmc.o   -o growisofs
    g++  -O2 -fno-exceptions   -c -o dvd+rw-format.o dvd+rw-format.cpp
    g++  -O2 -fno-exceptions    dvd+rw-format.o   -o dvd+rw-format
    g++  -O2 -fno-exceptions   -c -o dvd+rw-booktype.o dvd+rw-booktype.cpp
    g++  -O2 -fno-exceptions    dvd+rw-booktype.o   -o dvd+rw-booktype
    g++  -O2 -fno-exceptions   -c -o dvd+rw-mediainfo.o dvd+rw-mediainfo.cpp
    g++  -O2 -fno-exceptions    dvd+rw-mediainfo.o   -o dvd+rw-mediainfo
    g++  -O2 -fno-exceptions   -c -o dvd-ram-control.o dvd-ram-control.cpp
    g++  -O2 -fno-exceptions    dvd-ram-control.o   -o dvd-ram-control
    make[1]: Leaving directory `/home/dnl/sw/dvd+rw-tools-5.21.4.10.8'
    $ su -c "cd $PWD;make install" -
    Password:
    make[1]: Entering directory `/home/dnl/sw/dvd+rw-tools-5.21.4.10.8'
    [ -d /usr/local/bin ] || mkdir -p /usr/local/bin
    install -o root -m 0755  growisofs dvd+rw-format dvd+rw-booktype dvd+rw-mediainfo dvd-ram-control /usr/local/bin
    [ -d /usr/local/man/man1 ] || mkdir -p /usr/local/man/man1
    install -o root -m 0644 growisofs.1 /usr/local/man/man1
    make[1]: Leaving directory `/home/dnl/sw/dvd+rw-tools-5.21.4.10.8'
    $ 
        

  3. At this point, you have two alternatives:

    1. Burn an existing ISO 9660 image with the command
      
      # growisofs -dvd-compat -Z /dev/cdrom=/tmp/dvd.iso
      Executing 'builtin_dd if=/tmp/dvd.iso of=/dev/cdrom obs=32k seek=0'
      /dev/cdrom: "Current Write Speed" is 2.5x1385KBps.
               0/2704277504 ( 0.0%) @0x, remaining ??:??
               0/2704277504 ( 0.0%) @0x, remaining ??:??
               0/2704277504 ( 0.0%) @0x, remaining ??:??
               0/2704277504 ( 0.0%) @0x, remaining ??:??
               0/2704277504 ( 0.0%) @0x, remaining ??:??
               0/2704277504 ( 0.0%) @0x, remaining ??:??
               0/2704277504 ( 0.0%) @0x, remaining ??:??
         5799936/2704277504 ( 0.2%) @1.2x, remaining 232:37
        17432576/2704277504 ( 0.6%) @2.4x, remaining 84:46
        29065216/2704277504 ( 1.1%) @2.4x, remaining 56:45
        38207488/2704277504 ( 1.4%) @1.9x, remaining 46:31
        47054848/2704277504 ( 1.7%) @1.9x, remaining 40:28
        55508992/2704277504 ( 2.1%) @1.8x, remaining 37:22
        67141632/2704277504 ( 2.5%) @2.4x, remaining 32:43
        78741504/2704277504 ( 2.9%) @2.4x, remaining 29:27
        88080384/2704277504 ( 3.3%) @2.0x, remaining 28:13
        ...
      2567995392/2704277504 (95.0%) @2.4x, remaining 0:43
      2579628032/2704277504 (95.4%) @2.4x, remaining 0:39
      2589130752/2704277504 (95.7%) @2.0x, remaining 0:36
      2600501248/2704277504 (96.2%) @2.4x, remaining 0:32
      2612101120/2704277504 (96.6%) @2.4x, remaining 0:29
      2623733760/2704277504 (97.0%) @2.4x, remaining 0:25
      2632974336/2704277504 (97.4%) @1.9x, remaining 0:22
      2644574208/2704277504 (97.8%) @2.4x, remaining 0:18
      2656206848/2704277504 (98.2%) @2.4x, remaining 0:15
      2666102784/2704277504 (98.6%) @2.1x, remaining 0:12
      2677735424/2704277504 (99.0%) @2.4x, remaining 0:08
      2689368064/2704277504 (99.4%) @2.4x, remaining 0:04
      2698674176/2704277504 (99.8%) @2.0x, remaining 0:01
      builtin_dd: 1320448*2KB out @ average 2.2x1385KBps
      /dev/cdrom: flushing cache
      /dev/cdrom: closing track
      /dev/cdrom: closing disc
      /dev/cdrom: reloading tray
      # 
              
    2. Allow growisofs to run mkisofs for you, with the command
      
      # growisofs -Z /dev/cdrom -R ~dnl
      Executing 'mkisofs -R /home/dnl | builtin_dd of=/dev/cdrom obs=32k seek=0'
      Using PCONS000.WBM;1 for  /pconsole-20040916.wbm (pconsole-20040915.wbm)
      Using PCONS001.WBM;1 for  /pconsole-20040915.wbm (pconsole.wbm)
       ...
      Using VISIB000.;1 for  /home/dnl/.gimp-1.2/palettes/Visibone2 (Visibone)
      /dev/cdrom: "Current Write Speed" is 2.5x1385KBps.
        0.38% done, estimate finish Sat Oct  9 10:28:29 2004
        0.76% done, estimate finish Sat Oct  9 09:24:49 2004
        1.14% done, estimate finish Sat Oct  9 09:04:59 2004
        1.51% done, estimate finish Sat Oct  9 08:53:59 2004
        1.89% done, estimate finish Sat Oct  9 08:47:24 2004
        2.27% done, estimate finish Sat Oct  9 08:43:44 2004
        2.65% done, estimate finish Sat Oct  9 08:40:29 2004
        3.03% done, estimate finish Sat Oct  9 08:38:03 2004
       ...
       97.64% done, estimate finish Sat Oct  9 08:23:49 2004
       98.02% done, estimate finish Sat Oct  9 08:23:50 2004
       98.40% done, estimate finish Sat Oct  9 08:23:49 2004
       98.77% done, estimate finish Sat Oct  9 08:23:48 2004
       99.15% done, estimate finish Sat Oct  9 08:23:48 2004
       99.53% done, estimate finish Sat Oct  9 08:23:47 2004
       99.91% done, estimate finish Sat Oct  9 08:23:47 2004
      Total translation table size: 0
      Total rockridge attributes bytes: 2035543
      Total directory bytes: 5095424
      Path table size(bytes): 21136
      Max brk space used b66024
      1321200 extents written (2580 Mb)
      builtin_dd: 1321200*2KB out @ average 2.0x1385KBps
      /dev/cdrom: flushing cache
      /dev/cdrom: closing track
      /dev/cdrom: closing session
      /dev/cdrom: reloading tray
      # 
              

  4. Validate your masterpiece:
    
    # mount /mnt/dvd
    # mount | grep dvd
    /dev/dvd on /mnt/dvd type iso9660 (ro,nosuid,nodev)
    #
        

  5. This is covered in much more detail at Andy Polyakov's web site.

cdrecord 2.01

It looks like cdrecord 2.01 can at least write to DVD-R and DVD-RW devices – something I will report on as soon as I can test. More importantly, it allows you to use the CD-R features of your combo drive, something neither the extant cdrecord 2.0 nor growisofs can do.

  1. First, let's look at the available devices on my system via this version of cdrecord
    
    # cdrecord-2.01 -scanbus
    Cdrecord-Clone 2.01 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jrg Schilling
    Linux sg driver version: 3.1.24
    Using libscg version 'schily-0.8'.
    scsibus0:
            0,0,0     0) 'HP      ' 'DVD Writer 200j ' '1.27' Removable CD-ROM
            0,1,0     1) 'TEAC    ' 'CD-W552E        ' '1.09' Removable CD-ROM
            0,2,0     2) *
            0,3,0     3) *
            0,4,0     4) *
            0,5,0     5) *
            0,6,0     6) *
            0,7,0     7) *
    # 
        
    So far, so good.

  2. Now, to write a CD-R on the DVD writer, issue the normal command, with CD-R media in the drive, as so
    
    # cdrecord -dao dev=0,0,0 /tmp/cd.iso
    Cdrecord-Clone 2.01 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jrg Schilling
    scsidev: '0,0,0'
    scsibus: 0 target: 0 lun: 0
    Linux sg driver version: 3.1.24
    Using libscg version 'schily-0.8'.
    Device type    : Removable CD-ROM
    Version        : 0
    Response Format: 2
    Capabilities   :
    Vendor_info    : 'HP      '
    Identifikation : 'DVD Writer 200j '
    Revision       : '1.27'
    Device seems to be: Generic mmc2 DVD-ROM.
    Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).
    Driver flags   : MMC-2 SWABAUDIO BURNFREE
    Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R96R
    Starting to write CD/DVD at speed 12 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
    Track 01: Total bytes read/written: 497254400/497254400 (242800 sectors).
    # 
        

  3. Validate your masterpiece:
    
    # mount /mnt/cdrom
    # mount | grep cdrom
    /dev/cdrom on /mnt/cdrom type iso9660 (ro,nosuid,nodev)
    # umount /mnt/cdrom
        

  4. This is just the usual CD-R case, as documented numerous times in numerous places...
Best viewed with monitor turned on
Valid XHTML 1.0!
Just Vim it!
[page count...]