1

I have a (read-only, commercial, dual-layer) DVD which I’m trying to create a backup copy of on my computer (because DVDs can be damaged). However, when I try to determine the size of the disc, I get inconsistent sizes:

$ blockdev --getsize64 /dev/sr0
7687522304
$ isosize /dev/sr0
7899633664
$ cat /sys/block/sr0/size 
15428972
$ echo '512 *' $(cat /sys/block/sr0/size) | bc
7899633664

Here, blockdev reports one size, and other things report a larger size. Unfortunately, dd, cat, etc. seem to use the size that blockdev reports, even though there seems to be data in the remaining 212111360 bytes: the disc images from dd or cat don’t work correctly, du -b on a mounted disc gives something approaching the larger size (not exactly, presumably due to filesystem overhead), and actually trying to access the mounted filesystem tends to give I/O errors.

Despite this, the disc plays correctly in a standalone player, and seems to work (sometimes, not reliably) with libdvdnav but not libdvdread.

What’s going on with the disc, and how to I get a backup copy?

EDIT: I added more details about the disc in question. I also plan on trying to back it up using Windows to take care of the immediate problem of “how do I get a backup copy” (or to get more information if that fails), but I’d still like to know what’s going on and how I can do this under Linux.

EDIT2: Windows itself seemed to work, but it does’t have any native disk imager. Cygwin was generating weird errors that seem unrelated, and a Windows program designed to create ISOs was finding a lot of bad sectors that didn’t show up on my Linux machine. Those were not the results I expected. I’m posting them here in case they give hints for my current problem, but I don’t expect they do.

EDIT3: It appears that sometimes the disc blockdev size gets “stuck” when changing discs. This appears to happen when I use the physical tray eject button instead of “eject” from the command line. Further investigation is required on my part (is this really the trigger?), but it seems to provide both an explanation (the system gets confused when I don’t unmount the disc properly, even though the programmers should have expected this more than with USB drives, especially with read-only media) and a potential workaround (get the blockdev size stuck on 8.5 GB).

Now that it may be relevant, I’ll add that I’m using Fedora 20, with systemd, which is automounting the discs in the /run/media/dhouck/<DISCNAME> folder. DISCNAME is determined automatically from the filesystem; I don’t know enough about UDF to say how but I doubt it’s relevant. When the size gets stuck, the DISCNAME part of that mount path also fails to change. I suspect that some part of the system is failing to notice the media being removed and thus failing to unmount appropriately.

  • Is it write protected DVD!? – user1436187 Oct 21 '14 at 6:12
  • It’s read-only because it’s a commercial DVD. – Daniel H Oct 21 '14 at 15:21
  • I think that's common on video DVDs. It's a kind of copy protection: the information is inconsistent, but dedicated DVD players only look at the correct sizes so only computers with full-blown OSes have trouble. – Gilles Oct 21 '14 at 23:45
  • I figured that’s what it was doing, but at first thought it was a mistake instead of deliberate (other DVDs in the set have the isosize smaller, but can only be read that far; that doesn’t seem to help with copy protection). It would still be nice to know how it does that and why libdvdnav can sometimes read beyond that point but other things can’t. – Daniel H Oct 22 '14 at 0:49
  • And I appear to have been right the first time—it doesn’t seem to have been done on purpose by the DVD manufacturers, or accidentally by them. This means that trying to work around it is not a violation of my understanding of the DMCA. IANAL. – Daniel H Oct 23 '14 at 6:16
0

It turns out that this problem was not caused by the DVDs themselves, but by Linux getting confused when I used the hardware eject button without unmounting the disc (the eject command works because it takes care of properly unmounting). I assumed that was safe because the discs are read-only and because I thought removing media without safely unmounting would only cause problems in writes.

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.