Burning a CD/DVD on a Linux system with the cdrecord command

If you need to burn a CD or DVD from an ISO file from the command line on a Linux system, you can use the cdrecord command. If you include the -v argument to the program, you will see verbose information on the actions performed by the utility and the progress as it writes to the optical disc. E.g.:

Udemy - April2516-25off-sitewide120x600

$ cdrecord -v kali-linux-2017.1-i386.iso 
wodim: No write mode specified.
wodim: Assuming -tao mode.
wodim: Future versions of wodim may have different drive dependent defaults.
TOC Type: 1 = CD-ROM
wodim: Operation not permitted. Warning: Cannot raise RLIMIT_MEMLOCK limits.
Device was not specified. Trying to find an appropriate drive...
Looking for a DVD-R drive to store 2723.33 MiB...
Detected DVD-R drive: /dev/sr0
Using /dev/cdrom of unknown capabilities
scsidev: '/dev/cdrom'
devname: '/dev/cdrom'
scsibus: -2 target: -2 lun: -2
Linux sg driver version: 3.5.27
Wodim version: 1.1.11
SCSI buffer size: 64512
Device type    : Removable CD-ROM
Version        : 5
Response Format: 2
Capabilities   : 
Vendor_info    : 'hp      '
Identification : 'DVD A  DH16ACSHR'
Revision       : 'JHG6'
Device seems to be: Generic mmc2 DVD-R/DVD-RW.
Current: 0x0011 (DVD-R sequential recording)
Profile: 0x002B (DVD+R/DL) 
Profile: 0x001B (DVD+R) 
Profile: 0x001A (DVD+RW) 
Profile: 0x0016 (DVD-R/DL layer jump recording) 
Profile: 0x0015 (DVD-R/DL sequential recording) 
Profile: 0x0014 (DVD-RW sequential recording) 
Profile: 0x0013 (DVD-RW restricted overwrite) 
Profile: 0x0012 (DVD-RAM) 
Profile: 0x0011 (DVD-R sequential recording) (current)
Profile: 0x0010 (DVD-ROM) 
Profile: 0x000A (CD-RW) 
Profile: 0x0009 (CD-R) 
Profile: 0x0008 (CD-ROM) 
Profile: 0x0002 (Removable disk) 
Using generic SCSI-3/mmc DVD-R(W) driver (mmc_mdvd).
Driver flags   : SWABAUDIO BURNFREE 
Supported modes: PACKET SAO
Drive buf size : 1048576 = 1024 KB
Beginning DMA speed test. Set CDR_NODMATEST environment variable if device
communication breaks or freezes immediately after that.
FIFO size      : 4194304 = 4096 KB
Track 01: data  2723 MB        
Total size:     3127 MB (309:51.25) = 1394344 sectors
Lout start:     3127 MB (309:53/19) = 1394344 sectors
Current Secsize: 2048
HINT: use dvd+rw-mediainfo from dvd+rw-tools for information extraction.
Blocks total: 2298496 Blocks current: 2298496 Blocks remaining: 904152
Speed set to 22160 KB/s
Starting to write CD/DVD at speed  17.0 in real unknown mode for single session.
Last chance to quit, starting real write in    0 seconds. Operation starts.
Waiting for reader process to fill input buffer ... input buffer ready.
Performing OPC...
Starting new track at sector: 0
Track 01: 2723 of 2723 MB written (fifo 100%) [buf  97%]  13.1x.
Track 01: Total bytes read/written: 2855616512/2855616512 (1394344 sectors).
Writing  time:  252.722s
Average write speed   9.1x.
Min drive buffer fill was 54%
Fixating time:    6.692s
wodim: fifo had 44979 puts and 44979 gets.
wodim: fifo was 0 times empty and 9523 times full, min fill was 62%.

When the program is finished you can use the eject command to eject the disc.

$ eject                                        

If you issue, the command cdrecord it runs the wodim program. On a CentOS Linux system, you can see that cdrecord is a link to the wodim utility at /usr/bin/wodim.

$ ls -l /usr/bin/cdrecord
lrwxrwxrwx. 1 root root 26 Oct  5  2014 /usr/bin/cdrecord -> /etc/alternatives/cdrecord
$ ls -l /etc/alternatives/cdrecord
lrwxrwxrwx. 1 root root 14 Oct  5  2014 /etc/alternatives/cdrecord -> /usr/bin/wodim

The utility is provided by the wodim package. The information on that package on a CentOS 7 Linux system is shown below:

$ rpm -q --whatprovides /usr/bin/wodim
$ rpm -qi wodim
Name        : wodim
Version     : 1.1.11
Release     : 22.el7
Architecture: x86_64
Install Date: Sun 05 Oct 2014 07:53:08 PM EDT
Group       : Applications/Archiving
Size        : 899865
License     : GPLv2
Signature   : RSA/SHA256, Fri 04 Jul 2014 01:43:31 AM EDT, Key ID 24c6a8a7f4a80eb5
Source RPM  : cdrkit-1.1.11-22.el7.src.rpm
Build Date  : Mon 09 Jun 2014 07:32:01 PM EDT
Build Host  : worker1.bsys.centos.org
Relocations : (not relocatable)
Packager    : CentOS BuildSystem <http://bugs.centos.org>
Vendor      : CentOS
URL         : http://cdrkit.org/
Summary     : A command line CD/DVD recording program
Description :
Wodim is an application for creating audio and data CDs. Wodim
works with many different brands of CD recorders, fully supports
multi-sessions and provides human-readable error messages.

You can use the --version option to see the installed version of the utility.

$ cdrecord --version
Cdrecord-yelling-line-to-tell-frontends-to-use-it-like-version 2.01.01a03-dvd 
Wodim 1.1.11
Copyright (C) 2006 Cdrkit suite contributors
Based on works from Joerg Schilling, Copyright (C) 1995-2006, J. Schilling