Burning CD/DVD using the Shell

It’s not very difficult to write CD/DVD’s from the linux shell. Here’s is a short summary how to burn CD/DVD’s using mkisofs and cdrecord.
First of all, you have to create an ISO image, which you can write onto CD/DVD. I’m using mkisofs for this job:

$ mkisofs -J -v -r -o /tmp/myimage.iso /folder/to/burn
  • -v Verbose execution
  • -J Generate Joliet directory records in addition to regular iso9660 file names. (Windows compatibility)
  • -r Adapt file mode bits
  • -i Defines ouput image

After you created an ISO image, you can burn the image onto CD/DVD using cdrecord

$ cdrecord -v -eject -driveropts=burnfree -dao dev=/dev/hdc /tmp/myimage.iso
  • -v Increment the verbose level
  • -eject Eject the CD/DVD after process has finished
  • -driveropts=burnfree Turn on support for buffer underrun free writing
  • -dao Write your CD/DVD in Disk At Once Mode
  • -dev Define the device

That’s it – with increased verbose level, you can watch the process of your burn job.
Alternatively, you can create the image and burn the CD/DVD on the fly using linux pipes:

$ mkisofs -r /folder/to/burn | cdrecord -v -eject -driveropts=burnfree  dev=/dev/hdc -

In this case, mkisofs prints the image data to stdout. We catch this and redirect the image data directly to cdrecord. Note, that if mkisofs fails creating the image completely, cdrecord might rubish your CD/DVD.

Leave a Reply

You must be logged in to post a comment.