Notice

If you are searching for nice looking menus and buttons, the windoze way, you will not find this here. It’s only about command line options, what the buttons and menus hide.

Count your files

du -ch --max-depth=1 /data/ --exclude=poze

Create the .iso file

Everything starts with an .iso file which represents the image of the CD/DVD to be written:

mkisofs  -r -l -allow-leading-dots -J -hide-rr-moved -x /data/poze -o /tmp/data.iso /data

This creates a /tmp/data.iso image with the following options:

  • -r – rock ridge relaxed to have some sort of ownership and modes for the files
  • -l – allow long (31 character) filenames
  • -allow-leading-dots – preserve files which start with a dot
  • -J – Jolliet extensions for windoze
  • -hide-rr-moved – hides (almost) the rr_moved directory
  • -x – exclude pattern. Here you must use the complete path of the excluded file/directory. See the difference from the du –exclude option. Can use multiple -x options
  • -o – where to store the result
  • /data – what to put on the .iso

Testing the .iso file

You can now mount the file to check if it’s ok

mount -t iso9660 -oloop /tmp/data.iso /mnt/loop/<br></br>

Writing a CD

cdrecord -dev=ATAPI:0,0,0 -speed=16 -force -eject -v /tmp/data.iso<br></br>

The -dev parameter is the most complicated but you can search for your CD in 2 ways:

cdrecord -scanbus dev=ATAPI<br></br>Cdrecord-Clone 2.01 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Schilling<br></br>cdrecord: Warning: Running on Linux-2.6.17-suspend2-r6<br></br>cdrecord: There are unsettled issues with Linux-2.5 and newer.<br></br>cdrecord: If you have unexpected problems, please try Linux-2.4 or Solaris.<br></br>scsidev: 'ATAPI'<br></br>devname: 'ATAPI'<br></br>scsibus: -2 target: -2 lun: -2<br></br>Warning: Using ATA Packet interface.<br></br>Warning: The related Linux kernel interface code seems to be unmaintained.<br></br>Warning: There is absolutely NO DMA, operations thus are slow.<br></br>Using libscg version 'schily-0.8'.<br></br>scsibus0:<br></br>        0,0,0     0) 'QSI     ' 'CDRW/DVD SBW242U' 'UD25' Removable CD-ROM<br></br>        0,1,0     1) *<br></br>        0,2,0     2) *<br></br>        0,3,0     3) *<br></br>        0,4,0     4) *<br></br>        0,5,0     5) *<br></br>        0,6,0     6) *<br></br>        0,7,0     7) *<br></br>

If you do not enter the dev=ATAPI parameter then if will show you the SCSI cdroms or those which use the ide-scsi emulation found in older kernels.

Writting a DVD

Writting a DVD does not require the -dev parameters but requires to know your cdrom device: /dev/hdc in my case.

growisofs -speed=8 -Z /dev/hdc=/tmp/data.iso

you cand find your dvd device by looking in dmesg:

Dec  2 15:33:03 viote hda: MAXTOR 6L040J2, ATA DISK drive<br></br>Dec  2 15:33:03 viote hdc: HL-DT-ST DVDRAM GSA-H10N, ATAPI CD/DVD-ROM drive<br></br>Dec  2 15:33:03 viote ide0 at 0x1f0-0x1f7,0x3f6 on irq 14<br></br>

Write on the fly

It is also possible to write your DVD on the fly by mixing the mkisofs with growisofs options:

growisofs -speed=8 -Z /dev/hdc -r -l -allow-leading-dots -J -hide-rr-moved -x /data/poze -o /tmp/data.iso<br></br>

Ensure maximum speed

Ensure DMA is enabled for your discs:

# hdparm /dev/hda                                                <br></br>/dev/hda:<br></br> multcount    = 16 (on)<br></br> IO_support   =  1 (32-bit)<br></br> unmaskirq    =  1 (on)<br></br> using_dma    =  1 (on)<br></br> keepsettings =  0 (off)<br></br> readonly     =  0 (off)<br></br> readahead    = 256 (on)<br></br>