17

I tried dd, dd_rescue and ddrescue, all failed. I thought these tools bypass the filesystem and make a bitwise copy.

dd is fooled, it finishes but just produces a small file and states it's finished.

dd_rescuse and ddrescue are complaining about read errors and are intolerably slow. These tools can copy only a few MB in 10 minutes.

IMPORTANT: VLC is unable to open the DVD.

Why is this happening, why are these tools failing?


AnyDVD makes the disc copyable in a second on a Win7 host. It says that the UDF filesystem is patched, curiously, it also says that there are no bad sectors. The whole disc can be copied in 10 minutes.


UPDATE: As for the solution, see my similar question on superuser.

7 Answers 7

31

People mention that opening the DVD with VLC (which displays the DVD menu) magically makes the data accessible to dd, but nobody has yet explained why that is and how VLC accomplishes this feat.

I managed to replicate this behavior when trying to play a DVD in my computer from a Kodi device hooked up to my TV, by using SMB to share the root of the DVD drive over the network. It didn't work, unless I first opened the DVD with VLC, at which point Kodi could magically play the files.

This sort of magic offends my sensibilities, so I went digging. The underlying cause of the issue is that your DVD drive is working against you. As per Wikipedia:

However, if the drive detects a disc that has been compiled with CSS, it denies access to logical blocks that are marked as copyrighted (§6.15.3[2]). The player has to execute an authentication handshake first (§4.10.2.2[2]).

So it's not just that you will get encrypted data that can't be played if you read the DVD; the drive won't send back the bits unless some program on your machine has authenticated itself to the drive, using some DVD-specific IOCTLs exposed by the Linux kernel (in this case, DVD_AUTH). That's why this manifests as an I/O error.

More information on how these IOCTLs work is available in this mailing list post from the person who implemented them, but basically they provide a way for userland software to perform the secret handshake with the DVD drive hardware.

VLC performs this secret handshake through libdvdcss, which in turn seems to do it in GetBusKey() in css.c. Presumably a standalone program that linked against libdvdcss could be written to unlock the drive for access as files, instead of relying on all of VLC. Once it's unlocked, the drive can't tell which program is reading from it, so it sends back the (still encrypted but now readable) bits to anyone, including dd or cp.

(Interestingly, the DVD IOCTLs are also the only real way to get the decryption key used to decrypt the data on the disk, once you've read it. If you are playing a copied directory of files, you don't have access to the IOCTLs to get the keys, so libdvdcss resorts to statistical cryptanalysis to crack the encryption.)

5
  • Thanks. My DVD cannot be opened with VLC; unfortunately, my situation was a lot more complicated. Upvoted your answer nevertheless.
    – Ali
    Jan 9, 2019 at 7:48
  • This seems to have worked for me too. Though not all of my isos correctly show the dvd menu when opened in vlc afterwards (not a major though - I'm only doing this as a backup for my discs and not losing content is what matters to me here). I suspect tools like makemkv or handbrake might also have the same effect as vlc. As an aside, this worked for me with vlc running on Windows with dd running from within a Linux VM.
    – LRE
    Feb 27, 2019 at 4:56
  • Great explanation! Thank you interfect. That explains everything. I had the same puzzle but didn't workout which Wikipedia article to check out.
    – Shi B.
    Dec 16, 2019 at 13:23
  • 2
    There is also a program, cssauth, which can unlock the DVD from the command line. Essentially you type testdvd /dev/dvd and that's it. Apr 4, 2020 at 6:27
  • As I have said many times: My DVD cannot be opened with VLC.
    – Ali
    Mar 11, 2021 at 8:00
21

I think that the simplest answer is that dd, dd_rescue and ddrescue are not designed to defeat copy protection schemes. They make no assumptions about the format of the data and try to maintain the integrity of the whole of the original on disk data.

In the case of dd I suspect that it is terminating due to an intentional read error on the disk that is part of the copy protection scheme. It would help to confirm this if you included the commandline output from dd with your question. You may also find some read errors recorded in the dmesg command output.

You may get dd to copy more of the file by passing the noerror flag to it on the commandline. However you may find that this just leaves you with corruption in your final image.

3
  • Thanks, upvoted. If I bypass the filesystem and do a "bitwise" copy, and replace the read errors with zero bytes, would that still yield a corrupted image? After all I only replace that data with zero bytes that cannot be read anyhow. I will include the dmesg output later, I do not have the DVD with me.
    – Ali
    Feb 24, 2012 at 15:43
  • Really the only way to determine if the final image is "corrupted" is to work out if it is usable. Part of that will be making sure that only the actual broken blocks are read as zeros and none of the surrounding blocks. That might mean that you need to pass a bs=512 (from memory that is the CD/DVD blocksize) parameter to dd. Really though that sort of thing is what dd_rescue is designed to do. It might take time but it tries to lose the minimum amount of data possible.
    – Richm
    Feb 24, 2012 at 16:40
  • OK, thanks for all your help. I am screwed on way too many levels. I ended up using AnyDVD.
    – Ali
    Feb 28, 2012 at 21:08
15

I'm not sure why this works but opening the DVD first with VLC, just enough to view the menu, and then pausing lets dd work.

3
  • Thanks. My DVD cannot be opened with VLC; unfortunately, my situation was a lot more complicated.
    – Ali
    Dec 30, 2013 at 16:07
  • Worked for me at the time of this comment, but I opened with totem (don't have vlc). Weird.
    – Kyle
    Aug 5, 2016 at 18:32
  • As I have said many times: My DVD cannot be opened with VLC.
    – Ali
    Mar 11, 2021 at 7:59
4

I can confirm that opening the disc with VLC does bypass the protection. However, when using dd, I had to use this command after opening VLC (discovered by loading the disc and using the directory exposed in VLC).

dd if=/dev/sr0 of=image_of_disc.iso

Which is different from many posts I have read that say this command should work:

dd if=/dev/cdrom of=image_of_disc.iso - NON-WORKING

proof:

me@me:~$ dd if=/dev/cdrom of=/media/me/image_of_disc.iso
dd: error reading ‘/dev/cdrom’: Input/output error
103336+0 records in
103336+0 records out
52908032 bytes (53 MB) copied, 2.04212 s, 25.9 MB/s

me@me:~$ dd if=/dev/sr0 of=/media/me/image_of_disc.iso
dd: error reading ‘/dev/sr0’: Input/output error
2846992+0 records in
2846992+0 records out
1457659904 bytes (1.5 GB) copied, 314.351 s, 4.6 MB/s
me@me:~$ 
1
  • As I have said many times: My DVD cannot be opened with VLC.
    – Ali
    Mar 11, 2021 at 7:59
2

People mention that opening the DVD with VLC (which displays the DVD menu) magically makes the data accessible to dd, but nobody has yet explained why that is and how VLC accomplishes this feat.

I experienced the 'open DVD with VLC first' too. So, when using dd in my script I use this sequence:

cvlc --run-time 6 --start-time 16 /dev/sr0 vlc://quit 

`dd if=/dev/sr0 of=/home/user/Videos/name.iso`
3
  • 2
    What, exactly, are you saying?  Why do you quote the “nobody has yet explained why that is and how …?” question if you aren’t going to answer it?  Why do you show your dd command in backticks? … … … … … … … … … … … … … … … … … … … Please do not respond in comments; edit your answer to make it clearer and more complete. Apr 26, 2019 at 0:10
  • @G-ManSays'ReinstateMonica' basically the answer proposed using command line vlc to run without GUI, starting from the video at 16 second and play for 6 seconds and quite vlc after that. The numbers are a bit arbitrary, but it is a good alternative option.
    – Shi B.
    Dec 16, 2019 at 13:28
  • As I have said many times: My DVD cannot be opened with VLC.
    – Ali
    Mar 11, 2021 at 7:58
0

I can recommend a program called dvdbackup

I can make a copy of the back-up of the DVD as folders. I don't think it makes an iso. So you need to take that step manually.

0

I am aware that this question is pretty old but it still has some hits via the search engines. So let me sum up the background of the "issue" you are facing.

A generic movie DVD has three protection layers (part of the "Content Scramble System" or CSS):

  1. Region lock.
  2. Playback protection.
  3. Read protection to prevent byte copy.

Region Lock

The drive can deny access to the DVD if the region on the DVD does not match the drives region. This is a drive limitation and has to be circumvented by getting a suitable drive. As you can play the DVD in a media player, this is not the issue you are hitting here.

Playback Protection

The player decodes the video on play time by getting a key block from the DVD and having its own key and decrypting the video data. This is also not the issue you are hitting here.

Read Protection

The drive blocks access to logical blocks that are marked as protected. A player would execute an authentication handshake with the drive (again based on specific keys) to make the drive pass those blocks. This is the issue you are hitting here. VLC will do the authentication handshake process and therefore you are free to copy the files of.

More information can be found here: https://en.wikipedia.org/wiki/Content_Scramble_System

1
  • As I have said many times: My DVD cannot be opened with VLC.
    – Ali
    Mar 11, 2021 at 7:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.