User Tools

Site Tools


linux:cd-dvd-hash-without-iso

How to md5sum a cd/dvd without the ISO

Scenario

You want to backup something or you have to burn a directory on a cd/dvd and you want to create a md5 checksum to save on the same medium.

Problem

You try to use md5sum utility but it allow only 1 file at a time so you can't use on a CD/DVD unless you create an ISO for this only purpose! :-\ Furthemore, if you create a checksum of the iso, you can't put into the iso/cd/dvd because that would change the checksum itself! But it's very awful to keep it apart unless the purpose is not only for publishing a distro on a website. But we don't want that. We want a backup with the checksum inside, all-in-once.

Solution

Install md5deep

sudo apt-get update && sudo apt-get install md5deep

You can now use this command

md5deep -rl * > mychecksum

Now you put the file mychecksum on the medium with all the other files.

When you want to check the integrity of the files on the medium you have 2 solutions: Negative match: will show only the wrong files

md5deep -rx mychecksum *

or even using the onnipresent md5sum

md5sum -c --quiet mychecksum

The only difference between the two solution is that md5deep can also show you if there are files in excess, but that is useless for integrity check of a cd/dvd; can be useful only in case of synchronizations.

linux/cd-dvd-hash-without-iso.txt · Last modified: 2014/09/12 16:40 by rik