[Solution] MD5 mismatch error

Search This thread

vishal24387

Inactive Recognized Contributor
May 11, 2011
3,936
1,976
35
Solapur, Maharashtra
Few days ago I faced MD5 mismatch error while restoring my backup after messed with my phone. But due to this error I couldn't restore backup. I asked many people but people said that I should now flash sock firmware which was really a headache for me.

Anyway I searched alot on xda & I found very easy solution.

It don't require pc or adb shell etc. It only requires rooted phone with Terminal Emulator app :)

STEP 1: Open Terminal Emulator

Step 2: Use the following commands. (DON'T FORGET TO REPLACE "2012-01-01.10.09.36" WITH YOUR OWN BACKUP FOLDER NAME WHICH WILL BE PRESENT IN folder /clockworkmod/backup/)

Code:
su
#mount -o remount rw /sdcard
#cd /sdcard/clockworkmod/backup/2012-01-01.10.09.36
#rm nandroid.md5
#md5sum *img > nandroid.md5

STEP 3: (This will create a new "nandroid.md5" file without ANY "md5 mismatch" errors :D)
Reboot your phone and enter Recovery mode & then restore.

I hope it will help you in future :)
ENJOY...:D

IMP NOTE :- Many times people change backup folder name which can create this error. So be sure that you have not changed your backup folder name & also be sure that there is no space in backup folder path.

Credit goes to UsmanJ member. I have just shared with you guys with more good explanation.

Original thread HERE
 
Last edited:

falex007

Senior Member
Apr 3, 2011
662
225
Ottawa
If you do this you can't be sure that your backup isn't broken. md5 needs exactly for checking this. Yes, you cheated the check system, but are you sure that your backup integrity is fine?
 
  • Like
Reactions: bscraze

silentvisitor

Senior Member
Mar 15, 2012
4,520
2,652
This problem is mainly due to folder name change. If you don't change folder name you shouldn't be having this problem.
 

Taraen

Senior Member
Sep 30, 2011
213
156
Well, I think this is no hint you should use. When creating a new backup md5 hashsums are calculated for each file. If you now want to restore it these hashsums are calculated again and compared to the previous ones. Only if the data is the same as before , in other words your backup hasn't been damaged, the checksums match. You may have had some luck that the error happened in a file that does not get used very often but in general you do not want to do that, just imagine your kernel backup is broken!

Sent from my GT-I9003 using XDA
 

iAmBalvinder

Senior Member
Apr 5, 2012
224
59
New Delhi
The error is not only because of changing the name of folder, as vishal says md5 mismatch can occur.

I even encountered the following problem with nandroid backup.

stock gb,xxkpu nandroid not compatible over cm9 or miui.
Or miui/CNET not compatible over stock rooted ROM.

I'm not sure of the reason why this error occurs while reporting the nandroid backup, but according to my limited knowledge of Android, I suppose either ext4 partition is not compatible over rfs of stock and vice versa or, out might be a kernel clash.

To be true, I didn't even try to search much about the issue as I'm mostly free and take the pain of customizing three new firmware as power my preference and reinstalling the app :eek:

Sent from my GT-I9003 using xda premium
 

iAmBalvinder

Senior Member
Apr 5, 2012
224
59
New Delhi
If anyone is sure of the error and it's solution, the answer is most welcome.

P.s. while restoring out doesn't say md5 mismatch (I've also come across this though), the error I stated cannot restore the boot image atty the first place.

Sent from my GT-I9003 using xda premium
 

vishal24387

Inactive Recognized Contributor
May 11, 2011
3,936
1,976
35
Solapur, Maharashtra
@ Iambalvindar

You are right bro. There can be number of reasons about this md5 mismatch error. Actually the solutuion which I have provided is just an option to correct error :) If error is due to other reason such corrupted backup then obviously the solution given in my thread will not be applicable.
 

loSconosciuto

Senior Member
Nov 21, 2011
765
2,817
The first two commands ('su' and 'mount') are not necessary because:
  • You don't need root permissions to edit stuff in /sdcard
  • /sdcard is always mounted as RW (that's what the second command does.)
EDIT:
I've just remembered that if you don't have busybox installed you don't have the 'md5sum' command avaible for the user.
However our CF-root kernels come with an inbuilt busybox, but it can't be used as normal user, because if I remember correctly all the symlinks are in /sbin, where the user has no access. So, probably, you need to do this as root (= type the 'su' command as in the OP).

Anyway, nandroid.md5 is the last thing made during a backup. That means if you don't have enough space for the backup and it stops, this file is not created. So, when you go to restore that backup, you have the mismatch error. In this case, if you create the nandroid.md5 as vishal wrote, you'll have a usable and damaged backup. So, before doing this, check if nandroid.md5 is there or, when you run "rm nandroid.md5", make sure the output is not "No such file or directory", because it means that most likely the backup is not complete.

All of these to say: be careful and do this if necessary (unless you know what you are doing of course).

A suggestion:
In this situation you can do an "advanced restore" and restore only /data and /datadata if you are using the same ROM you used for the backup (maybe a slightly different ROM is good too). The only things not restored are the mods you applied and system apps, but for the mods, simply reflash them, for the system apps, well, they are always the same. All the apps installed through the market are in /data.
Maybe this will cause bootloops, but in this case you can simply reboot in recovery and do a data wipe/factory reset. This will let you boot without the need of a reflash. You have of course to reinstal all your apps etc, but it's better than starting from scratch.
Or, even better, do a backup before the restore of /data and /datadata, so that in case of problems you can always restore everything.

EDIT 2:
I think you can do this even when you change ROM, as long as it's a stock ROM. That's because stock ROMs are intended to be flashed over another stock ROM and they are made in a way that you don't need to wipe your /data partition. When you use kies to upgrade, you don't loose anything. Restoring /data and /datadata should have the same effect (it's better to wipe the dalvik-cache after this).
 
Last edited:

iAmBalvinder

Senior Member
Apr 5, 2012
224
59
New Delhi
@vishal: I'm not referring to corrupted backups. Sometimes later, even working backups fail to be restored after some ROM and kernel change.

Sent from my GT-I9003 using xda premium
 

loSconosciuto

Senior Member
Nov 21, 2011
765
2,817
@vishal: I'm not referring to corrupted backups. Sometimes later, even working backups fail to be restored after some ROM and kernel change.

Sent from my GT-I9003 using xda premium

I think you can do it, nandroid backups are the exact copy of the ROM you are running (the radio is not backed up).

The problem is that maybe you did a backup of Gingerbread using amit's CWM. His CWM is able to backup the kernel (normalboot.img), but he disabled this feature because he couldn't test it, so he thought it would be safer not to enable it. UC team however enabled it (that's what I can see from their recovery.fstab).
If you used amit's recovery to backup the ROM, when you restored it from CyanogenMod you didn't restore the kernel. So, when you turned the phone on, you tried to boot a stock ROM with a CM kernel.
Maybe if you flash a stock kernel after the restore with odin it will boot.
And if you tried to restore a CM backup (so with the kernel backed up) with amit's kernel, you didn't restore the kernel amit's recovery ignores it, so you tried to boot CM with a stock ROM kernel.

Maybe backups made from different CWM versions are not compatible, but I think Koush is trying to avoid this, but I'm not sure.

Another problem could be that CM is not yet finished and the continous changes in recovery cause new bugs that could affect the way backups are done (it recently happened).

Maybe I'm saying stupid things, but that's what I know. I'm not so interested in backups and restores, I rarely use them, so I've never tried to study well enough how they work etc. Correct me if I wrote something stupid.

Anyway, I'm sure that the md5sum error has nothing to do with the kernel you used to make the backup.
Every file has a unique md5 hash, it doesn't matter if you calculate it with your phone, with your computer or with your fridge (if you can :D), the result is always the same. What CWM does before starting a restore is to re-calculate the md5 of each file inside /sdcard/clockwrockmod/backup/XXXXX/ and to compare them with the ones stored in /sdcard/clockwrockmod/backup/XXXXX/nandroid.md5 when you made the backup (open this file with a text editor and see). If they are all equal, it means the backup is not corrupted, so it's safe to start the restore.
I think you could even restore a backup of another phone (maybe there are some other check here and there to prevent this), but of course don't try it :p.
 
Last edited:

bscraze

Senior Member
Aug 14, 2011
2,468
687
Singapore
I think you can do it, nandroid backups are the exact copy of the ROM you are running (the radio is not backed up).

The problem is that maybe you did a backup of Gingerbread using amit's CWM. His CWM is able to backup the kernel (normalboot.img), but he disabled this feature because he couldn't test it, so he thought it would be safer not to enable it. UC team however enabled it (that's what I can see from their recovery.fstab).
If you used amit's recovery to backup the ROM, when you restored it from CyanogenMod you didn't restore the kernel. So, when you turned the phone on, you tried to boot a stock ROM with a CM kernel.
Maybe if you flash a stock kernel after the restore with odin it will boot.
And if you tried to restore from a CM backup (so with the kernel backed up) with amit's kernel, you didn't restore the kernel amit's recovery ignores it, so you tried to boot CM with a stock ROM kernel.

Maybe backups made from different CWM versions are not compatible, but I think Koush is trying to avoid this, but I'm not sure.

Another problem could be that CM is not yet finished and the continous changes in recovery cause new bugs that could affect the way backup are done (it recently happened).

Maybe I'm saying stupid things, but that's what I know. I'm not so interested in backups and restores, I rarely use them, so I've never tried to study well enough how they work etc. Correct me if I wrote something stupid.

Anyway, I'm sure that the md5sum error has nothing to do with the kernel you used to make the backup.
Every file has a unique md5 hash, it doesn't matter if you calculate it with your phone, with your computer or with your fridge (if you can :D), the result is always the same. What CWM does before starting a restore is to re-calculate the md5 of each file inside /sdcard/clockwrockmod/backup/XXXXX/ and to compare them with the ones stored in /sdcard/clockwrockmod/backup/XXXXX/nandroid.md5 when you made the backup (open this file with a text editor and see). If they are all equal, it means the backup is not corrupted, so it's safe to start the restore.
I think you could even restore a backup of another phone (maybe there are some other check here and there to prevent this), but of course don't try it :p.

Cool, thx for the info. Nv knew the difference between the kernels

Sent from my GT-I9003 using xda app-developers app
 

iAmBalvinder

Senior Member
Apr 5, 2012
224
59
New Delhi
I think you can do it, nandroid backups are the exact copy of the ROM you are running (the radio is not backed up).

The problem is that maybe you did a backup of Gingerbread using amit's CWM. His CWM is able to backup the kernel (normalboot.img), but he disabled this feature because he couldn't test it, so he thought it would be safer not to enable it. UC team however enabled it (that's what I can see from their recovery.fstab).
If you used amit's recovery to backup the ROM, when you restored it from CyanogenMod you didn't restore the kernel. So, when you turned the phone on, you tried to boot a stock ROM with a CM kernel.
Maybe if you flash a stock kernel after the restore with odin it will boot.
And if you tried to restore a CM backup (so with the kernel backed up) with amit's kernel, you didn't restore the kernel amit's recovery ignores it, so you tried to boot CM with a stock ROM kernel.

Maybe backups made from different CWM versions are not compatible, but I think Koush is trying to avoid this, but I'm not sure.

Another problem could be that CM is not yet finished and the continous changes in recovery cause new bugs that could affect the way backups are done (it recently happened).

Maybe I'm saying stupid things, but that's what I know. I'm not so interested in backups and restores, I rarely use them, so I've never tried to study well enough how they work etc. Correct me if I wrote something stupid.

Anyway, I'm sure that the md5sum error has nothing to do with the kernel you used to make the backup.
Every file has a unique md5 hash, it doesn't matter if you calculate it with your phone, with your computer or with your fridge (if you can :D), the result is always the same. What CWM does before starting a restore is to re-calculate the md5 of each file inside /sdcard/clockwrockmod/backup/XXXXX/ and to compare them with the ones stored in /sdcard/clockwrockmod/backup/XXXXX/nandroid.md5 when you made the backup (open this file with a text editor and see). If they are all equal, it means the backup is not corrupted, so it's safe to start the restore.
I think you could even restore a backup of another phone (maybe there are some other check here and there to prevent this), but of course don't try it :p.

Yeah, most probably be that was the issue... Kernels needed to be changed.
Thanks :D

And I already saw that my backup was not corrupted with md5 check.
Moreover, I also don't use nandroid much, I always configure new ROM I try, from the scratch. :p:D

It's just that I needed to use USB storage urgently, which sadly doesn't work on any ics based ROM. So tried to restore the backup. Alas !

Had to flash again from scratch to get to stock gb, as I didn't have any gb.zip in sd card or computer.

Sent from my GT-I9003 using xda premium
 

huseniezzaz

Member
Jul 3, 2012
27
4
ahmedabad
i am not able to restore my backup due to mismatch md5

Few days ago I faced MD5 mismatch error while restoring my backup after messed with my phone. But due to this error I couldn't restore backup. I asked many people but people said that I should now flash sock firmware which was really a headache for me.

Anyway I searched alot on xda & I found very easy solution.

It don't require pc or adb shell etc. It only requires rooted phone with Terminal Emulator app :)

STEP 1: Open Terminal Emulator

Step 2: Use the following commands. (DON'T FORGET TO REPLACE "2012-01-01.10.09.36" WITH YOUR OWN BACKUP FOLDER NAME WHICH WILL BE PRESENT IN folder /clockworkmod/backup/)

Code:
su
#mount -o remount rw /sdcard
#cd /sdcard/clockworkmod/backup/2012-01-01.10.09.36
#rm nandroid.md5
#md5sum *img > nandroid.md5

STEP 3: (This will create a new "nandroid.md5" file without ANY "md5 mismatch" errors :D)
Reboot your phone and enter Recovery mode & then restore.

I hope it will help you in future :)
ENJOY...:D

IMP NOTE :- Many times people change backup folder name which can create this error. So be sure that you have not changed your backup folder name & also be sure that there is no space in backup folder path.



i was using another bootloader and another cwm
 

ganeshbiyer

Inactive Recognized Contributor
Jan 16, 2011
2,404
2,628
Bangalore
Vishal, can you summarize every thing and update first post.

According to my understanding,

1. Do not change backup folder name.
2. Do not restore backup using different recovery than the one used, i.e. Use gb recovery to restore gb Rom, cm7 recovery to restore cm7 Rom and so on.

These are the main cause of md5 error, else better to assume the backup is corrupted.

Recalclating the md5 and restoring could have adverse effect on the system. :cool:


Sent from my LT28h using xda premium
 

vishal24387

Inactive Recognized Contributor
May 11, 2011
3,936
1,976
35
Solapur, Maharashtra
Vishal, can you summarize every thing and update first post.

According to my understanding,

1. Do not change backup folder name.
2. Do not restore backup using different recovery than the one used, i.e. Use gb recovery to restore gb Rom, cm7 recovery to restore cm7 Rom and so on.

These are the main cause of md5 error, else better to assume the backup is corrupted.

Recalclating the md5 and restoring could have adverse effect on the system. :cool:


Sent from my LT28h using xda premium

ok buddy I will update information in few minutes :)
I am still waiting for ur test kernel with modules inbulit in it.
 

Mike404

Member
May 16, 2010
39
3
I was on the same issue as all people with MD5 failure, then I rename my backup name with a short name with no space or blank and the it run like a charme !.

Hope it could help.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 28
    Few days ago I faced MD5 mismatch error while restoring my backup after messed with my phone. But due to this error I couldn't restore backup. I asked many people but people said that I should now flash sock firmware which was really a headache for me.

    Anyway I searched alot on xda & I found very easy solution.

    It don't require pc or adb shell etc. It only requires rooted phone with Terminal Emulator app :)

    STEP 1: Open Terminal Emulator

    Step 2: Use the following commands. (DON'T FORGET TO REPLACE "2012-01-01.10.09.36" WITH YOUR OWN BACKUP FOLDER NAME WHICH WILL BE PRESENT IN folder /clockworkmod/backup/)

    Code:
    su
    #mount -o remount rw /sdcard
    #cd /sdcard/clockworkmod/backup/2012-01-01.10.09.36
    #rm nandroid.md5
    #md5sum *img > nandroid.md5

    STEP 3: (This will create a new "nandroid.md5" file without ANY "md5 mismatch" errors :D)
    Reboot your phone and enter Recovery mode & then restore.

    I hope it will help you in future :)
    ENJOY...:D

    IMP NOTE :- Many times people change backup folder name which can create this error. So be sure that you have not changed your backup folder name & also be sure that there is no space in backup folder path.

    Credit goes to UsmanJ member. I have just shared with you guys with more good explanation.

    Original thread HERE
    5
    The first two commands ('su' and 'mount') are not necessary because:
    • You don't need root permissions to edit stuff in /sdcard
    • /sdcard is always mounted as RW (that's what the second command does.)
    EDIT:
    I've just remembered that if you don't have busybox installed you don't have the 'md5sum' command avaible for the user.
    However our CF-root kernels come with an inbuilt busybox, but it can't be used as normal user, because if I remember correctly all the symlinks are in /sbin, where the user has no access. So, probably, you need to do this as root (= type the 'su' command as in the OP).

    Anyway, nandroid.md5 is the last thing made during a backup. That means if you don't have enough space for the backup and it stops, this file is not created. So, when you go to restore that backup, you have the mismatch error. In this case, if you create the nandroid.md5 as vishal wrote, you'll have a usable and damaged backup. So, before doing this, check if nandroid.md5 is there or, when you run "rm nandroid.md5", make sure the output is not "No such file or directory", because it means that most likely the backup is not complete.

    All of these to say: be careful and do this if necessary (unless you know what you are doing of course).

    A suggestion:
    In this situation you can do an "advanced restore" and restore only /data and /datadata if you are using the same ROM you used for the backup (maybe a slightly different ROM is good too). The only things not restored are the mods you applied and system apps, but for the mods, simply reflash them, for the system apps, well, they are always the same. All the apps installed through the market are in /data.
    Maybe this will cause bootloops, but in this case you can simply reboot in recovery and do a data wipe/factory reset. This will let you boot without the need of a reflash. You have of course to reinstal all your apps etc, but it's better than starting from scratch.
    Or, even better, do a backup before the restore of /data and /datadata, so that in case of problems you can always restore everything.

    EDIT 2:
    I think you can do this even when you change ROM, as long as it's a stock ROM. That's because stock ROMs are intended to be flashed over another stock ROM and they are made in a way that you don't need to wipe your /data partition. When you use kies to upgrade, you don't loose anything. Restoring /data and /datadata should have the same effect (it's better to wipe the dalvik-cache after this).
    3
    @vishal: I'm not referring to corrupted backups. Sometimes later, even working backups fail to be restored after some ROM and kernel change.

    Sent from my GT-I9003 using xda premium

    I think you can do it, nandroid backups are the exact copy of the ROM you are running (the radio is not backed up).

    The problem is that maybe you did a backup of Gingerbread using amit's CWM. His CWM is able to backup the kernel (normalboot.img), but he disabled this feature because he couldn't test it, so he thought it would be safer not to enable it. UC team however enabled it (that's what I can see from their recovery.fstab).
    If you used amit's recovery to backup the ROM, when you restored it from CyanogenMod you didn't restore the kernel. So, when you turned the phone on, you tried to boot a stock ROM with a CM kernel.
    Maybe if you flash a stock kernel after the restore with odin it will boot.
    And if you tried to restore a CM backup (so with the kernel backed up) with amit's kernel, you didn't restore the kernel amit's recovery ignores it, so you tried to boot CM with a stock ROM kernel.

    Maybe backups made from different CWM versions are not compatible, but I think Koush is trying to avoid this, but I'm not sure.

    Another problem could be that CM is not yet finished and the continous changes in recovery cause new bugs that could affect the way backups are done (it recently happened).

    Maybe I'm saying stupid things, but that's what I know. I'm not so interested in backups and restores, I rarely use them, so I've never tried to study well enough how they work etc. Correct me if I wrote something stupid.

    Anyway, I'm sure that the md5sum error has nothing to do with the kernel you used to make the backup.
    Every file has a unique md5 hash, it doesn't matter if you calculate it with your phone, with your computer or with your fridge (if you can :D), the result is always the same. What CWM does before starting a restore is to re-calculate the md5 of each file inside /sdcard/clockwrockmod/backup/XXXXX/ and to compare them with the ones stored in /sdcard/clockwrockmod/backup/XXXXX/nandroid.md5 when you made the backup (open this file with a text editor and see). If they are all equal, it means the backup is not corrupted, so it's safe to start the restore.
    I think you could even restore a backup of another phone (maybe there are some other check here and there to prevent this), but of course don't try it :p.
    2
    No need these at all you need "root toolbox". and ut works perfectly ;) by the way thanks for sharung this way too

    Tapatalk 2 ile GT-I9003 cihazımdan gönderildi
    1
    If you do this you can't be sure that your backup isn't broken. md5 needs exactly for checking this. Yes, you cheated the check system, but are you sure that your backup integrity is fine?