8

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.

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.

14

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.

  • 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 '12 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 '12 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 '12 at 21:08
12

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.

  • Thanks. My DVD cannot be opened with VLC; unfortunately, my situation was a lot more complicated. – Ali Dec 30 '13 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 '16 at 18:32
6

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.)

  • Thanks. My DVD cannot be opened with VLC; unfortunately, my situation was a lot more complicated. Upvoted your answer nevertheless. – Ali Jan 9 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 at 4:56
2

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:~$ 
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

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`
  • 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. – G-Man Apr 26 at 0:10

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.