15

When I was using DOS and Windows I've seen quite a selection of tools to check optical disks for readability and benchmark an optical drive itself. Most of them were even visualising the results in form of a pretty chart.

Are there any such for GNU/Linux OSes?

I'd prefer to have a full-featured visual GUI tool, but for the particular case I've got now, I just need to check if my CD drive can read every byte of a particular heavily-scratched CD-RW disk.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
Ivan
  • 17,368
  • 35
  • 93
  • 118

5 Answers5

8

To simply see if a drive can be read, you can use dd(1). This will read in the contents of the CDROM and will ignore/discard the data (note that the CDROM device may have another name on your system):

 dd if=/dev/cdrom of=/dev/null

It is also possible to compare this to an ISO image:

dd if=/dev/cdrom | md5sum - /path/to/file.iso

This will print a checksum for the CD and for the ISO file. If the checksums match, the CD contents match the ISO image.

ewindisch
  • 676
  • 4
  • 4
  • 1
    k3b is a graphical CD burning utility with built-in image verification and other neat features. – ewindisch Jan 12 '11 at 22:51
  • There's no need for `dd` here. `cat /dev/cdrom` and `md5sum /dev/cdrom /path/to/file.iso` will work just as well. – Gilles 'SO- stop being evil' Feb 12 '11 at 22:06
  • 2
    'cat /dev/cdrom' might work, but you then have to pipe the output via your shell to discard it. I don't think this is really a better solution than using dd which is entirely self-contained. Using 'dd' will also provide errors, statistics, and other useful information that 'cat' will not. – ewindisch Feb 18 '11 at 00:16
  • You're right that md5sum can do the comparison on the file itself. For simple comparisons, it can be a better solution. However, it can be useful to throw 'pv' in the middle there, or to script around 'kill -USR1' to provide statistics. Remember that we're talking about relatively slow media such as CDs/DVDs. Besides, as silly of a reason as it might be, using 'dd' provided symmetry to the other example. – ewindisch Feb 18 '11 at 00:23
  • 1
    When running `md5sum` on either the image from the CD or that on the hard disk one should consider the possibility of having trailing zeroes at the end of the .iso file. See [this answer](http://unix.stackexchange.com/questions/39467/how-to-verify-a-cd-against-an-iso-image/47821#47821) for more details. –  Sep 15 '12 at 09:55
6

For a low-level check, I found qpxtool. With my drive (which, to be fair, is not on the supported devices list), the results didn't make sense, but maybe you will have better luck.

Andy
  • 2,839
  • 23
  • 14
4

Command-line, there are readom (from cdrkit, a fork of cdrtools) and readcd (from Joerg Schilling's original cdrtools). Both can check for C2 errors.

There is also cdck, which will generate a text file that can be fed to gnuplot to get graphs.

landroni
  • 10,288
  • 12
  • 30
  • 48
derobert
  • 107,579
  • 20
  • 231
  • 279
3

I've used dvdisaster to help me recover data from a few DVD and CD-R coasters I burned. It's a GTK application, and probably available as a package on your favorite Linux distribution.

It has a nice graphical display showing which sectors are good and bad. It also keeps various statistics while reading your media.

dalcocer
  • 53
  • 2
1

There is also the command-line GDDRescue (GNU Data Rescue) which seems to be very flexible.

This review of several tools for recovering data from scratched CD/DVDs, including GDDRescue. I had much better experience with GDDRescue than with readcd: using mainly default configs, readcd stumbled on a badly scratched DVD; while ddrescue after some 72h of work nicely outputted a shiny .iso in which the read errors were minimized. As its man page states, ddrescue "tr[ied] hard to rescue data in case of read errors" and succeeded.

landroni
  • 10,288
  • 12
  • 30
  • 48