LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   md5sum - Really? (https://www.linuxquestions.org/questions/linux-newbie-8/md5sum-really-4175474089/)

junior-s 08-20-2013 11:02 PM

md5sum - Really?
 
I'm checking a DVD for errors and it's output is very long (it's a debian DVD), so I can't scroll back up to see if any error was found. The command I use is
Code:

md5sum -c md5sum.txt
I wonder if any error will be reported at the end of the check?

astrogeek 08-20-2013 11:07 PM

Quote:

Originally Posted by junior-s (Post 5012873)
I'm checking a DVD for errors and it's output is very long (it's a debian DVD), so I can't scroll back up to see if any error was found. The command I use is
Code:

md5sum -c md5sum.txt
I wonder if any error will be reported at the end of the check?

The -c makes it run an md5sum for every file on the DVD... potentially long list.

Do it on the DVD or iso without the -c to get an md5 check of the DVD itself.

junior-s 08-20-2013 11:19 PM

I really want to make sure all files are OK since I'll be installing this system. I have no problems with the long list it's just that I don't know if any error will be displayed at the end of it, because the list is so long I can't even get to the top so look for errors.

EDIT:

Nevermind, somehow it fit in the Terminal =)
The output didn't even fit here
Code:

The text that you have entered is too long (314985 characters). Please shorten it to 30000 characters long.

astrogeek 08-20-2013 11:34 PM

Quote:

Originally Posted by junior-s (Post 5012883)
I really want to make sure all files are OK since I'll be installing this system. I have no problems with the long list it's just that I don't know if any error will be displayed at the end of it, because the list is so long I can't even get to the top so look for errors.

EDIT:

Nevermind, somehow it fit in the Terminal =)
The output didn't even fit here
Code:

The text that you have entered is too long (314985 characters). Please shorten it to 30000 characters long.

Then you could redirect it to a file, or better yet just catch anything that fails and throw away the rest, like this:
Code:

md5sum -c md5sum.txt 2>&1 |grep 'FAIL' |tee failedsums.txt
That will filter only those that fail, write them to the screen and save a copy in the file failedsums.txt

junior-s 08-20-2013 11:37 PM

Thanks! Much appreciated! :D

astrogeek 08-20-2013 11:39 PM

Quote:

Originally Posted by junior-s (Post 5012890)
Thanks! Much appreciated! :D

You are welcome! Good luck!

rknichols 08-21-2013 08:20 AM

The md5sum utility has a perfectly good "--quiet" option to suppress the "OK" messages for all the successful checks and leave only the errors, though you might find yourself wishing for some sort of progress mark for the long job of checking all the files on a DVD.

TobiSGD 08-21-2013 08:51 AM

Regardless if it is only one file that is damaged, the md5sum of the whole DVD will report that error. So it is rather pointless to check all files on the DVD, when the md5sum of the whole DVD is sufficient to detect a damaged disc.

rknichols 08-21-2013 12:36 PM

A complication with checking the whole DVD is that the DVD is padded with zeros at the end, and those change the MD5 hash. You have to find the size of the of the original image that was burned to the DVD and do the md5sum check over just that many bytes. Finding that size can be difficult if you don't have the original image, which might or might not be a pure ISO9660 image for which you can use the isosize command to find the original size.

rtmistler 08-21-2013 01:16 PM

I didn't realize that a debian distribution went through the effort to create an md5sum file describing all files on the DVD. junior-s, did you create that file? As other's have said, check the ISO file and leave it at that.

junior-s 08-21-2013 01:50 PM

Quote:

Originally Posted by rtmistler (Post 5013267)
I didn't realize that a debian distribution went through the effort to create an md5sum file describing all files on the DVD. junior-s, did you create that file? As other's have said, check the ISO file and leave it at that.

No, Debian and it's forks make the md5sum.txt file so what you can check file by file.
I don't bother this method, takes less than 10 minutes =]

dt64 08-27-2013 07:49 AM

Quote:

Originally Posted by junior-s (Post 5012873)
... so I can't scroll back up to see if any error was found

You should be able to scroll back in such situations using <SHIFT> + <PageUp>.


All times are GMT -5. The time now is 06:58 AM.