I've been looking to do something similar for a while. I use a GUI burner but it pretty much always produces false positives when it checks the disc for errors. I think I've found a reasonable method of checking the files through the terminal, but I pretty much just came up with it so I haven't tested it yet.
slackware isos* contain a text file that contains md5sums for all files in the iso. It looks something like this:
These are the MD5 message digests for the files in this directory.
If you want to test your files, use 'md5sum' and compare the values to
the ones listed here.
To test all these files, use this command:
md5sum -c CHECKSUMS.md5 | less
'md5sum' can be found in the GNU coreutils package on ftp.gnu.org in
/pub/gnu, or at any GNU mirror site.
MD5 message digest Filename
A single command is used to check the md5sums of all files on the disc against those stored in the text file. The problem is creating such a file, as md5sum does not work recursively. Enter md5deep. It can generate md5sums recursively and its output is identical to that in the slackware file.
So here's what I'm thinking. Assuming everything to be burned is in one directory, run the following command in that directory:
the 'r' is for recursive and the 'l' is for enabling relative file paths. The output will be something like this:
114849fd7b26188a6bae204b68a6d9a7 ./Free State Project.txt
Again, I haven't tested this, but conceivably you could pipe the output to a file in the directory to be burned, then after burning run
md5sum -c <file> | less
from the root directory of the disc.
*Actually this seems to be the means behind the "check disc" option in other distros as well.
It works, but there's a few caveats.
First, if you pipe the output of the md5deep
command into the directory you are 'md5deeping', you will end up with an entry for the piped file, which I think is guaranteed to be wrong. You may want to remove that entry, else you'll get a mismatch when running the md5sum -c
command doesn't seem to check the files in any logical manner (ie. alphabetically/numerically) even if you have no sub-directories. That's only an issue if you are OCD like me though. It doesn't affect the functionality of the process.
Finally, there's the time factor. I burned 11 files totaling 3.7 GB (based on du -h
). It only took about a minute to calculate the md5sums of the files on the HDD, but seven minutes to verify the files on disc.
Also, it is not necessary to actually burn the md5sum file to the disc. When you go to run the md5sum -c
command, cd to the root directory of the disc and specify a path for the file, relative or absolute.