HowTo do a quick deep hashing/fixity of subfolders

Step-by-Step descriptions of how to do things.

HowTo do a quick deep hashing/fixity of subfolders

Postby peter_b » Sat Mar 02, 2019 4:01 am

You may find or search this under "md5deep", but the command - as well as its package - was renamed/superseeded by "hashdeep".
Where "md5sum" creates a textfile per folder, the command "hashdeep" can be used to create fixity information for a whole subfolder structure.

The basic command is simple:
Code: Select all
$ hashdeep -l -r -c md5 .

  • -l: Relative file paths: Makes the file more "portable" (easier to check even when moved to completely different location)
  • -r: recursive. Include subfolders.
  • -c md5: compute MD5 hashcodes.

I chose to do MD5 only, because I it's sufficient for data integrity checks, and I'm not using it for security.
Since hashdeep's default is MD5+SHA256, I dropped SHA256 to save computing power and speed up the process :D

The output looks something like this:

Code: Select all
%%%% HASHDEEP-1.0
%%%% size,md5,filename
## Invoked from: /media/pb/CAM_SD
## $ hashdeep -l -r -c md5 .

Links: ... integrity/

EDIT (May 17th, 2019):
Changed to relative paths (added "-l"), because I think it's the more regular use case that the files will be moved sooner or later.
Makes validation easier and less confusing.
  • 0

Last edited by peter_b on Fri May 17, 2019 6:29 pm, edited 1 time in total.
User avatar
Posts: 302
Joined: Tue Nov 12, 2013 2:05 am
Reputation: 3

Validating with existing hashdeep textfile

Postby peter_b » Sat Mar 02, 2019 5:07 am

Here's one way to check the current folder, with the data in the fixity textfile "MD5DEEP.md5":
Code: Select all
$ hashdeep -l -e -vvv -r -a -k MD5DEEP.md5 .

  • -l: Relative paths mode. Otherwise you'll only get "file moved" messages ;)
  • -e: Estimate time. Shows a progress indicator. Must-have for video handling.
  • -vvv: Tell us what you're doing. With less verbosity, you'll only see errors - and therefore "dark screen" while its computing. Better with "vvv" :)
  • -a: Audit mode = compare and verify/validate.
  • -k MD5DEEP.md5: The textfile that contains fixity data from hashdeep (MD5, etc). I've arbitrarily named it ""MD5DEEP.md5".
  • 0

User avatar
Posts: 302
Joined: Tue Nov 12, 2013 2:05 am
Reputation: 3

Return to HowTo's

Who is online

Users browsing this forum: No registered users and 2 guests

Who is online over last 24 hours

Users browsed this forum in the last 24 hours: No registered users and 4 guests

Reputation System ©'