I have an ISO file, which I burned to a CD. Now how can I check if the CD is correctly created? I would like a command that calculate the hash sum that I can use to check with the hash sum I calculate on the ISO file. Ideally the command should:
- Work regardless of the ISO file: that is, I don't want to keep a list of hash sum for each file in the disc, or remember the number of blocks whatever
- Be relatively short: a one-line command is great, a chain of commands which is two line long is OK, a script that span one page is not
- Be fairly efficient: for example,
dd
the disc back to a file then runmd5sum
on the file is unacceptable
If there is no answer that cannot satisfy all I will appreciate the nearest match too. Even better if you can tell me why it is not so straight-forward.
dd if=/dev/cdrom |
to</dev/cdrom
. There's nothing magical aboutdd
and block devices, it's just a stream manipulation command with a funny syntax. – Gilles 'SO- stop being evil' Nov 05 '10 at 18:26dd
withbs
of the device cache size can speedup data transfer as opposed to plain input redirection. – alex Nov 06 '10 at 04:51dd
with a largebs
can speed up data transfers between two local drives (even more so between two locations on the same local drive) (typically a few MB gives you top speed, though I don't think it's related with any device cache size). Here there is no disk-to-disk transfer, only disk-to-memory, so all the extradd
step does is to add a (probably negligible) bit of running time (there is no advantage on the disk side, and there is one extra memory-to-memory copy step, but it's dwarfed by the MD5sum calculation). – Gilles 'SO- stop being evil' Nov 06 '10 at 12:00dd
to backup drive partitions, so you're probably right. – alex Nov 06 '10 at 13:11