Howto: Linux write (burn) data to DVD or DVD/RW

by LinuxTitli · 13 comments

In order to write DVD/DVD-RW from shell prompt you need to install a package called dvd+rw-tools.

DVD is another good option for backup, archiving, data exchange etc. You can install dvd+rw-tools with following commands. Also note that this package works under *BSD, HP-UX, Solaris and other UNIX like operating systems.

Debian installation:
# apt-get install 'dvd+rw-tools'

Fedora Core Linux installation:
# yum install 'dvd+rw-tools'

RedHat Enterprise Linux installation:
# up2date 'dvd+rw-tools'

In order to write DVD you need to install cdrecord tools.

How do I write DVD?

You need to use growisofs command, which combined mkisofs frontend/DVD recording program. From growisofs man page, "growisofs was originally designed as a frontend to mkisofs to facilitate appending of data to ISO9660 volumes residing on random-access media such as DVD+RW, DVD-RAM, plain files, hard disk partitions. In the course of development general purpose DVD recording support was implemented, and as of now growisofs supports not only random-access media, but even mastering of multiession DVD media such as DVD+R and DVD-R/-RW. In addition growisofs supports first-/single-session recording of arbitrary pre-mastered image (formatted as UDF, ISO9660 or any other file system, if formatted at all) to all supported DVD media types."

First create the ISO image
# mkisofs -r -o /tmp/var-www-disk1.iso /var/www

Now use the growisofs command to write the ISO onto the DVD:
# growisofs -Z /dev/dvd=/tmp/var-www-disk1.iso

To append more data for same DVD:
# growisofs -M /dev/dvd /tmp/file.1

To format (erase) a DVD:
# dvd+rw-format -force /dev/dvd
OR
# dvd+rw-format -force=full /dev/dvd

The dvd+rw-format command formats dvd disk in the specified dvd drive.

To display information about dvd drive and disk using dvd+rw-mediainfo command:
# dvd+rw-mediainfo /dev/dvd

See also:

Featured Articles:

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 13 comments… read them below or add one }

1 Hans-Werner 07.12.06 at 10:32 am

Since growisofs has an inbuilt functionality that allows to directly pipe mkisofs’s output, it is probably more common that you call it without making an ISO beforehand. Note also that it’s absolutely not needed to format a DVD+RW more than once. You can just write again with the -Z option in later runs. Yes, this is different from CD-RWs.

2 johhnycomelate 07.12.06 at 8:22 pm

man growisofs is a much better manual to using growisofs

3 BasketCase 07.13.06 at 2:25 pm

Since having growisofs make the iso as it burns has already been mentioned here is another tip…

Before you start burning use par2create from par2cmdline (http://parchive.sourceforge.net/) to generate enough par2 recovery blocks to fill any space that is left on the disc. That way if the disc gets damaged later you may be able to recover the lost data.

I have written a perl script to calculate out the correct number of par2 blocks to generate and to do it (it also makes a .md5 file). I have published the script here: http://www.sanitarium.net/unix_stuff/par2calc.txt

4 notme 10.25.06 at 4:38 pm

if the DVD gets damaged, how can you recover the file? Even it’s not only that the file is corrupted. It’s also that you can’t actually read the dvd. The dvd reader woudl go crazy and you wouldn’t be able to copy the damaged file to disk, afaik?

5 nixcraft 10.25.06 at 6:06 pm

Heh
perhaps what op or his script suggesting that you can recover particular block provided that DVD can be read by DVD drive.

But in most case DVD reader refuses to read corrupted DVD. I have used Sony, HP, Samsung DVD/RW etc none of they were able to read corrupted DVD.

6 Jason 01.30.07 at 11:05 pm

Thanks for the howto, I don’t think I would have figured out which tool to use otherwise.

7 RichardBronosky 02.04.07 at 8:40 pm

True, the man page for growisofs has more complete info, but I would have never know to look for growisofs without the page. I would not have felt confident in using mkisofs and growisofs together without this example. So I’d like to thank the author for his redundancy. This explanation works for the way I think.

8 The Evil Bald Person 11.26.07 at 9:13 pm

Using PAR2 on removable media is not as daft as some of you think.

I’ve read from a CD in the past where an edge… erm, chord, containing data had actually broken off!

Just use dd it to a disk image (possibly adding options conv=noerror,sync).

It’ll probably make loads of strange noises and take ages, but you should be able to do it depending on where the damage is… unles your disk blows up in the process of course!

9 Levi Arias 02.27.08 at 7:10 pm

I have a Acer laptop and when I put a cd/dvd disk in it the message says…No disc in drive E:

10 dj 03.11.08 at 2:23 am

Nice.

How about DVD-RW packet-writing and UDF filesystem.

11 sohail 03.13.08 at 5:00 pm

Will these steps work on RHEL4/RHEL5?

Will we need to mount the DVD drive before burning?

12 vivek 03.13.08 at 6:11 pm

Yes it should work on RHEL 4 / 5. No need to mount dvd.

13 Saynos 02.22.09 at 1:26 pm

I had a broken(?) DVD RW disc, that NeroLinux isn’t wrote. I run “dvd+rw-format -force=full /dev/dvd ” command on my Gentoo, later I wrote that DVD without any problem! Thaks a lot! :-)
(and sorry ma bad English)

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post:

Next post: