Gentoo Wiki ArchivesGentoo Wiki

HOWTO_Backup_a_DVD


This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

Contents

Introduction

There are a number of reasons to get a clean backup of a DVD. For one, you may not like the way a movie looks when re-encoded from MPEG2 to MPEG4. Another reason is that you may live in a home where your original discs are likely to get broken, scratched or unusable easily. Or, perhaps you simply want to strip all the commercials and menus and have just the main movie. For whatever your reason, it is possible, and though there a lot of tools available, it's not always the easiest of tasks.

While there are a lot of guides out there that cover how to rip and re-encode your DVD movies to another format, this one will take a different approach. The goal of this guide is to explain how to make a complete or partial backup of your movies on DVD. No re-encoding will be covered. Just rip, maybe modify, and re-burn.

If, instead, you are looking for a guide that will take you through the entire process of ripping, re-encoding, and burning a DVD, then please visit the excellent HOWTO Create a DVD.

Note: Please be aware of local laws regarding copyright and fair use.

Mirror Backup

As always, there are a lot of ways that you can backup your DVDs. Fortunately, it's also quite easy once you know how. We'll cover a few of them here. CLI tools are covered first.

ARccOS & Other intentional sector corruption

Sony has released a "copy-protection" system wherein sectors on the DVD disc have bad CRC checksums. There exists no single software solution for Linux that enables backup of these protected discs, but several pieces of software in combination can be used to successfully counter this type of intentional corruption. First generate a bitwise copy of the good sectors on the disc:

ddrescue -n -b 2048 /dev/hdb ratatouille.iso ratatouille.log

The -n option is used because we're not dealing with accidental corruption here; there can exist no data in the bad sectors else the DVD would not play in ordinary DVD players. It doesn't make sense to try to recover data that was not there to begin with. The DVD sector size is always 2048, so we pass that to ddrescue since its default sector size is 512.

Now that we have an image without corrupted sectors, we can decrypt the contents successfully:

dvdbackup -i ratatouille.iso -o . -M -n RATATOUILLE

If parts of the DVD indexes were corrupted (as the case with ratatouille), mkisofs will refuse to generate a new (unencrypted) DVD image. Fortunately this corruption can be fixed with the help of IfoEdit (search google, its a Windows program). Run IfoEdit using Wine and (both to improve the usability of the DVD and to fix the broken IFOs) use its region-free functionality to remove region restrictions and rewrite valid IFOs. Once that is complete mkisofs can be used to generate a new DVD image that can be burned to a DVD disc:

mkisofs -dvd-video -o rat.iso -V RATATOUILLE RATATOUILLE

Then you can burn the image as documented elsewhere.

NOTE: the above information may be outdated. The given command for dvdbackup doesn't work and instead complains abou not being able to seek the dvd device. However, running two ddrescues on a dvd image created an ISO that k9copy could manage. eg:

ddrescue -n -b 2048 /dev/hdb tmp.iso tmp.log

ddrescue -n -b 2048 /dev/hdb readyforK9copy.iso readyfork9copy.log

and use k9copy to rip readyforK9copy.iso

dd

dd is rather a simple way to backup a dvd. May not work on dual-layer DVDs.

$ dd if=/dev/dvd of=DVD.iso bs=2048

Even if it does work on dual-layer DVDs (it usually does in my experience) it may still not work on many DVDs. You may see something like this:

dd: reading `/dev/dvd': Input/output error

after it has copied only a small part of the DVD. Opening the DVD with a media player or 'filestat' from the libdvdread package before issuing the 'dd' command can solve this problem. If that did not work try 'cat /dev/dvd > /dev/null', and cancel that command shortly after by pressing 'Ctrl+C', then try dd again.

ddrescue

If the disk is damaged, ddrescue might also be useful. To install ddrescue:

emerge ddrescue

To read the disk, or at least what can be read of it:

ddrescue /dev/dvd DVD.iso DVD.log
(Fedora User: can someone please confirm on Gentoo? --> a "-l" is required before the log-file name, or the app will not start)
(Ubuntu User: I can confirm that it works the way this page states: no '-l' required)
(Debian User: I can confirm that it wont work the way this page states: '-l' required)
(Debian Sid User: Can confirm that it won't work this way: must specify /sbin/ddrescue due to where the gddrescue package installs ddrescue. Options work as stated.)

If ddrescue reports errors, try a second pass with direct disc access activated:

ddrescue -d -r1 /dev/dvd DVD.iso DVD.log

Example output:

Press Ctrl-C to interrupt
Initial status (read from logfile)
rescued:         0 B,  errsize:       0 B,  errors:       0
Current status
rescued:   458027 kB,  errsize:    337 MB,  current rate:    1511 kB/s
   ipos:   795410 kB,   errors:    6221,    average rate:    1495 kB/s
   opos:   795410 kB

ddrescue also maintains a log file, so it is possible to pause and resume the rescue process.

vobcopy

Using vobcopy is one easy way to backup an entire DVD. First, emerge media-video/vobcopy.

# emerge vobcopy

Next, insert your DVD into your DVD drive, and mount the device.

$ mount /dev/dvd

vobcopy has a lot of options for backing up the DVD files, but for now we'll just use the "mirror" option.

$ vobcopy -m

Backing up the DVD will take some time, so go take a break for a few minutes. The more content on the DVD, the longer it will take.

When it's finished, vobcopy will have dumped all the data into a directory named after the title it got from the disc, generally all in CAPS. Then, in that directory, there should be a VIDEO_TS and sometimes an AUDIO_TS directory.

Now you have an exact mirror copy of your DVD. If you were to burn that data right now, and put it in your standalone DVD player, it would play just like the old one -- menus, chapters, everything. We'll cover burning DVDs later in the guide.

dvdbackup

(vobcopy is an older cousin of dvdbackup.)

Emerge dvdbackup:

# emerge dvdbackup

How to use:

$ dvdbackup -h
Usage: dvdbackup [options]
       -i device       where device is your dvd device
       -v X            where X is the amount of verbosity
       -I              for information about the DVD
       -o directory    where directory is your backup target
       -M              backup the whole DVD
       -F              backup the main feature of the DVD
       -T X            backup title set X
       -t X            backup title X
       -s X            backup from chapter X
       -e X            backup to chapter X
       -a 0            to get aspect ratio 4:3 instead of 16:9 if both are present
       -h              print a brief usage message
       -?              print a brief usage message
       -i is mandatory
       -o is mandatory except if you use -I
       -a is option to the -F switch and has no effect on other options
       -s and -e should preferably be used together with -t

Example backup:

$ dvdbackup -M -i /dev/dvd -o /output/dir

This example will backup the entire dvd. dvdbackup will create a directory inside /output/dir with the name of the disc, i.e. /output/dir/SAMPLE_DVD. This directory can then be made into an iso file for archiving or burned directly to disc.

lxdvdrip

lxdvdrip is a "all in one" solution for backups of dvd. You can choose from various ripping, burning, previewing, and muxing tools. It has a feature to detect forced subs that most other tools are lacking in. The rc file is well documented and should not give any problems. A very nice feature is the combination of lxdvdrip with dvdwizard, which enables you to build audio selection menus and thumb chapter preview menus. If you are stuck on CLI, it is probably the best solution for this job. lxdvdrip is in portage.

UPDATE: Starting with lxdvdrip 1.6 there is a new stream engine included called vamps-menu. Using this engine it is possible to keep original menus as it is using k9copy. The feature is flagged as experimental. If in problems have a look at the CHANGELOG/README. So no more need to pollute your box using WINE, even if no X installed.

K3b

K3b is another way to backup a DVD, and this one is just as simple. And, if you prefer a GUI environment, then this is the method for you.

If you haven't already, emerge app-cdr/k3b with at least the dvdr USE flag.

# echo "app-cdr/k3b dvdr css" >> /etc/portage/package.use
# emerge k3b
Note: The css flag is required to rip encrypted DVDs
Note: If you want to install k3bsetup to handle stuff like managing permissions, add kde to the USE flags for k3b as well.

Once that's done, fire it up, and from the Tools menu, select "Copy DVD". The defaults will be fine, so just hit the "Start" button.

This will backup your DVD first to the harddrive, and when finished, prompt for a writable one. If you have two DVD drives (one burner, one read-only for example) then you can put the original in the read-only drive, and a blank disc in the burner and it will do everything for you.

Image:K3b_backup_dvd.png

If k3b cannot eject the disc for you, then run eject from the command line as root.

# eject

If it complains about which device to use, specify your DVD drive:

# eject /dev/dvd

k9copy and dvd95

k9copy and dvd95 are the first tools that are able to shrink the entire contents of a dual-layer DVD so that it can fit on a single-layer DVD (similar to DVD Shrink). All other tools lack in the ability to copy the original menus. k9copy is a GUI/KDE application, dvd95 is a GUI/GNOME application.

vlc

Many newer Sony DVDs have ARccOS protection, which causes most programs to hang in the first few hundred megabytes on some corrupted sectors. VLC is able to rip these with this command:

# vlc dvdsimple:///dev/dvd@1 --sout "#standard{access=file,mux=ps,dst=/home/user/file.ps}"

The downside to this method is that it is considerably slower than ripping with other tools, but it is the only native linux tool that can rip these DVDs.

The reason I specify dvdsimple:/// instead of dvd:/// here is because on some DVDs, the menu is hardcoded to kick in right after the title finishes, and some versions of VLC honor this even when streaming to somewhere other than a video output device. This leads to VLC mercilessly and endlessly adding the menu video to the end of the title that we are trying to copy until you either hit the stop button or CTRL+C, which isn't the behavior we desire. Using dvdsimple:/// instead of dvd:/// disables the menu altogether, avoiding this problem.

Partial Backup

See HOWTO Create a DVD:Encode

DVD Burning

See HOWTO Create a DVD:Burn

Retrieved from "http://www.gentoo-wiki.info/Rescue_or_backup_DVDs_and_CD-ROMs"

Last modified: Sun, 28 Sep 2008 22:49:00 +1000 Hits: 84,606

Created by NickStallman.net, Luxury Homes Australia
Real estate agents should list their apartments, townhouses and units in Australia.