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
blockdev reports one size, and other things report a larger size. Unfortunately,
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
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
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.