1. Download the #1 Android News App:   EarlyBird - News for Android
    Dismiss Notice

MD5 Sum Mismatch

Last Updated:

  1. SimsDelt

    SimsDelt Well-Known Member

    So I installed the new Invernito Theme and didn't like it so I wanted to restore my last nandroid. Now I get a "MD5 Sum Mismatch" when I try to restore. Anyone know why I'm getting this. I unfroze everything I had in TiBu and then restored any .apks that I changed to .bak... just frustrating. When I installed the theme it changed something and made me start getting double messages in Handcent and I wasn't before... I want my nandroid back.

  2. SimsDelt

    SimsDelt Well-Known Member

    Wow. 30+ views and no one knows? I loaded Tranquility 2.3.5 back over everything. Instill can't use my old nandroid. But I made a new one just in case. When I loaded tranquility over the theme it killed all of it. Which was exaxctl what I wanted. Still weird that I can't use my old nandroid. Its the same version and everything.
  3. jdk33

    jdk33 Well-Known Member

    MD5sum is just a way of checking to ensure a files contents have not changed. When you initially do a Nandroid backup a md5sum is made against the backup. If you ever do a restore the md5sum of the backup will be checked to ensure the backup file is intact and not corrupted. I'd guess something happened on your sdcard that caused the backup to be modified, or the md5sum file was lost .

    Searching a bit, this seems to be a common problem. You can try regenerating the md5 hash as indicated in this post:

    [How To] Fix md5 mismatch nandroid restore - xda-developers

    Just keep this post in mind:

    scary alien likes this.
  4. scary alien

    scary alien not really so scary Moderator


    Well, you are getting the MD5 mis-match error because the MD5 checksums in the nandroid.md5 file do not match the checksums of one or more of the system.img, data.img, or boot.img files in your Nandroid's backup directory. Is is possible that, when you made the Nandroid backup, your phone did not have a nearly full charge? This appears to be one of the main reasons for such issues.

    I've done a little bit of research on Nandroid issues on the Eris. If you are interested, then check out these threads:



    Also, if you interested, I've created an app for checking MD5 (and SHA1) checksums on files that you've downloaded to your phone. It also has a jar-verification function for verifying signed .jar, .zip, .apk files. I'm working on re-vamping the app to make it look a little more professional and add a few, new features to it, but you (and anyone else) can get the app (for free) at:

    from XDA: xda-developers - View Single Post - [Begging] Devs - please publish your MD5's

    from AF: http://androidforums.com/eris-all-things-root/168942-phone-rom-checksum-verifier.html

    Hope this help. Cheers!
  5. scary alien

    scary alien not really so scary Moderator


    Interesting thread... Yeah, I probably wouldn't restore a Nandroid backup whose checksums didn't match. The non-matching checksums strongly imply to me that either one or more files is incomplete :)eek:) or that the nandroid-mobile.sh script was unable to properly calcuate the checksums for the *.img files.

    Thanks for the interesting info! Cheers!

    edit: by the way, post #2 in that thread reported that a space in the Nandroid backup directory's name was the cause of the MD5 mismatch. I'm a little skeptical of this, but I'd be more convinced if this were the case with Jonathan's backup. Typically, the custom recovery (Amon_RA for sure) will simply not be able to find Nandroid backups with spaces in them--don't think the MD5 check would come in to play until it can actually find the backup.

    2nd edit: post #15 (xda-developers - View Single Post - [How To] Fix md5 mismatch nandroid restore) does seem to confirm the space-in-the-filename issue...:p
  6. SimsDelt

    SimsDelt Well-Known Member

    My backup did have "Tranquility(space) 2.3.5" I made a new nandroid where I ran it all together.
    scary alien likes this.
  7. scary alien

    scary alien not really so scary Moderator

    That's gotta be it! Thanks to jdk33 for pointing out the new thread!

    Lesson: don't put spaces in your Nandroid backup directory ;).

    I'll be updating my Eris threads tonight...
    SimsDelt likes this.
  8. jdk33

    jdk33 Well-Known Member

    Glad we got to the bottom of it.. I'd imagine using spaces in the backup name is a common thing, surprised nandroid doesn't have an error checking routine in place to accomodate that situation.
    SimsDelt likes this.
  9. scary alien

    scary alien not really so scary Moderator


    Just a real-quick heads-up: a member in the Eris forums had put an ampersand (&) in one of his Nandroid backup's directory name. When he went to restore it, it hung and never came back... Removing the ampersand allowed the restore to occur normally.

    I suspect that the ampersand was causing the nandroid-mobile.sh script to be launched in the background and would not or could not return its finishing status back to the custom recovery that launched it.

    So anyway, avoid using spaces and ampersands in your Nandroid backup's directory names.

  10. SimsDelt

    SimsDelt Well-Known Member

    I just think you should use no spaces or symbols at all... For Example my last backup was called "Froyo2.3.15" , no spaces.
  11. someotherguy

    someotherguy Well-Known Member

    So making sure I'm reading this right. Renaming your Nandroid to take out the space didn't work or wouldn't work because the nandroid wasn't made correctly because part of the backup scripts couldn't handle the space. Correct?
  12. scary alien

    scary alien not really so scary Moderator

    Actually, the OP (Jonathan) did not indicate that he actually tried to restore the Nandroid backup after removing the space from the Nandroid backup's directory name. Rather, he simply re-ran the backup without a space in the backup's filename.

    I pulled-up a version of the nandroid-mobile.sh (v2.2.2) script that is used for the Eris and looked again at the MD5 checking code:

    Code (Text):
    1. [FONT=Courier New]cd $RESTOREPATH[/FONT]  (i.e., the full /sdcard/nandroid/.... backup directory path)
    3. [FONT=Courier New]<snip>[/FONT]
    5. [FONT=Courier New]if [ ! -f $RESTOREPATH/nandroid.md5$DEFAULTEXT ]; then[/FONT]
    6. [FONT=Courier New]$ECHO "[COLOR=blue]error: $RESTOREPATH/nandroid.md5 not found, cannot verify backup data[/COLOR]"[/FONT]
    7. [FONT=Courier New]exit 1[/FONT]
    8. [FONT=Courier New]fi[/FONT]
    10. [FONT=Courier New]<snip>[/FONT]
    12. [FONT=Courier New]$ECHO "Verifying backup images..."[/FONT]
    13. [FONT=Courier New]md5sum -c nandroid.md5[/FONT]
    14. [FONT=Courier New]if [ $? -eq 1 ]; then[/FONT]
    15. [FONT=Courier New]$ECHO "[COLOR=red]Error: md5sum mismatch, aborting[/COLOR]"[/FONT]
    16. [FONT=Courier New]exit 1[/FONT]
    17. [FONT=Courier New]fi[/FONT]
    As you can see, there is a test to check to see if the nandroid.md5 file exists. I would image that this test would fail if there is a space in the RESTOREPATH variable name (it certainly returns an error status 2 if you try to cd to a directory with a space in it without first escaping each space character).

    So, I'm still a little skeptical as to whether or not a space in the filename will lead to an MD5 mismatch error. From what I can tell, it should not. The only scenario that I can imagine is that if the particular version of nandroid-mobile.sh is coded differently from the above and is possibly interpreting an error status from the cd command as an error in the md5sum utility (which I still find unlikely).

    If the OP (Jonathan) still has the original Nandroid backup in question, it would be interesting for him to:

    - do an adb shell
    - cd to the Nandroid backup directory (escaping the space if necessary)
    - run md5sum -c nandroid.md5 (or busybox md5sum -c nandroid.md5)

    and report what he finds. This would actually tell us if there were MD5 checksum errors in his backup. He also did not indicate if he had a full charge on his phone when the Nandroid backup was made (or when the restore was attempted)--I don't for sure that having a low charge will make the reading from the /sdcard faulty or not (I do know that the nandroid-mobile.sh script will warn you if you attempt a backup or restore with less than 30% charge).

    It should look similar to the following:

    Code (Text):
    1. # [COLOR=blue]cd /sdcard/nandroid/<your phone's serial #>/BDS-20100821-1454-ieo[/COLOR]
    2. # [COLOR=blue]ls[/COLOR]
    3. ls
    4. boot.img
    5. system.img
    6. data.img
    7. nandroid.md5
    8. # [COLOR=blue]md5sum -c nandroid.md5[/COLOR]
    9. md5sum -c nandroid.md5
    10. boot.img: OK
    11. data.img: OK
    12. system.img: OK
    13. # [COLOR=blue]busybox md5sum -c nandroid.md5[/COLOR]
    14. busybox md5sum -c nandroid.md5
    15. boot.img: OK
    16. data.img: OK
    17. system.img: OK
    Jonathan, you game? :D
  13. scary alien

    scary alien not really so scary Moderator

    By the way, I just did a test (on my Eris) where I created a Nandroid backup, changed the backup directory from "BDS-20101001-0323" to "BDS-20101001 0323" (i.e., replaced the second dash with a space) and attempted a Nandroid restore.

    I did not receive an MD5 mismatch error, rather, I received the usual "Error: run 'nandroid-mobile.sh restore' via adb!" error instead. This is exactly what I would expect based on how the script and Amon_RA's recovery is coded.

  14. scary alien

    scary alien not really so scary Moderator


    Sorry to dredge-up such an old thread, but I saw your new thread tonight re. your Nandroid restore question and it made me remember about what I had posted here way back in September.

    I wanted to apologize since my last couple of posts here said that the issue you were having was due to a true MD5 mismatch (i.e., bad files) in your Nandroid.

    Subsequent testing (see this post if you want (warning, its a "TL;DR" type of deal :D): http://androidforums.com/htc-droid-eris/138831-verify-your-files-md5-checksums.html#post2499418) has revealed that ClockworkMod will indeed return an "MD5 mismatch" error for a Nandroid backup directory that contains spaces (or other wonky characters).

    The reason for this is that it tries to the MD5 checksum calculation (via the md5sum -c command), but since the directory name contains spaces and cannot be properly parsed when passed from custom recovery to the nandroid-mobile.sh script, it cannot find the nandroid.md5 file, but complains with the "MD5 mismatch" instead of something more useful like "can't find nandroid.md5" ;). Amon_RA custom recovery gets the same error, but does not report it.

    Anyway, apologies and I hope someone will chime-in to your newest thread and help you out.


Share This Page