5,598,233 Members 47,502 Now Online
XDA Developers Android and Mobile Development Forum

[Q] Black screen/bootlooped Defy MB525

Tip us?
 
PhilipCetero
Old
#21  
Junior Member
Thanks Meter 8
Posts: 10
Join Date: Feb 2014
Quote:
Originally Posted by thekguy View Post
2nd system/ multiboot is a good idea to get past the bad blocks (probably some performance hit though) but better than a non functional phone. 2nd system should work even with a stock ROM as secondary system, not sure why it isn't working for you. I have no idea about the badblock remapping logic

Sent from my MB526 using Tapatalk
Thanks for that hint, I'll try 2nd-booting a stock system again if it's meant to work!

I think performance would suffer a little if the SD card is slower than eMMC, but not beyond that, once the system is up and running.
 
thekguy
Old
#22  
thekguy's Avatar
Senior Member
Thanks Meter 242
Posts: 823
Join Date: Nov 2009
Location: Mumbai
Quote:
Originally Posted by PhilipCetero View Post
Thanks for that hint, I'll try 2nd-booting a stock system again if it's meant to work!

I think performance would suffer a little if the SD card is slower than eMMC, but not beyond that, once the system is up and running.
Could you please elaborate on the badblocks thing? It could help many with similar problems

Sent from my MB526 using Tapatalk
+-+-+-+ -+-+-+ +-+- + +-+-+- + -+-+-+-+-+-+-
| C | M | 1 | 1 | . | 0 | | b | y | | Q | u | a | r | x |
+-+-+-+- +-+-+ +-+- + +-+-+- +- +-+-+-+-+-+-

Don't forget to click the thanks button if I helped you

 
PhilipCetero
Old
#23  
Junior Member
Thanks Meter 8
Posts: 10
Join Date: Feb 2014
Quote:
Originally Posted by thekguy View Post
Could you please elaborate on the badblocks thing? It could help many with similar problems

Sent from my MB526 using Tapatalk
I'll try!

Badblocks is a file system feature of ext2 and its newer derivatives. It is most easily accessed by specifying the -c option to e2fsck, either once or twice. If specified once, e2fsck will try reading every block on the file system, and record unreadable blocks as damaged. If it's specified twice, e2fsck will try reading and writing every block. While the manpage calls this latter test "non-destructive", that isn't true: e2fsck will try to restore each block after the test, but a reboot in the middle of things can leave the system unbootable, and you'd have to flash an SBF to recover.

We could do this from TWRP. Unfortunately, badblocks does not appear to be included in the TWRP ramdisk, so you'd have to build your own.

Another option is to combine checking for badblocks with mke2fs, with the same -c or -cc option, though we must be careful not to write a file system to the very end of /dev/block/mmcblk1p21. Again, a high risk of having to restart from SBF if the phone reboots during the operation.

In summary, here are untested instructions, assuming a Linux shell.
  1. acquire a badblocks binary (I'm currently trying to generate one)
  2. reboot into TWRP
  3. adb push badblocks /system/bin/
  4. adb shell e2fsck -c /dev/block/mmcblk1p21
  5. adb shell e2fsck -c /dev/block/mmcblk1p24
  6. adb shell e2fsck -c /dev/block/mmcblk1p25
The Following User Says Thank You to PhilipCetero For This Useful Post: [ Click to Expand ]
 
thekguy
Old
(Last edited by thekguy; 6th March 2014 at 01:05 PM.)
#24  
thekguy's Avatar
Senior Member
Thanks Meter 242
Posts: 823
Join Date: Nov 2009
Location: Mumbai
While your theory seems fine, it will depend on the fact whether e2fsck would be able to access the part of the system partition where the recovery itself is stored(not sure if it is loaded entirely into memory).
If it could, then writing to them would crash the shell. Otherwise, those blocks could be marked as 'bad', and that will be another problem in itself. Just off the top of my head..

Sent from my MB526 using Tapatalk
+-+-+-+ -+-+-+ +-+- + +-+-+- + -+-+-+-+-+-+-
| C | M | 1 | 1 | . | 0 | | b | y | | Q | u | a | r | x |
+-+-+-+- +-+-+ +-+- + +-+-+- +- +-+-+-+-+-+-

Don't forget to click the thanks button if I helped you

 
PhilipCetero
Old
#25  
Junior Member
Thanks Meter 8
Posts: 10
Join Date: Feb 2014
Quote:
Originally Posted by thekguy View Post
While your theory seems fine, it will depend on the fact whether e2fsck would be able to access the part of the system partition where the recovery itself is stored(not sure if it is loaded entirely into memory). Otherwise, those blocks could be marked as 'bad', and that will be another problem in itself. Just off the top of my head..

Sent from my MB526 using Tapatalk
Yes, TWRP is loaded entirely into memory. You're right that if we can't get to recovery, we can't use badblocks from it, but it's far more likely that the 6 MB TWRP uses are uncorrupted than that the entirety of /system is.

We can also combine my two ideas, and put a minimal boot script into /system/logwrapper, then load TWRP itself from the SD card. That would require only /system/bin/logwrapper and /system/bin/busybox to be writable (once) and readable (on every boot). If we can't even do that, I see no way of saving the phone.
 
thekguy
Old
#26  
thekguy's Avatar
Senior Member
Thanks Meter 242
Posts: 823
Join Date: Nov 2009
Location: Mumbai
Also, is the bad blocks list preserved after a format? Otherwise it would necessitate checking after every data wipe.

The second idea will most probably work

Sent from my MB526 using Tapatalk
+-+-+-+ -+-+-+ +-+- + +-+-+- + -+-+-+-+-+-+-
| C | M | 1 | 1 | . | 0 | | b | y | | Q | u | a | r | x |
+-+-+-+- +-+-+ +-+- + +-+-+- +- +-+-+-+-+-+-

Don't forget to click the thanks button if I helped you

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


TRENDING IN THEMER...