Differences between revisions 20 and 21
Revision 20 as of 2016-01-27 13:59:53
Size: 5856
Comment: Added table of contents and link targets on sections
Revision 21 as of 2016-01-27 14:00:52
Size: 5856
Comment: Moved new table of contents
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:

<<TableOfContents(3)>>
Line 15: Line 13:

<<TableOfContents(3)>>

Translation(s): English - Français - Italiano


There are several GUI programs available in Debian.

For example use apt-get install brasero and start brasero in X. Others are Debian packages:xfburn. and Debian packages:k3b.

But sometimes you may want to use the command line.

Make an ISO image file

Two programs are available for producing ISO 9660 filesystems: Debian packages:genisoimage and Debian packages:xorriso.

Assumed you already did apt-get install genisoimage and apt-get install xorriso, you may put the file tree /home/user/for_iso into an ISO 9660 filesystem image file /home/user/file.iso by one of:

genisoimage -v -J -r -V MY_DISK_LABEL -o /home/user/file.iso /home/user/for_iso
xorriso -as mkisofs -v -J -r -V MY_DISK_LABEL -o /home/user/file.iso /home/user/for_iso

Both program runs in this example are controlled by the same options, which originally stem from program mkisofs.

Burn the image file to CD, DVD, or BD

For CD media, there is Debian packages:wodim. For DVD and BD (Blu-ray) there is Debian packages:growisofs. For CD, DVD, and BD there are Debian packages:cdrskin and Debian packages:xorriso.

Assumed you already did apt-get install wodim, apt-get install cdrskin, and apt-get install xorriso, you may burn the image file /home/user/file.iso to a CD by one of these three commands

wodim -v dev=/dev/sr0 -dao /home/user/file.iso
cdrskin -v dev=/dev/sr0 -dao /home/user/file.iso
xorriso -as cdrecord -v dev=/dev/sr0 -dao /home/user/file.iso

All three are actually controlled by the same options, which originally stem from program cdrecord.

On DVD or BD media, one may run the same cdrskin and xorriso commands as in above example. One may also use growisofs (after apt-get install growisofs):

growisofs -dvd-compat -Z /dev/sr0=/home/user/file.iso

wodim should better not be used with DVD or BD media.

As usual with the command line, burning will start right away with no confirmation questions. If you experience failure, consider to ask for advise at mailing lists debian-user@lists.debian.org or pkg-libburnia-devel@lists.alioth.debian.org .

Above examples use the device file address of your first optical drive, /dev/sr0. To get a list of all your optical drive devices do one of:

cdrskin --devices
xorriso -devices

which will report something like

0  -dev '/dev/sr0' rwrw-- :  'HL-DT-ST' 'BDDVDRW GGC-H20L'
1  -dev '/dev/sr1' rwrw-- :  'HL-DT-ST' 'DVDRAM GH24NSC0'
2  -dev '/dev/sr2' rwrw-- :  'Optiarc ' 'BD RW BD-5300S'

wodim will perform this run only if the obsoleted device files /dev/scd* exist. growisofs has no device listing feature.

The sequence of drive numbers may change with each reboot. If you need persistent device names, consider to use the lengthy ones in directory /dev/disk/by-id/. You will recognise them by bearing the same manufacturer and model names as in above --devices runs. E.g.

/dev/disk/by-id/usb-Optiarc_BD_RW_BD-5300S_306663601043-0:0

Test it

For comparing MD5 sums one must restrict reading from the CD, DVD, or BD to exactly the same number of data blocks that was written by the burn program. For this, inquire the size of the ISO image file.

blocks=$(expr $(ls -l /home/user/file.iso | awk '{print $5}') / 2048)
dd if=/dev/sr0 bs=2048 count=$blocks | md5sum
md5sum /home/user/file.iso

This should yield identical MD5 checksum strings. E.g.

8213+0 records in
8213+0 records out
16820224 bytes (17 MB) copied, 12.189631 s, 1.4 MB/s
492bd13e477b3efb507149152a4e7736  -
492bd13e477b3efb507149152a4e7736  /home/user/file.iso

One may also mount the medium and compare data files with their originals on hard disk by doing:

sudo mount /dev/sr0 /mnt/cdrom
diff /mnt/cdrom/my/file /home/user/for_iso/my/file
sudo umount /dev/cdrom

It might be that you first have to create directory /mnt/cdrom before you can mount it. If you eject the medium and insert it again, it may well be mounted automatically underneath /media/. In this case, you do not have to run the sudo commands.

Audio CD

Music CD players expect the CD-DA format, which is not a filesystem, but a simple list of file-like entities called Tracks. Each track is normally one piece of music. E.g. a complete song.

The content of the tracks has to be presented as data files with uncompressed samples of 44100 Hz sampling rate, 16 bits per sample, 2 channels, little-endian byte order, WAV header. This is also known as ".wav" file.

This applies not to DVD or BD media. Usable are wodim and cdrskin.

wodim -v dev=/dev/sr0 -sao -audio track1.wav track2.wav ... trackN.wav
cdrskin -v dev=/dev/sr0 -sao -audio track1.wav track2.wav ... trackN.wav

The resulting media cannot be read by dd or other data readers. Reading audio tracks from CD may be done by readom out of Debian packages:wodim, or by cdrskin option extract_audio_to=. See

man readom
man cdrskin

See also: