[RECOVER FROM HARD BRICK] Galaxy S2 i777 Unbrick Image

meantomatoes

Member
Oct 10, 2015
46
10
0
I'm trying to see if I can recover from a hard brick after flashing a corrupt .pit file. However, I can only find unbrick images for the other s2 model. May someone please create an image from their i777 using the script I attached to this post? I haven't tested the script so I'm not sure it'll work. This will copy almost everything on your device I believe.

EDIT
: Unfortunately, it seems I was dumb enough to super hard brick my S2 by flashing a corrupt .pit file. So don't do that. However, if you don't have a super hard bricked i777 but just hard bricked, you can use this image and use Win32DiskImager to "burn" the image onto an SD card that must be at least 16 GB in size. Then, take the battery out of your device, stick the SD card in, stick the battery on, and power up. You might need to burn the image a couple times. This will allow your hard bricked device to boot to the OS if not just download mode. If this doesn't work, a JTAG might work though it's unlikely, or you need the EMMC chip to be totally replaced. Good luck. Googling "hard brick SD card" might warrant better instructions than these. The file attached is an .sh script to create an unbrick image for any device in case you need it.
 
Last edited:
  • Like
Reactions: ethanchow

SteveMurphy

Recognized Contributor
Apr 22, 2012
1,656
2,702
153
Atlanta
I'm trying to see if I can recover from a hard brick after flashing a corrupt .pit file. However, I can only find unbrick images for the other s2 model. May someone create an image from their i777?
Have you checked this thread by @creepyncrawly, because it will have what you need to recover your device. Specifically check out section 2a; I think that will help you. If you're successful with the 2a method, do a factory reset in the stock recovery before booting into the ROM - otherwise you'll encounter a bootloop.
 

meantomatoes

Member
Oct 10, 2015
46
10
0
Have you checked this thread by @creepyncrawly, because it will have what you need to recover your device. Specifically check out section 2a; I think that will help you. If you're successful with the 2a method, do a factory reset in the stock recovery before booting into the ROM - otherwise you'll encounter a bootloop.
My device isn't soft bricked, it's hard bricked. Completely dead. My only hope is getting an unbrick image or a JTAG which is more expensive than to get a new S2.
 

meantomatoes

Member
Oct 10, 2015
46
10
0
Unfortunately I know if no "unbrick image" for the i777, but @creepyncrawly has a .pit file in his signature if I remember. That may be your only option.
Wouldn't be able to use the .pit file without an unbrick image. Someone with a working i777 can make one with a script. I know that this works for some hard bricks, but considering I flashed a corrupt .pit file, I'm not sure it would work for mine. I just fixed a hard bricked S3 last night for an unrelated reason, but the partition table was fine, it just wouldn't boot. I attached the unbrick creator script to this post and OP in case people don't have it.
 

Attachments

  • Like
Reactions: SteveMurphy

ethanchow

Senior Member
Jul 14, 2015
329
64
0
I'm trying to see if I can recover from a hard brick after flashing a corrupt .pit file. However, I can only find unbrick images for the other s2 model. May someone please create an image from their i777 using the script I attached to this post? I haven't tested the script so I'm not sure it'll work. This will copy almost everything on your device I believe.
how do you plan to flash the unbrick file? I have a working i777 and will be happy to help as long as its not too risky. So just flash the zip you attached and grab the file collected by dd? I have CM recovery, not cwm or twrp, what recovery should I use? Will it work if i just do the dd command from adb shell?
 
  • Like
Reactions: meantomatoes

meantomatoes

Member
Oct 10, 2015
46
10
0
how do you plan to flash the unbrick file? I have a working i777 and will be happy to help as long as its not too risky. So just flash the zip you attached and grab the file collected by dd? I have CM recovery, not cwm or twrp, what recovery should I use? Will it work if i just do the dd command from adb shell?
An unbrick file is basically your whole internal SD duplicated. When a phone is hard bricked, it scans the SDs for a working bootable OS, like a computer. You just have to format the SD card to FAT32 and essentially burn the image onto the SD card. It shouldn't change the internal SD card if it successfully boots off the SD card, but when you boot up you can use a terminal or something to fix your internal SD. No flashing necessary on either end. Looking at the script (it's not a flashable zip), it looks like it needs BusyBox. It'll make a directory at /sdcard/Unbrick Files, on your external SD card. I have no idea how much space it'll take up, but my guess is it'll be the size of however much used space your device has. I'm pretty sure any recovery (built into the kernel) would work but this is speculation since I've never used a non-stock unbrick img. As long as it's compatible with the OS currently installed. And I'm also not sure this will work at all because my internal SD's partition table is completely corrupted I think, but it's worth a try since this worked on a hard bricked S3 last night.

I think you need to open a terminal and run the unbrick creator .sh in su mode. Don't flash it. I'm pretty sure the dd command over adb is flashing and not like creating an image right?
 

ethanchow

Senior Member
Jul 14, 2015
329
64
0
An unbrick file is basically your whole internal SD duplicated. When a phone is hard bricked, it scans the SDs for a working bootable OS, like a computer. You just have to format the SD card to FAT32 and essentially burn the image onto the SD card. It shouldn't change the internal SD card if it successfully boots off the SD card, but when you boot up you can use a terminal or something to fix your internal SD. No flashing necessary on either end. Looking at the script (it's not a flashable zip), it looks like it needs BusyBox. It'll make a directory at /sdcard/Unbrick Files, on your external SD card. I have no idea how much space it'll take up, but my guess is it'll be the size of however much used space your device has. I'm pretty sure any recovery (built into the kernel) would work but this is speculation since I've never used a non-stock unbrick img. As long as it's compatible with the OS currently installed. And I'm also not sure this will work at all because my internal SD's partition table is completely corrupted I think, but it's worth a try since this worked on a hard bricked S3 last night.

I think you need to open a terminal and run the unbrick creator .sh in su mode. Don't flash it. I'm pretty sure the dd command over adb is flashing and not like creating an image right?
OK. so just run the commands in terminal with root? Will a 16gb sd card do? That is all I have atm.
 

ethanchow

Senior Member
Jul 14, 2015
329
64
0
As long as you don't have more than 16 gigs of files, yup.
Just did it, its only 27MB
Looks good? I can upload it now if this is the right one.
http://i.imgur.com/Rgx4Yse.png

terminal output:
Code:
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\Users\ethanchow>adb shell
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
7mail protected]:/ $ u
/system/bin/sh: u: not found
127|[email protected]:/ $ su
[email protected]:/ # mkdir -p /sdcard/Unbrick_Files/
block/mmcblk0 of=/sdcard/Unbrick_Files/200MB.img bs=4096 count=50000;         <
busybox gzip /sdcard/Unbrick_Files/*
50000+0 records in
50000+0 records out
204800000 bytes transferred in 33.450 secs (6122571 bytes/sec)
[email protected]:/ # busybox gzip /sdcard/Unbrick_Files/*
sh: busybox: not found
dev/block/mmcblk0 of=/sdcard/Unbrick_Files/200MB.img bs=4096 count=50000;     <
exit
^C24711+0 records in
24710+0 records out
101212160 bytes transferred in 12.927 secs (7829516 bytes/sec)

=/sdcard/Unbrick_Files/200MB.img bs=4096 count=50000;                         <
130|[email protected]:/ # ls
acct         file_contexts             init.usb.configfs.rc seapp_contexts
boot.txt     fstab.smdk4210            init.usb.rc          selinux_version
cache        init                      init.zygote32.rc     sepolicy
charger      init.cm.rc                mnt                  service_contexts
config       init.environ.rc           oem                  storage
d            init.rc                   preload              sys
data         init.recovery.smdk4210.rc proc                 system
default.prop init.smdk4210.rc          property_contexts    ueventd.rc
dev          init.smdk4210.usb.rc      res                  ueventd.smdk4210.rc
efs          init.superuser.rc         sbin                 vendor
etc          init.trace.rc             sdcard
[email protected]:/ # cd /sdcard
[email protected]:/sdcard # ls
ls: ./.android_secure: Permission denied
Alarms  CamScanner Download Music         Podcasts  TriangleAway.zip storage
Amino   DCIM       LOST.DIR Notifications Ringtones Unbrick_Files
Android Documents  Movies   Pictures      Snapchat  bluetooth
1|[email protected]:/sdcard # cd Unbrick_Files
[email protected]:/sdcard/Unbrick_Files # ls
200MB.img
=/sdcard/Unbrick_Files/200MB.img bs=4096 count=50000;                         <
50000+0 records in
50000+0 records out
204800000 bytes transferred in 29.522 secs (6937199 bytes/sec)
v /sdcard/Unbrick_Files/200MB.img.gz /sdcard/Unbrick_Files/Unbrick_IMG.gz     <
mv: bad '/sdcard/Unbrick_Files/200MB.img.gz': No such file or directory
1|[email protected]:/sdcard/Unbrick_Files # busybox gzip /sdcard/Unbrick_Files/*
sh: busybox: not found
127|[email protected]:/sdcard/Unbrick_Files # gzip /sdcard/Unbrick_Files/*
v /sdcard/Unbrick_Files/200MB.img.gz /sdcard/Unbrick_Files/Unbrick_IMG.gz     <
[email protected]:/sdcard/Unbrick_Files # chmod -R 777 /sdcard/Unbrick_Files
[email protected]:/sdcard/Unbrick_Files # exit
[email protected]:/ $ exit

C:\Users\ethanchow>adb pull /storage/C805-1910/Unbrick_Files/Unbrick_IMG.gz
3427 KB/s (29352335 bytes in 8.362s)

C:\Users\ethanchow>
 

meantomatoes

Member
Oct 10, 2015
46
10
0
Just did it, its only 27MB
Looks good? I can upload it now if this is the right one.
http://i.imgur.com/Rgx4Yse.png

terminal output:
Code:
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\Users\ethanchow>adb shell
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
7mail protected]:/ $ u
/system/bin/sh: u: not found
127|[email protected]:/ $ su
[email protected]:/ # mkdir -p /sdcard/Unbrick_Files/
block/mmcblk0 of=/sdcard/Unbrick_Files/200MB.img bs=4096 count=50000;         <
busybox gzip /sdcard/Unbrick_Files/*
50000+0 records in
50000+0 records out
204800000 bytes transferred in 33.450 secs (6122571 bytes/sec)
[email protected]:/ # busybox gzip /sdcard/Unbrick_Files/*
sh: busybox: not found
dev/block/mmcblk0 of=/sdcard/Unbrick_Files/200MB.img bs=4096 count=50000;     <
exit
^C24711+0 records in
24710+0 records out
101212160 bytes transferred in 12.927 secs (7829516 bytes/sec)

=/sdcard/Unbrick_Files/200MB.img bs=4096 count=50000;                         <
130|[email protected]:/ # ls
acct         file_contexts             init.usb.configfs.rc seapp_contexts
boot.txt     fstab.smdk4210            init.usb.rc          selinux_version
cache        init                      init.zygote32.rc     sepolicy
charger      init.cm.rc                mnt                  service_contexts
config       init.environ.rc           oem                  storage
d            init.rc                   preload              sys
data         init.recovery.smdk4210.rc proc                 system
default.prop init.smdk4210.rc          property_contexts    ueventd.rc
dev          init.smdk4210.usb.rc      res                  ueventd.smdk4210.rc
efs          init.superuser.rc         sbin                 vendor
etc          init.trace.rc             sdcard
[email protected]:/ # cd /sdcard
[email protected]:/sdcard # ls
ls: ./.android_secure: Permission denied
Alarms  CamScanner Download Music         Podcasts  TriangleAway.zip storage
Amino   DCIM       LOST.DIR Notifications Ringtones Unbrick_Files
Android Documents  Movies   Pictures      Snapchat  bluetooth
1|[email protected]:/sdcard # cd Unbrick_Files
[email protected]:/sdcard/Unbrick_Files # ls
200MB.img
=/sdcard/Unbrick_Files/200MB.img bs=4096 count=50000;                         <
50000+0 records in
50000+0 records out
204800000 bytes transferred in 29.522 secs (6937199 bytes/sec)
v /sdcard/Unbrick_Files/200MB.img.gz /sdcard/Unbrick_Files/Unbrick_IMG.gz     <
mv: bad '/sdcard/Unbrick_Files/200MB.img.gz': No such file or directory
1|[email protected]:/sdcard/Unbrick_Files # busybox gzip /sdcard/Unbrick_Files/*
sh: busybox: not found
127|[email protected]:/sdcard/Unbrick_Files # gzip /sdcard/Unbrick_Files/*
v /sdcard/Unbrick_Files/200MB.img.gz /sdcard/Unbrick_Files/Unbrick_IMG.gz     <
[email protected]:/sdcard/Unbrick_Files # chmod -R 777 /sdcard/Unbrick_Files
[email protected]:/sdcard/Unbrick_Files # exit
[email protected]:/ $ exit

C:\Users\ethanchow>adb pull /storage/C805-1910/Unbrick_Files/Unbrick_IMG.gz
3427 KB/s (29352335 bytes in 8.362s)

C:\Users\ethanchow>
Looks good to me! I'm pretty sure sure it gets much bigger when it's extracted but that's okay.
 
  • Like
Reactions: ethanchow

ethanchow

Senior Member
Jul 14, 2015
329
64
0
Looks good to me! I'm pretty sure sure it gets much bigger when it's extracted but that's okay.
OK. Uploading. Would you mind telling me how to put the file on the sdcard in case I need to unbrick in the future? Would you just dd it to the sdcard or copy the files, or something else? Thanks!

---------- Post added at 09:25 PM ---------- Previous post was at 09:23 PM ----------

Looks good to me! I'm pretty sure sure it gets much bigger when it's extracted but that's okay.
there you go! use at your own risk as always, but you have nothing to lose since you are already bricked ;)
https://www.androidfilehost.com/?fid=24651430732237478
One more thing, I repartitioned to 1gb system 6gb data using pit files from here http://forum.xda-developers.com/gal...ivatives/mod-increase-partition-size-t3011162
 
Last edited:

meantomatoes

Member
Oct 10, 2015
46
10
0
OK. Uploading. Would you mind telling me how to put the file on the sdcard in case I need to unbrick in the future? Would you just dd it to the sdcard or copy the files, or something else? Thanks!

---------- Post added at 09:25 PM ---------- Previous post was at 09:23 PM ----------


there you go! use at your own risk as always, but you have nothing to lose since you are already bricked ;)
https://www.androidfilehost.com/?fid=24651430732237478
You have to use Win32DiskImager to "burn" the .img onto the SD card. This will format it.
 
  • Like
Reactions: ethanchow

meantomatoes

Member
Oct 10, 2015
46
10
0
Gentlemen? I'm a girl, lol.

Yea, I read about the sd boot thing for the s3 i747 a while back, but never had to try it. From what I know, all you need to do is trigger it to boot from sd by shorting some pin to ground and then boot it into download mode and flash a good pit file and bootloader. There may also be some complications with radio if you don't have a efs backup.

No problem, glad to be able to help someone out there ;) I just hope it works out and won't make it worse(as if that could happen:D)
So I tried booting from the SD card and...nothing. I tried rewriting the SD card a couple times which is suggested and that still didn't work. I think this has to do with me flashing a corrupted .pit file and hard-hard bricking it; not even JTAG would fix this. However now it's now common knowledge that if you mess up all your partitions on your internal SD by flashing the wrong .pit, it's totally unrecoverable as far as I know. I may revisit this another day, but many thanks for helping anyway. I'll attach your unbrick image to the OP so other people with hard-bricked i777s can use it.
 

ethanchow

Senior Member
Jul 14, 2015
329
64
0
So I tried booting from the SD card and...nothing. I tried rewriting the SD card a couple times which is suggested and that still didn't work. I think this has to do with me flashing a corrupted .pit file and hard-hard bricking it; not even JTAG would fix this. However now it's now common knowledge that if you mess up all your partitions on your internal SD by flashing the wrong .pit, it's totally unrecoverable as far as I know. I may revisit this another day, but many thanks for helping anyway. I'll attach your unbrick image to the OP so other people with hard-bricked i777s can use it.
I think the phone won't boot of the SD if the emmc is corrupt, it will only boot off ad by default if emmc is blank. You need to somehow prompt it to boot from SD. I think on the s3 i747 you short some pin near CPU to ground, but idk for the s2 i777.
 
  • Like
Reactions: meantomatoes
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone