How to burn an ISO or NRG image to a DVD from the command line on Linux

Last updated on December 1, 2020 by Dan Nanni

Question: I need to burn an image file (.iso or .nrg) to a DVD using a DVD writer on my Linux box. Is there a quick and easy way, preferably using a command-line utility, to burn an .iso or .nrg image to a DVD?

The two most popular formats for image files are ISO (.iso file extension) and NRG (.nrg file extension). The ISO format is a global standard created by ISO (International Organization for Standardization), and therefore is supported natively by most operating systems, allowing a high level of portability. On the other hand, the NRG format is a proprietary format developed by Nero AG, a very popular disc imaging and burning software firm.

Let's say you have created a video DVD in ISO format, and want to burn the ISO image to a DVD. The easiest way to do that is via Linux command line.

Here is how to burn an .iso or .nrg image to a DVD from the command line on Linux.

Convert an NRG Image to ISO Format

Due to ISO's widespread adoption, burning an .iso image to CD/DVD is straightforward. However, burning an .nrg image requires converting the image to .iso format first.

To convert an .nrg image file to .iso format, you can use nrg2iso, an open source program that converts images created by Nero Burning Rom to standard .iso (ISO9660) files.

Install nrg2iso on Linux

To install nrg2iso on Ubuntu or Debian:

# aptitude install nrg2iso

To install nrg2iso on CentOS or RHEL:

First, you need to enable Repoforge repository before running the following yum command. On Fedora, simply run:

# yum install nrg2iso

Once the nrg2iso package has been installed, use the following command to convert an .nrg image file to .iso format:

# nrg2iso filename.nrg filename.iso

When conversion is complete, an .iso file will appear inside the current working directory:

Burn an .ISO Image File to a DVD

In order to burn an .iso image file to a DVD, we will use a tool called growisofs:

# growisofs -dvd-compat -speed=4 -Z /dev/dvd1=WindowsXPProfessionalSP3Original.iso 

In the above command-line, the -dvd-compat option provides maximum media compatibility with DVD-ROM/-Video. In write-once DVD+R or DVD-R context, this results in unappendable recording (i.e., closed disk).

The -Z /dev/dvd1=filename.iso option indicates that we burn the .iso file to the media found in the selected device (/dev/dvd1).

The -speed=N parameter specifies a burning speed of a DVD burner, which is directly related to the capability of the drive itself. -speed=8 will burn at 8x, -speed=16 at 16x, and so on. Without this parameter, growisofs by default assumes the lowest speed available, which in this case happens to be 4x. You should choose the burning speed from the available speeds in your drive and the type of disks that you have.

You can find the device name of your DVD burner and its supported writing speed using this tutorial.

When the burning process has been completed, the disk should be automatically ejected from the tray.

Check the Integrity of a Burned Media

At this point, you can check the integrity of the burned media by comparing the md5 checksum of the original .iso file with the same checksum of the burned DVD. If both are identical, you can rest assured that the burning was successful.

However, in case you have converted an .nrg image to .iso using nrg2iso, you need to be aware that nrg2iso creates an .iso file whose size is not a multiple of 2048 (as ordinary .iso files are). Thus, an ordinary comparison between the checksum of this .iso file and the contents of the burned media will differ.

On the other hand, if you have burned an .iso image that does not come from an .nrg file, you can use the following command to check the integrity of the data recorded in a DVD. Replace /dev/dvd1 with your own device name.

# md5sum filename.iso; dd if=/dev/dvd1 bs=2048 count=$(($(stat -c "%s" filename.iso) / 2048)) | md5sum

The first part of the command (up to the semicolon) calculates the MD5 checksum of the .iso file, while the second part reads the contents of the disk present in /dev/dvd1, and pipes them into the md5sum tool. bs=2048 indicates that dd will use a block sector of 2048 bytes as many times as the size of the original iso file divided by 2048.

If the two MD5 checksum values are identical, it means that the burned media is valid.

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal (Credit Card) or Bitcoin (BTC Wallet: 1M161JGAkz3oaHNvTiPFjNYkeABox8rb4g).

Xmodulo © 2020 ‒ About ‒ Powered by DigitalOcean