[Guide][Fix] Motorola Defy Mini XT320/XT321 Burnt NAND - Defy General

Hello Defy Mini Users, I'm going to write a tutorial on how to fix a burnt NAND.
My overclock became unstable and I had bad blocks everywhere so I decided to recover my NAND. @cute_prince method fixed by phone.
@MauroSZ @Bernd.Defy @wilberfish @conrad0
Thanks to cute_prince tutorial for HTC Explorer NAND recovery. I have just adapted to Defy Mini XT320/XT321.
Now in cmd type in these commands:
Code:
adb reboot bootloader
Code:
fastboot boot twrp.img
Code:
adb shell mount -a
Code:
adb push flash_erase /system/xbin
Code:
adb shell cd /system/xbin
Code:
adb shell chmod 755 flash_erase
Code:
adb shell ./flash_erase -N /dev/mtd/mtd9 0 0
Code:
adb shell ./flash_erase -N /dev/mtd/mtd11 0 0
Code:
adb shell ./flash_erase -N /dev/mtd/mtd12 0 0
Code:
adb reboot bootloader
Code:
fastboot erase userdata
Code:
fastboot erase cache
Code:
fastboot erase system
Now flash back your SBF via RSD-Lite.

on this step "adb shell chmod 755 flash_erase"
I get chmod: flash_erase: no such file or directory.
What am i missing?

@rootdefyxt320, Theoretical question:
Any idea what happens recovering nandroid instead flashing a SBF via RSD Lite ?

MauroSZ said:
@rootdefyxt320, Theoretical question:
Any idea what happens recovering nandroid instead flashing a SBF via RSD Lite ?
Click to expand...
Click to collapse
You restore a nandroid backup that has a corrupted NAND, which is what you don't want. Flashing an SBF doesn't give a corrupted NAND as it is fresh. But you must flash_erase before you flash an SBF otherwise you will still have a burnt NAND.

wilberfish said:
on this step "adb shell chmod 755 flash_erase"
I get chmod: flash_erase: no such file or directory.
What am i missing?
Click to expand...
Click to collapse
Did you push flash_erase to /system/xbin? This fixes the missing file issue. Otherwise you can mount /system manually in TWRP.

Yes, fixed it. Silly mistake.
Thanks it works brilliantly.

wilberfish said:
Yes, fixed it. Silly mistake.
Thanks it works brilliantly.
Click to expand...
Click to collapse
So your NAND is fixed now?

rootdefyxt320 said:
So your NAND is fixed now?
Click to expand...
Click to collapse
Is correct supposing the android automatically avoids bad blocks using others normal blocks instead ? Is journaling correlated ? If true, does make sense flash a sbf first and restore a nandroid just after getting fastboot ? Or do you recommend anorher backup way like titanium ? Or maybe a mixed way using a old nandroid made when the nand was not burnt and Titanium just after to make the device state more recent ?
Is there a easy and quick test to know if the nand is burnt ?
Sent by Smartphone Using Tapatalk 2

rootdefyxt320 said:
So your NAND is fixed now?
Click to expand...
Click to collapse
Yes seems so. Didn't have time to check but after clean install and updates back to 73mb free
Sent from my HTC Desire C using xda app-developers app
---------- Post added at 09:24 PM ---------- Previous post was at 09:17 PM ----------
Originally Posted by rootdefyxt320
So your NAND is fixed now?
Click to expand...
Click to collapse
Is correct supposing the android automatically avoids bad blocks using others normal blocks instead ? Is journaling correlated ? If true, does make sense flash a sbf first and restore a nandroid just after getting fastboot ? Or do you recommend anorher backup way like titanium ? Or maybe a mixed way using a old nandroid made when the nand was not burnt and Titanium just after to make the device state more recent ?
Is there a easy and quick test to know if the nand is burnt ?
Sent by Smartphone Using Tapatalk 2
Click to expand...
Click to collapse
adb shell dmesg will give you a report, scroll down and you will see if you have bad blocks.
Yes it avoids bad blocks automatically. As for backup I have no idea, sorry.

MauroSZ said:
Is correct supposing the android automatically avoids bad blocks using others normal blocks instead ? Is journaling correlated ? If true, does make sense flash a sbf first and restore a nandroid just after getting fastboot ? Or do you recommend anorher backup way like titanium ? Or maybe a mixed way using a old nandroid made when the nand was not burnt and Titanium just after to make the device state more recent ?
Is there a easy and quick test to know if the nand is burnt ?
Sent by Smartphone Using Tapatalk 2
Click to expand...
Click to collapse
The problem with nandroid backups is when you back it up. I backup my phone before overclocking so I can restore my NANDROID backup. You can restore your nandroid if you backup before overclocking. Don't restore your NANDROID if you backed it up after overclocking. Basically YAFFS2 filesystem uses 'blocks' to store the data. It won't write to the 'bad blocks' so you lose storage. Basically a YAFFS2 NANDROID backup also backups the bad blocks which is what you don't want. You can read more about YAFFS Filesystem here: http://en.wikipedia.org/wiki/YAFFS

@rootdefyxt320 thanks for the link, but if i backup just after a minute i overclocked, i am supposed it will not sufficient time to burn the nand, right ? And i can avoid all a process to overclock again if i have to recovery my nand.
It seems the CWM backup creates a continuous nand image containing good and bad blocks. The android skips bad blocks writing data. Then i'm supposed backup apps as Titanium do a good job in this case because (i am also supposed) they don't work with image.
Sent by Smartphone Using Tapatalk 2

MauroSZ said:
@rootdefyxt320 thanks for the link, but if i backup just after a minute i overclocked, i am supposed it will not sufficient time to burn the nand, right ? And i can avoid all a process to overclock again if i have to recovery my nand.
It seems the CWM backup creates a continuous nand image containing good and bad blocks. The android skips bad blocks writing data. Then i'm supposed backup apps as Titanium do a good job in this case because (i am also supposed) they don't work with image.
Sent by Smartphone Using Tapatalk 2
Click to expand...
Click to collapse
Yeah, it won't have that much effect. The effect happens after a couple of weeks of overclocking.

After adb push flash_erase /system/xbin the commands should use full path, mine didn't work with CD.
Also shell commands didn't work first time, maybe because touched some buttons on TWRP screen.
Code:
Code:
adb reboot bootloader
fastboot boot twrp.img
adb shell mount -a
adb push flash_erase /system/xbin
adb shell cd /system/xbin
adb shell chmod 755 /system/xbin/flash_erase
adb shell /system/xbin/flash_erase -N /dev/mtd/mtd9 0 0
adb shell /system/xbin/flash_erase -N /dev/mtd/mtd11 0 0
adb shell /system/xbin/flash_erase -N /dev/mtd/mtd12 0 0
adb reboot bootloader
fastboot erase userdata
fastboot erase cache
fastboot erase system

Related

help! deleted recovery.img

just wondering if anyone can help me out here, i was trying to flash the cyanogen hero recovery image to my phone using fastboot so i erased my stock recovery image, only to get the message "remote: signature verify fail" so im now stuck with no recovery image and dont know how to get it back, can anyone help me out please?
ok so i managed to mount my system as read write in fastboot and put the recovery.img from the wwe version in to system which has gave me my recovery back but when i boot it just stays on the hero screen and says fastboot usb at the top if i have it plugged into my pc. i have no idea how to reset the original files and i didnt back up, can anyone help me pleas?
Well after trying for hours to fix this, I give up. I can't install the system.img from wwe rom posted on here it says verify failed or something similar so I stupidly tried to flash the magic 32a heroski port hoping it would work and still nothing. Is there anyway someone could post there nandroid backup file and help me flash it to see if that works? Or should I just give up. I'm really stuck now lol
you can't flash anything from fastboot because the images need to be signed.
what version of hero do you have?
if you have the wwe hero(it's not needed ) i can send you (later, now i'm at work) my nandroid backup (system,boot,recovery, splash...) so you can restore them
I have the orange hero. I used fastboot to load cyanogens recovery image then flashed the heroski rom hoping it might work lol so I ended up using fastboot to erase system. Question is do you think your nandroid backup would work? I sure hope so it would be a great help!!! Thanks.
i have the unlocked wwe hero. i'm uploading now the system, boot and recovery to rapidshare . it'll be up in a couple of minutes. if you find a orange hero backup you can restore in the same way ;-)
restoring hero wwe
download the backup from(it's better if you verify the md5):
http://rapidshare.com/files/263636068/bkp.rar.html
MD5: BEAE167BCBB1FF6D3D2701FB64604203
Put the contents on sdcard (i'm assuming that you put the images in a folder named bkp on the sdcard)
so:
download the recovery from here: http://rapidshare.com/files/262621147/cm-hero-recovery.img.zip and extract it
put your phone in fastboot mode (with the phone off, press the back key then turn the phone on).
then:
boot with the downloaded recovery
Code:
fastboot boot cm-hero-recovery.img
0) mount the partitions
Code:
adb shell mount /system
adb shell mount /sdcard
1) do a wipe
select the wipe option from the recovery menu
2) restore boot
Code:
adb shell flash_image boot /sdcard/bkp/boot.img
3) restore recovery
Code:
adb shell flash_image recovery /sdcard/bkp/recovery.img
4)restore system
Code:
adb shell
cd /system
rm -rf * (ignore the errors)
unyaffs /sdcard/bkp/system.img
5) unmount the partitions
Code:
umount /system
6) reboot
Code:
reboot
hope it helps
Ok thanks. Have to wait 4 hours to try it as I'm in work lol, what is an md5 for, just out of curiosity?
A MD5sum is a checksum to verifiy that your downloaded file isn't corrupt.
maxisma said:
A MD5sum is a checksum to verifiy that your downloaded file isn't corrupt.
Click to expand...
Click to collapse
Ok dude makes sense thanks.
thanks
enlightener said:
download the backup from(it's better if you verify the md5):
http://rapidshare.com/files/263636068/bkp.rar.html
MD5: BEAE167BCBB1FF6D3D2701FB64604203
Put the contents on sdcard (i'm assuming that you put the images in a folder named bkp on the sdcard)
so:
download the recovery from here: http://rapidshare.com/files/262621147/cm-hero-recovery.img.zip and extract it
put your phone in fastboot mode (with the phone off, press the back key then turn the phone on).
then:
boot with the downloaded recovery
Code:
fastboot boot cm-hero-recovery.img
0) mount the partitions
Code:
adb shell mount /system
adb shell mount /sdcard
1) do a wipe
select the wipe option from the recovery menu
2) restore boot
Code:
adb shell flash_image boot /sdcard/bkp/boot.img
3) restore recovery
Code:
adb shell flash_image recovery /sdcard/bkp/recovery.img
4)restore system
Code:
adb shell
cd /system
rm -rf * (ignore the errors)
unyaffs /sdcard/bkp/system.img
5) unmount the partitions
Code:
umount /system
6) reboot
Code:
reboot
hope it helps
Click to expand...
Click to collapse
ok so i finally got time to fix my phone and just did what you said and can now happily say it worked. thanks enlightener you enlightened me lol. in future i will refrain from doing random terminal stuff without researching first lol.
Bad new : My hero is out of service area
Hello,
Sorry for my english, i'm french
I made a big mistake in my files system ... A too long story
My Hero :
HBOOT-1?76.0004
Radio-6.35.04.25
July, 3 2009
Well, now, my htc hero do not work 'first page, out of service area"... I would like to make your post, but i had error :
First, fastboot Ok, Adb shell mount system and sdcard ok, wipe ok
Second, when i do this code" adb shell flash_image boot /sdcard/bkp/boot.img", my hero "said" : "header is the same, note flashing boot". Same thing for restore recovery
Can you help me ?
pitou21 said:
Hello,
Sorry for my english, i'm french
I made a big mistake in my files system ... A too long story
My Hero :
HBOOT-1?76.0004
Radio-6.35.04.25
July, 3 2009
Well, now, my htc hero do not work 'first page, out of service area"... I would like to make your post, but i had error :
First, fastboot Ok, Adb shell mount system and sdcard ok, wipe ok
Second, when i do this code" adb shell flash_image boot /sdcard/bkp/boot.img", my hero "said" : "header is the same, note flashing boot". Same thing for restore recovery
Can you help me ?
Click to expand...
Click to collapse
in this case, you don't have to restore boot or recovery because they are the same as the images posted here.
proceed with system
Ok thanks, now it's goog !

[HOWTO] Backup your EFS partition

As with newer Samsung Android phones it is practically essential that if you go to the modding scene and start uploading custom roms you should have a backup of your efs
For simple backup of efs partition
by sishgupta
Code:
adb shell
su
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs of=/sdcard/efs.img
and for a full image of your brand new phone
as various users have stated there are other more correct ways of backing up your new efs partition,
the one i liked the most is this one by because it backs up all your partitions
by c0ns0le
Code:
IF YOU HAVE BUSY BOX INSTALLED
adb shell
su -
for i in $(ls /dev/block/platform/omap/omap_hsmmc.0/by-name/ | grep -v user)
do
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/${i} of=/sdcard/${i}.img &
done
NO BUSYBOX:
adb shell
su -
for i in boot cache dgs efs metadata misc param radio recovery sbl system xloader
do
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/${i} of=/sdcard/${i}.img &
done
deprecated just staying here because this started all the correct backup commands for your efs
In order to do this for your galaxy nexus you should have adb working on your machine and also debugging enabled in your phone
this is practically easy, your phone must be rooted, or at least booted with the boot.img of this thread How to Root GALAXY NEXUS
Code:
adb root
adb remount
adb pull /factory
and now backup that file to at least 2 places lol
I always get paranoid with this
have fun installing custom roms
i don't think that works for GN
Samsung changed their EFS recently on the new released phones
it's no longer how it was with the Galaxy S line of phones
No one know if we really can backup and restore /factory (EFS)?
this should put an .img file in /sdcard. It's the same method as the one in the sgs2 section but with different paths.
Code:
adb shell
su
cat /dev/block/platform/omap/omap_hsmmc.0/by-name/efs > /sdcard/efs.img
edit: you'll need to be root, obviously
edit again:
this is technically better but does the same thing:
Code:
adb shell
su
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs of=/sdcard/efs.img
Out of curiosity, what is efs?
I am pretty familiar with flashing my HTC Desire, but there is not an efs partition (AFAIK)?
Cheers!
It backs up your imei information in case it gets corrupted by flashing custom roms and mods
Sent from my GT-I9000 using xda premium
420SYN said:
It backs up your imei information in case it gets corrupted by flashing custom roms and mods
Sent from my GT-I9000 using xda premium
Click to expand...
Click to collapse
Cool thanks!
Stew
Is this something specific to Samsung phones? I have been rooting and flashing since the nexus one and have never needed this.
Doesn't clockwork mod back this up? If not, why not?
Sent from my LG-P999
dave_t321 said:
Code:
adb shell
su
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs of=/sdcard/efs.img
Click to expand...
Click to collapse
Would it be if=/dev/block/platform/omap/omap_hsmmc.0/by-name/factory since this partition is named "factory" now?
If the efs is really in the /factory folder and its not hardlinked files sitting somewhere else is there a better way to save the files and keeping the permissions?
Using tar or gzip on them before?
So which method to follow in order to backup my efs folder?All information is under /factory
use
Code:
adb shell
su
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs of=/sdcard/efs.img
this is the right command as if you run ls on the by-name folder you can see that it is still efs not factory
factory must be a link to this
omg, i have a 0049... IMEI after flashing ICL53F via fastboot!
how could i restore my old IMEI?
edit: jippie, i got my IMEI back after flashing the ITL41F odin version from this post!
i suggest everyone to backup the efs before flashing other firmwares!
Could someone provide the correct commands to restore the efs folder please Ive backed it up just need to know how to restore it if something bad happens
There is a guide for it on these forums. Google 'efs restore android' and you should find it.
There is also an efs restore application that will use img files (like how we made in this guide) instead of just the nv_data.bin
Sent from my Galaxy Nexus using XDA App
does it actually work with this phone?
fun w/ shellfoo
Code:
IF YOU HAVE BUSY BOX INSTALLED
adb shell
su -
for i in $(ls /dev/block/platform/omap/omap_hsmmc.0/by-name/ | grep -v user)
do
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/${i} of=/sdcard/${i}.img &
done
NO BUSYBOX:
adb shell
su -
for i in boot cache dgs efs metadata misc param radio recovery sbl system xloader
do
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/${i} of=/sdcard/${i}.img &
done
---------- Post added at 03:43 PM ---------- Previous post was at 03:15 PM ----------
[/COLOR]
dave_t321 said:
this should put an .img file in /sdcard. It's the same method as the one in the sgs2 section but with different paths.
Code:
adb shell
su
cat /dev/block/platform/omap/omap_hsmmc.0/by-name/efs > /sdcard/efs.img
edit: you'll need to be root, obviously
edit again:
this is technically better but does the same thing:
Code:
adb shell
su
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs of=/sdcard/efs.img
Click to expand...
Click to collapse
i've foud this one..wich is better?
adb shell
su
busybox dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs of=/data/media/my_efs_backup.img
They are the same with different output locations. The one that leads with busy box is for a configuration where the commands are not aliased for a busy box setup.
Sent from my Galaxy Nexus using XDA App
Similar thing happened to me. I got a 2nd nexus, decided to restore a nandroid from my 1st nexus onto the 2nd one. Restore went fine, it was like a clone of the 1st phone except the IMEI was corrupt with a generic 0049... one. I flashed the phone back to a google factory ITL41D and the IMEI was restored. Needless to say I won't be doing that again!
paratox said:
omg, i have a 0049... IMEI after flashing ICL53F via fastboot!
how could i restore my old IMEI?
edit: jippie, i got my IMEI back after flashing the ITL41F odin version from this post!
i suggest everyone to backup the efs before flashing other firmwares!
Click to expand...
Click to collapse

[Q] Root gn gsm 4.0.4

Hey guys,
I flashed the 4.0.4 factory image today and was wondering how i can get root access without flashing a custom recovery since i want to stay stock atm.
I already tried the method i usually used (on 4.0.1 & 4.0.2)
Sorry can't post links... it's the normal method with fastboot and adb
and another method where you fastboot cwm recovery and then use adb commands but both didn't work for me
I can't post links so that's what i did there:
Temporarily boot into the Clockwork Mod Reovery using fastboot (on the computer)
fastboot boot cwmt-recovery-5.8.0.2.maguro.img (or whatever version you are using)
Mount /system using Clockwork Mod (on the phone):
mounts and storage -> mount /system
Chmod su using adb to turn on the setuid bit (on the computer)
adb shell chmod 6755 /system/bin/su
adb shell chown root:root /system/bin/su
adb shell ls -l /system/bin/su (permissions should now be -rwsr-xr-x)
Reboot. Super user should be working as expected (and your stock recovery is still intact)
Anyway,
I already spent much time to search on this forum and google so i was wondering if anyone knows any method which i could use.
You can root using this toolkit http://forum.xda-developers.com/showthread.php?t=1392310
Sent from my GNex {GSM} T-Mobile
Mojochief said:
Hey guys,
I flashed the 4.0.4 factory image today and was wondering how i can get root access without flashing a custom recovery since i want to stay stock atm.
I already tried the method i usually used (on 4.0.1 & 4.0.2)
Sorry can't post links... it's the normal method with fastboot and adb
and another method where you fastboot cwm recovery and then use adb commands but both didn't work for me
I can't post links so that's what i did there:
Temporarily boot into the Clockwork Mod Reovery using fastboot (on the computer)
fastboot boot cwmt-recovery-5.8.0.2.maguro.img (or whatever version you are using)
Mount /system using Clockwork Mod (on the phone):
mounts and storage -> mount /system
Chmod su using adb to turn on the setuid bit (on the computer)
adb shell chmod 6755 /system/bin/su
adb shell chown root:root /system/bin/su
adb shell ls -l /system/bin/su (permissions should now be -rwsr-xr-x)
Reboot. Super user should be working as expected (and your stock recovery is still intact)
Anyway,
I already spent much time to search on this forum and google so i was wondering if anyone knows any method which i could use.
Click to expand...
Click to collapse
Download this file to /sdcard, boot CWM like you posted, and then, once in CWM, flash the file you downloaded. Done.
EDIT: All that file does, is copy su and Superuser.apk to your device and set the appropriate permissions.
You can root using this toolkit http://forum.xda-developers.com/show....php?t=1392310
Sent from my GNex {GSM} T-Mobile
Click to expand...
Click to collapse
Thanks I'll try it, but I'm actually not a big fan of one click thingies where you don't know what you're doing.
Download this file to /sdcard, boot CWM like you posted, and then, once in CWM, flash the file you downloaded. Done.
Click to expand...
Click to collapse
Thank you I really prefer that over toolkits!
Mojochief said:
Thank you I really prefer that over toolkits!
Click to expand...
Click to collapse
This is what that file does:
Mounts the system parition
Copies Superuser.apk to /system/app
Copies su to /system/xbin
Sets permission on Superuser.apk to 0644
Sets permission on su to 06755
Sets a symlink for /system/xbin/su to /system/bin/su
Unmounts the system partition.
This is what that file does:
Mounts the system parition
Copies Superuser.apk to /system/app
Copies su to /system/xbin
Sets permission on Superuser.apk to 0644
Sets permission on su to 06755
Sets a symlink for /system/xbin/su to /system/bin/su
Unmounts the system partition.
Click to expand...
Click to collapse
Just tried it and it worked just fine
And thank you for the explanation!
So actually you could do it w/out booting cwm just with fastboot+adb right?
Mojochief said:
[snip]
So actually you could do it w/out booting cwm just with fastboot+adb right?
Click to expand...
Click to collapse
No. You need root access on boot to execute those commands. CWM boots android with root access by default, so this allows you to execute the commands. If you do not use CWM, you can use any other boot image that gives you root access on boot.
No. You need root access on boot to execute those commands. CWM boots android with root access by default, so this allows you to execute the commands. If you do not use CWM, you can use any other boot image that gives you root access on boot.
Click to expand...
Click to collapse
Yeah i meant with another boot image which gives you root access, like the one i used to root the earlier builds.
Mojochief said:
Yeah i meant with another boot image which gives you root access, like the one i used to root the earlier builds.
Click to expand...
Click to collapse
Yes, you can use another insecure boot image, but it needs to be a 4.0.4 compatible kernel. Older ones won't work.
Sent from my Galaxy Nexus using Tapatalk

[GUIDE] If your EFS is corrupt

When I first got SGS3 I made efs backup as suggested by xda. I didn't backup it as a folder, only as a dd block copy.
So if you are good today - make block copy of EFS and tar copy using adb:
adb shell
su
dd if=/dev/block/mmcblk0p11 of=/sdcard/efs.sbn
cd /sdcard
tar cvf efs.tar /efs
Also there is a way of saving NVRam into recovery. Do it now if you haven't yet:
adb reboot nvbackup
Then if you still don't feel safe download QPST tools from IMEI thread and backup your NVRam to PC.
My earpiece died and I got a replacement SGS3.
Something (CWM6?) caused IMEI corruption. I didn't know that, so I tried reflashing modems and ROMs. I was trying everything to restore my connectivity. It somehow didn't help that there are seversal guides on how to do IMEI restore.
While I was waiting for another tool download I decided to restore efs from my previous SGS3 on to current SGS3 (I was at my wits end). And I didn't backup current EFS - my huge mistake! But I already almost give up on the phone at that point.
QPST+Peoplearmy tool was able to restore my IMEI. But EFS is now corrupt (why? I cannot even mount it!). And I can only use one modem - the one I used when backing up EFS (UCALG1 modem).
On the good side - after formatting EFS and making it clean, I can run CM10.1 without any issues. My serial number is 000000, but who cares.
Here's how to format EFS:
1. Reboot into recovery (CWM 5.8.0.5 touch is my preferred)
2. You should be able to see phone connected to PC in adb (recovery mode)
3. Issue following commands:
adb shell
mke2fs -T ext4 /dev/block/mmcblk0p11
mkdir /efs
mount -w -t ext4 /dev/block/mmcblk0p11 /efs
Lesson learned - try not to mess with EFS at all. Do IMEI restore using QPST and Peoplearmy. I'll keep you posted on EFS restore efforts.
Assuming I made a block copy of my EFS partition using "dd if=/dev/block/mmcblk0p11 of=/sdcard/efs.sbn".
How would I restore it should I corrupt my EFS?
Like this?
dd if=/sdcard/efs.sbn of=/dev/block/mmcblk0p11
HiKsFiles said:
Assuming I made a block copy of my EFS partition using "dd if=/dev/block/mmcblk0p11 of=/sdcard/efs.sbn".
How would I restore it should I corrupt my EFS?
Like this?
dd if=/sdcard/efs.sbn of=/dev/block/mmcblk0p11
Click to expand...
Click to collapse
Correct.
Sent from my SAMSUNG-SGH-I747 using xda premium
---------- Post added at 03:19 PM ---------- Previous post was at 03:15 PM ----------
Or you can do the backup in one nice command:
dd if=/dev/block/mmcblk0p11 | gzip -9 > /sdcard/efs.gz
And to restore:
gunzip /sdcard/efs.gz - | dd of=/dev/block/mmcblk0p11
Oh, and you don't need to reformat the partition before restoring, that happens during the restore, because every bit gets overwritten.
Sent from my SAMSUNG-SGH-I747 using xda premium
bravomail said:
...make block copy of EFS and tar copy using adb:
adb shell
su
dd if=/dev/block/mmcblk0p11 of=/sdcard/efs.sbn
cd /sdcard
tar cvf efs.tar /efs
Click to expand...
Click to collapse
The TAR command failed for me on my i747, TAR not found.
d3athsd00r said:
Or you can do the backup in one nice command:
dd if=/dev/block/mmcblk0p11 | gzip -9 > /sdcard/efs.gz
Click to expand...
Click to collapse
This worked like a charm for me, thanks.

How To Guide How to backup your partitions with command line (requires root)

How to backup partition images with dd on the command line (root required)​
We don't currently have a working custom recovery for the Xperia 10 III, but if you have root there's a simple method to dump partition images.
This is a very good idea and you should do it at least once, especially if you like to mess around the device a lot.
You won't be able to do this before you root, so by the time you do some partitions will not be stock anymore. Use XperiFirm instead to get the clean stock images.
Special partitions:​
The userdata partition holds all your personal files and system settings. It's huge (about 105 GB) and obviously you can't dump it into itself. You can dump it on an SD card if it's 128+ GB.
The super partition is a physical partition that contains several logical partitions (including system and vendor) That's why you won't find those in the partition list. This is done on Android 10+ devices to allow those logical partitions to be resized or rearranged as needed. You don't need to split out the internal logical partitions, you can flash back the entire super partition. The stock firmware also comes with a super image, not individual logical partitions.
Using a helper script:​There's a Magisk module called Backup (by Draco) which gives you a command line shell script you can use if you prefer. It mostly does the same things I described above. The script is here if anybody wants to just grab it directly.
On the plus side, the script knows to dump only the active A/B image (which is the one that interests you most). On the flip side, it doesn't have a feature to skip userdata.
So here is a shell command that will use the backup script to dump all partitions, but only those matching your device's active A/B slot, and skips userdata:
Code:
backup $(ls /dev/block/bootdevice/by-name/ | grep -v userdata | sed 's/_[ab]$//')
And here's one that also skips super:
Code:
backup $(ls /dev/block/bootdevice/by-name/ | grep -v userdata | grep -v super | sed 's/_[ab]$//')
How to dump partitions manually:​If you can't/won't use the helper script you can do it by hand. All the following commands need root:
Find the names of all the partitions:
Code:
ls /dev/block/bootdevice/by-name/
Dump one specific partition identified by NAME:
Code:
dd if=/dev/block/bootdevice/by-name/NAME of=NAME.img
Dump all partitions except userdata:
Code:
ls /dev/block/bootdevice/by-name/ | grep -v userdata | while read NAME; do echo dd if=/dev/block/bootdevice/by-name/${NAME} of=${NAME}.img; done
Find the active slot:
Code:
getprop ro.boot.slot_suffix
Get checksums for all the images after the dump:
Code:
md5sum *.img
Confused about _a and _b partitions?​You should read about A/B Seamless Updates.
Long story short, some partitions have two copies eg. boot_a and boot_b. When you boot up the device you use the partitions in one slot (eg. the _a partitions). When an OTA update is being downloaded, it writes into the partitions for the other slot (eg. the _b partitions). Your phone can stay in use while this happens. If the OTA fails nothing is broken, you just keep using the good slot partitions. After the OTA is successful you switch to the other slot and also have the previous version in the other slot in case you need to switch back.
This means that some of the _a and _b images for the same partition can be different for you! So it's strongly recommended to do the checksums, and also to find out which is your active slot, so you know which partitions you're using right now.
I used a 128 GB card to take a backup of userdata. The backup script had some trouble with the backup location being on the storage card for some reason and I didn't have time to figure it out, but the dd command I gave above worked fine.
Code:
# time dd if=/dev/block/bootdevice/by-name/userdata of=userdata.img
112111374336 bytes (104 G) copied, 2342.274225 s, 46 M/s
39m02.31s real 1m11.78s user 14m44.72s system
Code:
# adb pull /storage/1234-ABCD/backup/userdata.img ./
/storage/1234-ABCD/backup/userdata.img: 1 file pulled, 0 skipped.
87.2 MB/s (112111374336 bytes in 1225.663s)
So that's 104 GB that took 39 minutes to be written to a new Samsung Evo U3/V30 microSDXC (46 MB/sec real write speed) and 20 minutes to be read to the PC (Samsung Evo M.2) with adb pull over USB (87 MB/sec read speed). Just so you know what you're in for.
I was looking into whether I could speed up the process of taking userdata snapshots by dumping the partition directly to the PC, but you need to be root to access the device block. The stock ROM doesn't allow the command adb root, but I found this blog post which made me realize you can run a su -c command that asks dd to write to stdout and just pipe the output to a file. The post author has also made this helpful Python script which lets you do pulls and pushes with root-only files.
If you want to run the command directly (I've only tested on Linux, no idea if it works on PowerShell but it might):
Code:
# adb shell "su -c" "dd if=/dev/block/bootdevice/by-name/userdata" > userdata.img
If you want to use the Python script:
Code:
# adb-root.py pull /dev/block/bootdevice/by-name/userdata userdata.img
Using the same fast SSD on the PC side as above, I now get:
Code:
218967528+0 records in
218967528+0 records out
112111374336 bytes (104 G) copied, 1077.681097 s, 99 M/s
real 17m57.910s
So that's roughly 15 minutes compared to 1 hour total with the previous method and you don't need to have a 128 GB SD card anymore.
Are you able to switch to a different backup location? Say a USB OTG if possible.
mikeshutte said:
Are you able to switch to a different backup location? Say a USB OTG if possible.
Click to expand...
Click to collapse
With dd yes, simply move to the directory you want before you call dd.
The backup script is bugged and seems to ignore the -d parameter for the backup location so it always uses /sdcard/backup. (I think it might be expecting a different version of getopts...) Normally I would say to try creating a symlink from /sdcard/backup to the OTG storage but the ln utility is also behaving strangely and I can't make any symlinks (even with root).
wirespot said:
With dd yes, simply move to the directory you want before you call dd.
The backup script is bugged and seems to ignore the -d parameter for the backup location so it always uses /sdcard/backup. (I think it might be expecting a different version of getopts...) Normally I would say to try creating a symlink from /sdcard/backup to the OTG storage but the ln utility is also behaving strangely and I can't make any symlinks (even with root).
Click to expand...
Click to collapse
Ok I'll give it a try and see what happens. Thanks for your help.
Hi, I'm used to TWRP backups, so I don't really understand this tool. I've backedup everything except the massive userdata partition. If needed, how would I restore this? Is the userdata partition required when I have all the others?
Thanks!
jakito said:
Hi, I'm used to TWRP backups, so I don't really understand this tool. I've backedup everything except the massive userdata partition. If needed, how would I restore this? Is the userdata partition required when I have all the others?
Thanks!
Click to expand...
Click to collapse
This is basically the same thing that TWRP does, dd is a command line Linux tool that makes a "raw" copy of a partition.
Restoration is a bit more tricky. In theory you can simply dump the raw backup copy over the partition. The problem is that it's not ok to do it while the system is running. Typically it's done by booting into recovery (TWRP) and overwriting the partition from there.
Another method for restore is to use fastboot, which is an alternative tool you can boot into that only does one thing, write partitions. But fastboot is typically locked by the vendor to only write signed images, so it can only be used to write official release ROMs.
There are some limited uses for fastboot, such as overwriting the boot partition, which is not checked for signature anymore once you've unlocked the bootloader. So if you want to experiment with unofficial kernels and mess something up you can always restore a good boot partition with fastboot.
TLDR: for the time being until we get a working TWRP recovery the most you can do is take backups, but not restore them.
wirespot said:
This is basically the same thing that TWRP does, dd is a command line Linux tool that makes a "raw" copy of a partition.
Restoration is a bit more tricky. In theory you can simply dump the raw backup copy over the partition. The problem is that it's not ok to do it while the system is running. Typically it's done by booting into recovery (TWRP) and overwriting the partition from there.
Another method for restore is to use fastboot, which is an alternative tool you can boot into that only does one thing, write partitions. But fastboot is typically locked by the vendor to only write signed images, so it can only be used to write official release ROMs.
There are some limited uses for fastboot, such as overwriting the boot partition, which is not checked for signature anymore once you've unlocked the bootloader. So if you want to experiment with unofficial kernels and mess something up you can always restore a good boot partition with fastboot.
TLDR: for the time being until we get a working TWRP recovery the most you can do is take backups, but not restore them.
Click to expand...
Click to collapse
I see. Thank you nonetheless!
wirespot said:
This is basically the same thing that TWRP does, dd is a command line Linux tool that makes a "raw" copy of a partition.
Restoration is a bit more tricky. In theory you can simply dump the raw backup copy over the partition. The problem is that it's not ok to do it while the system is running. Typically it's done by booting into recovery (TWRP) and overwriting the partition from there.
Another method for restore is to use fastboot, which is an alternative tool you can boot into that only does one thing, write partitions. But fastboot is typically locked by the vendor to only write signed images, so it can only be used to write official release ROMs.
There are some limited uses for fastboot, such as overwriting the boot partition, which is not checked for signature anymore once you've unlocked the bootloader. So if you want to experiment with unofficial kernels and mess something up you can always restore a good boot partition with fastboot.
TLDR: for the time being until we get a working TWRP recovery the most you can do is take backups, but not restore them.
Click to expand...
Click to collapse
I don't know how I ended up but making a backup you can't restore is completely pointless.
Techguy777 said:
I don't know how I ended up but making a backup you can't restore is completely pointless.
Click to expand...
Click to collapse
No, it's not. All your data is in there. You can mount your backup on a linux computer and pull out apks as well as app data. You can then restore these folder by folder with adb and a root shell on your phone.
That beeing said, does anyone know a proper backup software like Titanium Backup for Android 11 and above? Sometimes I read recommendations, but looking at the ratings it seems that no software manages to achieve the same level of comfort and control. Also they all seem to suffer from the same limitations.
Let's be honest: Google wants to make your life hard, so they can lock you in.
@xperinaut
I'm using Titanium on Android 11. Is it not working for you?

Categories

Resources