Related
I have created a autobackup script for the EFS partition that contains information for your IMEI number.
I am addressing all ROM Developers to include this script in their ROM's!
What does this script do? It creates efs_autobackup folder on your SDCard and then tars the whole EFS partition into efs-backup.tar.gz file. Once this file is created, you can safely copy it to your PC. The script also looks for that file on reboot and if the file exists, it won't create another one.
What are the benefits of the tar file?
It keeps the permissions information for your EFS partition, so that when you want to restore your EFS partition, you only need to extract that file with the RootExplorer to your EFS partition and overwrite the old files. It sets the permissions automatically for you, so you don't need to mess or handle that yourself.
Please Developers, include this in your ROM so that users that forget to backup their EFS partition, don't have to regret that.
INSTRUCTIONS:
For Users:
If you are on ROM that don't have this script integrated - you can flash the attached zip file in your Recovery to integrate the script.
For Developers:
Either take the file from the attached zip or create 01efstar file (very important to name it with 01 prefix, since it runs as first when the Phone starts, otherwise it won't work) in the /system/etc/init.d folder with this content:
Code:
#!/system/bin/sh
# EFS Autobackup script for Samsung Nexus S
# By Brainmaster
mount /dev/block/platform/s3c-sdhci.0/by-name/media /sdcard
if [ ! -f /sdcard/efs_autobackup/efs-backup.tar.gz ];
then
mkdir /mnt/sdcard/efs_autobackup
busybox tar zcvf /sdcard/efs_autobackup/efs-backup.tar.gz /efs
fi
umount /sdcard
Reserved 1.
What a good idea.
Should I implement this on the radio zip file too?
window7 said:
Should I implement this on the radio zip file too?
Click to expand...
Click to collapse
No, this is ROM based. If the ROM don't support the scripts, then it won't work.
BUT, I am working on a version that can do this directly in the recovery (undependable from ROM) - then you can integrate it in every Radio flash file.
Well done,good job !
Sent from my Nexus S using XDA App
brainmaster said:
No, this is ROM based. If the ROM don't support the scripts, then it won't work.
BUT, I am working on a version that can do this directly in the recovery (undependable from ROM) - then you can integrate it in every Radio flash file.
Click to expand...
Click to collapse
you only have to modify the updater-swcript? easy as a pie!
Sent from my Nexus S using XDA Premium App
i hope ur miui rom has this or else should i flash it?
Borky_16 said:
you only have to modify the updater-swcript? easy as a pie!
Sent from my Nexus S using XDA Premium App
Click to expand...
Click to collapse
Not so easy to mount the efs partition through the updater-script.
ancilary said:
i hope ur miui rom has this or else should i flash it?
Click to expand...
Click to collapse
From the next release on. If you want you can flash the script now.
yeah i dunno, first i made my own script and put into etc/init.d (running netarchy 1.3.9 which obv supports init.d scripts) - no dice. so i removed that file and flashed the zip and still getting no backup on sd.
ideas?
brainmaster said:
Not so easy to mount the efs partition through the updater-script.
Click to expand...
Click to collapse
oh that is right! :O forgot about it
Script successfully injected into my current installation of CM nightly, and successfully executed on reboot.
Uploaded the resulting file to Dropbox -- where I know I'll never lose it!
Two thumbs up!
I will include this script in my next rom update. I believe every dev should do the same.
Sent from my Google Nexus S using XDA Premium App
Good idea to put this into every ROM. Some people probably are not aware of the danger and if anything happens at least they can find the backup files on their sdcard. Maybe one should also add a small text file as an explanation what this backup is good for, so they do not accidentally delete it. Maybe you could also change the backup file on the sdcard to read-only.
Btw, you can also make a simple backup image with 'dd if=/dev/block/mtdblock6 of=efs.img'.
And for the record: I wondered why the /efs partition is mounted read-write and thought it might be a good idea change this to read-only. Problem was, without write access to /efs the SIM card would not unlock anymore. So not a good idea.
Just got my phone back from Regenersis with the IMEI restored! Shows that it can be done!
Ezekeel said:
Good idea to put this into every ROM. Some people probably are not aware of the danger and if anything happens at least they can find the backup files on their sdcard. Maybe one should also add a small text file as an explanation what this backup is good for, so they do not accidentally delete it. Maybe you could also change the backup file on the sdcard to read-only.
Btw, you can also make a simple backup image with 'dd if=/dev/block/mtdblock6 of=efs.img'.
And for the record: I wondered why the /efs partition is mounted read-write and thought it might be a good idea change this to read-only. Problem was, without write access to /efs the SIM card would not unlock anymore. So not a good idea.
Click to expand...
Click to collapse
Actually it should be as follows seeing as we get a read-only error;
dd if=/dev/block/mtdblock6 of=/mnt/sdcard/efs.img
Sent from my Nexus S using XDA Premium App
atrixboy said:
Actually it should be as follows seeing as we get a read-only error;
dd if=/Dec/block/mtdblock6 of=/months/sdcard/efs.img
Sent from my Nexus S using XDA Premium App
Click to expand...
Click to collapse
Please, IF you want to use the option to make efs.img (I don't know why would you like to do that, because tar is easier to extract and keeps the permissions), THEN you need right command.
You misspelled allot.
Code:
dd if=/dev/block/mtdblock6 of=/sdcard/efs.img
Yea I realised that after I hit post. I agree rfs is much nicer and cleaner to deal with.
dd if=/dev/block/mtdblock6 of=/mnt/sdcard/efs.img
Or efs.rfs. however you prefer. Rfs being the more logical
Sent from my Nexus S using XDA Premium App
brainmaster said:
Please, IF you want to use the option to make efs.img (I don't know why would you like to do that ...)
Click to expand...
Click to collapse
Because mtd6 contains more than the visible files mounted on /efs, such as the wimax keys.
My question is how to restore the partition without having to worry about this:
Dees_Troy said:
Using dd on mtd devices is a bad idea when it comes time to restore. It's a quick path to a brick. It tends to inadvertently mark blocks as bad.
Click to expand...
Click to collapse
Maximilian Mary said:
Because mtd6 contains more than the visible files mounted on /efs, such as the wimax keys.
My question is how to restore the partition without having to worry about this:
Click to expand...
Click to collapse
Darn. I did not know that.
Turns out one should use nanddump and nandwrite from mtd-utils (http://git.infradead.org/mtd-utils.git). Maybe someone can compile a version for Android. That would be quite useful.
Hi guys. I flashed a new baseband for my Optimus 2x. After that, I wanted to restore my backup and I get a MD5 Mismatch. How come? I didn't rename my backup or changed the recovery. Nothing!
hey, i had this not so long ago, its nothing more than a bad nandroid backup, nothing will fix it, you gotta reflash another backup or start over (i started over cuz other backups were too old)
You may be able to solve it with these steps:
1. Go to the directory of the backup.
2. Delete nandroid.md5
3. Recreate nandroid.md5 of all images with 'md5sum'.
Sent from my Optimus 2X using xda premium
Egan said:
You may be able to solve it with these steps:
1. Go to the directory of the backup.
2. Delete nandroid.md5
3. Recreate nandroid.md5 of all images with 'md5sum'.
Sent from my Optimus 2X using xda premium
Click to expand...
Click to collapse
This will allow you to flash a corrupt image, and is therefore not recommended
I got one just today, really annoying..
@kiljaken any idea why it happens, or how it can be avoided?
Imperticus said:
I got one just today, really annoying..
@kiljaken any idea why it happens, or how it can be avoided?
Click to expand...
Click to collapse
Not really no. All it takes is one changed bit in either file
My guess is you renamed the folder with a space, if so, try without it, if not then recreate the md5 as mentioned the MD5 with md5sum * > nandroid.md5
I always have this issue when I make the back up through Rom Manager. So I always make it now in clockwork recovery mode.
Rusty! said:
My guess is you renamed the folder with a space, if so, try without it, if not then recreate the md5 as mentioned the MD5 with md5sum * nandroid.md5
Click to expand...
Click to collapse
Works!!! Thank you..
1) rename folder (no spaces)
2) inside the folder, type "rm nandroid.md5"
3) then type "md5sum * > nandroid.md5
Sent from my LG-P990 using XDA App
Good spot, I missed out the >
so I made a backup through CWM of my current rom, and installed another rom, and changed my mind and wanted to go back. When I try to do so I get an MD5SUM Mismatch error. I have not changed the names of the folders in anyway shape or form.
I found a thread on XDA with a fix, which I tried, to no luck. http://forum.xda-developers.com/showthread.php?t=714114
anyone have any ideas? I can live without what was in the backup if I need to...but I would rather not.
I did notice that the file size of the other MD5 sums I have for my other backups is closer to 130+ KB files, and the new one is 22 KB.... my biggest backup yet, with the smallest MD5 sum?
any ideas?
EDIT: further looking into this I noticed that the backup files are .ext3.tar so I tried from the other post, instead of doing "md5sum *img > nandroid.md5" i tried "md5sum *ext3.tar > nandroid.md5" and "md5sum *tar > nandroid.md5" and both of these fail aswell. Still looking for any ideas on how to fix this.
EDIT #2: I figured it out...after being beyond frustrated...lol. So when I used Notepad++ to open the nandroid.md5 file, and use MD5 calculator to verify the actual MD5sums, i noticed something interesting between multiple backups. Every other nandroid.md5 file I had, had two spaces between the MD5sum and the file name, except the one I had that was failing. So I fixed this, and my rom is restoring as we speak. So incase anyone else has this issue, and wants to fix their MD5sum error, here is what it should look like
a5cf3fc0bc5144856c9bba7f410ece5f data.ext3.tar. So with two spaces, not one.
i tried xUltimate to deodexing my XT860 and...... since then ו'm stuck in boot loop
Do you have a bootstrap/safestrap installed?
Sent from my DROID3 using xda premium
Endoroid said:
Do you have a bootstrap/safestrap installed?
Sent from my DROID3 using xda premium
Click to expand...
Click to collapse
i have Safestrap Recovery 1.08
when i:
Safestrap => backup and restore => restore => external SD => (appear)
nonsafe-2012-01-31 (the one i got)
run it, and
checking MD5 sums.....
MD5 mismatch!
boazal said:
i have Safestrap Recovery 1.08
when i:
Safestrap => backup and restore => restore => external SD => (appear)
nonsafe-2012-01-31 (the one i got)
run it, and
checking MD5 sums.....
MD5 mismatch!
Click to expand...
Click to collapse
****ty. I don't know if there is a way to fix that. Do you happen to have the tweaked safestrap that allows flashing the nonsafe
Sent from my XT860 using xda premium
If yes to my last question, just flash the stock bell 2.3.6 rom located in the dev forum. If no then you have 2 options. First it follow the steps in this thread http://forum.xda-developers.com/showthread.php?t=1404608
Or
Use motofastboot to flash a system.img, this will restore the /system, reroot, install bootstrap and then flash the already deodexed stock bell rom I previously mentioned to restore your /system, remove bootstrap, install safestrap and flash either that rom, or the rom of your choice into safe system and use safe system from now on.
Sent from my XT860 using xda premium
You can manually find the MD5s on a computer and edit the MD5 file manually to make it work, its dangerous but it works... I've done it before
DeadChex said:
You can manually find the MD5s on a computer and edit the MD5 file manually to make it work, its dangerous but it works... I've done it before
Click to expand...
Click to collapse
I've had that same problem in the past. How do you manually edit the md5 and how do you know what to change it to. Would I just run the md5 command in terminal and then unzip the backup and modify it?
Sent from my XT860 using xda premium
Endoroid said:
I've had that same problem in the past. How do you manually edit the md5 and how do you know what to change it to. Would I just run the md5 command in terminal and then unzip the backup and modify it?
Sent from my XT860 using xda premium
Click to expand...
Click to collapse
The back up should just be a folder, open the folder, and run the MD5 Command in the Terminal on each of the backup archives (eg cache.ext3.tar, system.ext3.tar) and put them into nandroid.md5
The nandroid.md5 file should hopefully be laid out easily and just replace the hashes (random letters and numbers) with the ones you generated with the correct file's hash
And Restore away!
Endoroid said:
Do you happen to have the tweaked safestrap that allows flashing the nonsafe
Click to expand...
Click to collapse
don't know, how to find out?
boazal said:
don't know, how to find out?
Click to expand...
Click to collapse
V1.08d
Sent from my XT860 using xda premium
Endoroid said:
V1.08d
Click to expand...
Click to collapse
it's v1.08,
what can be done?
Either attempt to fix the md5sum as mentioned above, or restore your system through one of the options I mentioned in my previous post
Sent from my XT860 using xda premium
Endoroid said:
Either attempt to fix the md5sum as mentioned above, or restore your system through one of the options I mentioned in my previous post
Click to expand...
Click to collapse
sorry for bothering, i'm not familiar with the process, can you guide newbi? (preferred flash the rom methods)
people's, please i need assistance.....
boazal said:
people's, please i need assistance.....
Click to expand...
Click to collapse
Im at work but later tonight I will give more detailed instructions
Sent from my XT860 using xda premium
Method- Manually Altering MD5 Sums (Windows) (This guide might be off, Windows is not my home OS anymore...)
1. Plug your SD card into your computer.
2. Open up the directory where your back ups are should be /safestrap/backup/BACKUPNAME
3. Download this tool: http://www.pc-tools.net/win32/md5sums/
4. Drag system.ext3.tar and drop it on top of the applications icon
Write down that MD5
5. Drag data.ext3.tar and drop it on top of the applications icon
Write down that MD5
6. Drag cache.ext3.tar and drop it on top of the applications icon
Write down that MD5
7. open up nandroid.md5 with a text editor it should look something like this:
Code:
2ce2ec3c4beac74ba3fba94fb290ea21 cache.ext3.tar
12296836011615c7f2611e19c9390a78 data.ext3.tar
0589700a289739c448b6ff2e317d7951 system.ext3.tar
Replace the hash next to cache.ext3.tar with the one you generated, and repeat this for the other files...
IF nandroid.md5 does not exist, create it and do as mentioned above.
Then... Restore!
Sorry, I know this isn't the easy reflash you wanted but it's the only guide I can write at this time
(This guide was written going off of safestrap 1.08 you may have to change some titles of files)
Thanks and/or donate if I helped
Method- Manually Altering MD5 Sums (Linux-Ubuntu)
1. Plug your SD card into your computer.
2. Open up the directory where your back ups are should be /safestrap/backup/BACKUPNAME
4. Run md5sum on system.ext3.tar
Write down that MD5
5. Run md5sum on data.ext3.tar
Write down that MD5
6. Run md5sum on cache.ext3.tar
Write down that MD5
7. open up nandroid.md5 with a text editor it should look something like this:
Code:
2ce2ec3c4beac74ba3fba94fb290ea21 cache.ext3.tar
12296836011615c7f2611e19c9390a78 data.ext3.tar
0589700a289739c448b6ff2e317d7951 system.ext3.tar
Replace the hash next to cache.ext3.tar with the one you generated, and repeat this for the other files...
IF nandroid.md5 does not exist, create it and do as mentioned above.
Then... Restore!
You're gonna have to do the leg work to get the files and programs I mention because finding and linking while on my fine is a pita.
There is another option, the easiest of all, however it will remove you from the bell update path as we have no way currently of returning to the stock bell firmware. You can grab rsdlite and a fastboot package from the dev forum and flash that, it will fix it up but you are no longer on bell firmware. Up to you if you can live with that.
The other way is to grab motofastboot (google it) and a fastboot package from dev forum. Unzip the fastboot package into a folder and put motofasboot in the same folder. Motofastboot is a command line utility, it has no user interface. Open a cmd prompt (start button, run, cmd) and type cd C:\your\path\to\aforementioned\folder then run
moto-fastboot flash system system.img (I have the 32 bit version so mine is moto-fastboot32) I dont use windows, onlinux I have to precede the command with ./ so for me it would look like
./moto-fastboot32 flash system system.img
Your phone will now boot
Find zergrush easy root utility and follow the directions for it to root your phone, then install a bootstrap(or the tweaked safestrap that allows nonsafe flashing and then go grab the stock bell rom from dev forum and flash that. It is already deodexed.
this will keep you stock bell
Sent from my XT860 using xda premium
DeadChex said:
Method- Manually Altering MD5 Sums (Windows) (This guide might be off, Windows is not my home OS anymore...)
1. Plug your SD card into your computer.
2. Open up the directory where your back ups are should be /safestrap/backup/BACKUPNAME
3. Download this tool: http://www.pc-tools.net/win32/md5sums/
4. Drag system.ext3.tar and drop it on top of the applications icon
Write down that MD5
5. Drag data.ext3.tar and drop it on top of the applications icon
Write down that MD5
6. Drag cache.ext3.tar and drop it on top of the applications icon
Write down that MD5
7. open up nandroid.md5 with a text editor it should look something like this:
Code:
2ce2ec3c4beac74ba3fba94fb290ea21 cache.ext3.tar
12296836011615c7f2611e19c9390a78 data.ext3.tar
0589700a289739c448b6ff2e317d7951 system.ext3.tar
Replace the hash next to cache.ext3.tar with the one you generated, and repeat this for the other files...
IF nandroid.md5 does not exist, create it and do as mentioned above.
Then... Restore!
Sorry, I know this isn't the easy reflash you wanted but it's the only guide I can write at this time
(This guide was written going off of safestrap 1.08 you may have to change some titles of files)
Thanks and/or donate if I helped
Click to expand...
Click to collapse
First i 'ant to thank you
when i open my nandroid.md5 it was empty
i do the exact method, and create the 4 hash (cache, data, system, systemorig) on nandroid.md5 put it back on the phone, try to restore but ...no success. Still receive MD5 mismatch
when I return the SD carde to the pc, the nandroid.md5 empty again!
Endoroid said:
The other way is to grab motofastboot (google it) and a fastboot package from dev forum. Unzip the fastboot package into a folder and put motofasboot in the same folder. Motofastboot is a command line utility, it has no user interface. Open a cmd prompt (start button, run, cmd) and type cd C:\your\path\to\aforementioned\folder then run
moto-fastboot flash system system.img (I have the 32 bit version so mine is moto-fastboot32) I dont use windows, onlinux I have to precede the command with ./ so for me it would look like
./moto-fastboot32 flash system system.img
Your phone will now boot
Click to expand...
Click to collapse
C:\moto-fastboot-win32>moto-fastboot flash system system.img
sending 'system' (262144 KB)... OKAY [ 25.386s]
writing 'system'... OKAY [ 15.596s]
sending 'system' (175872 KB)... OKAY [ 17.214s]
writing 'system'... OKAY [ 9.043s]
but refuse to boot
boazal said:
First i 'ant to thank you
when i open my nandroid.md5 it was empty
i do the exact method, and create the 4 hash (cache, data, system, systemorig) on nandroid.md5 put it back on the phone, try to restore but ...no success. Still receive MD5 mismatch
when I return the SD carde to the pc, the nandroid.md5 empty again!
Click to expand...
Click to collapse
Linux or Windows? Esure you are safely ejecting (windows) or unmounting/ejecting (Linux) before removing the SDCard, I've noticed file changes sometimes don't stick if you don't safely eject.
I'm not sure if the method I'm giving is a soloution anymore with the reflash (That's not a bad thing!)
Hello @ all,
I´ve made a CWM backup on my external sdcard. Now I want to restore this backup and all I get is an error saying MD5 mismatch. I read a while in this board (which often saved my life) and found out, that I had to delete the file nandroid.md5 (which even didn´t exist in my backup-folder). So i created a new, empty file. But no change, restoring my backup was not possible.
So please give me some hints what to do..
Thanks a lot,
Michael
bla.fasel said:
Hello @ all,
I´ve made a CWM backup on my external sdcard. Now I want to restore this backup and all I get is an error saying MD5 mismatch. I read a while in this board (which often saved my life) and found out, that I had to delete the file nandroid.md5 (which even didn´t exist in my backup-folder). So i created a new, empty file. But no change, restoring my backup was not possible.
So please give me some hints what to do..
Thanks a lot,
Michael
Click to expand...
Click to collapse
Open a terminal shell, navigate to your NANDROID backup folder, and issue "md5sum *.tar.*> nandroid.md5"
Sent from my SGP321 using xda app-developers app