[HD2 Android NAND Development] AngelDeath:
Greetings All,

Now before I start, or anyone else trolls through here: I know that this is probably the wrong place to a degree, but to another degree it is not, so please save the posts.

I decided to make this an 'Awareness' post, due to the fact that many people are starting to complain about problems with Roms they are flashing. I for one with my Roms thought people were doing something wrong, or there was another underlying problem, but couldn't understand, until it happened to me during the building of my last ROM.

As we know our HD2's are aging and definitely showing their age as new and bigger Roms get released, and as many people see new Dev's are coming up with new ways to create partitions to make it easier for noobs. But one of the things that I think everyone fell short seeing is the Bad Block issue that is resulting with many flashes, and as well with Bad flashes.

Now some may argue the point that the bad blocks do not effect how the ROM flashes and that it runs fine even with bad blocks. My firm belief is that this theory or statement is 25% correct, and 75% incorrect. The reason I feel its 75% incorrect is most of the Roms currently out, such as CM7, or 2.1 Roms, use less space then the larger 3.0 Roms, And even the vanilla GB Roms use less. So in theory I feel thats where the 25% of the statement is correct. But again, there is a problem then too.

According to my last testing of my ROM, I encountered this Bad Block syndrome, why I don't know, How I don't know, age I am guessing or too many times of flashing of Roms. My Bad Blocks occurred in the data partition at least based on the recovery log and the restore log on my phone, which then created the following symptoms:

HTC Sync - Hot reboot

Installing Apps from Market - Hot Reboot

Restoring apps from Titanium Back up - Hot reboot

USB Disk drive Mount - Hot Reboot.

Random Reboots for no reason.

Spontaneous Reboots during charging.

I feel that depending on the location of the bad block(s) will result in different issues/errors during flashing or day to day use. Many people who have been flashing my ROM have been complaining of a wide variety of issues that I never seen, until now. And now I am asking people for their recovery log to see if my suspicion is true, and it seems it is.

So I went to search of why this occurs or if there is a way to fix it, I seen the posts about task 29, tried it, and failed, it did not remove the bad blocks, tried the goldcard way to restore back to factory default, which would wipe the phone and the bad blocks would be gone, again failed, the bad blocks remained. The I saw about a program called MTTY 1.42, I tried that program, did the task 28, Task 32, task 29, Task 2a (suppose to correct bad blocks) and doing an info 8 results in the bad blocks remain and not corrected.

So after exhausting all possible ideas, I decided to try something, since I wanted to get my ROM out, I tested my other HD2 phone with a bad screen (I own 2 TMOUS HD2 phones), and the test came back with a completely clean phone, no bad blocks, tested my ROM, none of the issues that I had didn't exist on the test phone, which firmed my stance that the bad blocks are affecting Android OS's far more then windows mobile OS. You may ask why, my theory is that being that this phone was originally a WinMo phone, WinMo phones again are smaller, and also use the whole phone for flashing, there also might be (do not know this for sure) an error checking routine for bad blocks, maybe it doesn't, but I think having more room to flash makes it possible to avoid the location, or I could be completely wrong.

Here is what my Result was after a info 8 in mtty:

Cmd>info 8

--- 2K bytes sector version ---

DEVICE NAME=samsung_KBY00U00VM

DEVICE ID=0xB3

DEVICE MAKER ID=0xEC

PAGE SIZE=0x800

TOTAL PAGE SIZE=0x840

BLOCK COUNT=0x2000

BLOCK PAGE=0x40

Checking block information

BLOCK 0 (0x0) is reversed block

BLOCK 1 (0x1) is reversed block

BLOCK 2 (0x2) is reversed block

BLOCK 3 (0x3) is reversed block

BLOCK 8 (0x8) is reversed block

BLOCK 10 (0xA) is reversed block

BLOCK 11 (0xB) is reversed block

BLOCK 12 (0xC) is reversed block

BLOCK 13 (0xD) is reversed block

BLOCK 14 (0xE) is reversed block

BLOCK 15 (0xF) is reversed block

BLOCK 4691 (0x1253) is bad block

BLOCK 6714 (0x1A3A) is bad block

BLOCK 7045 (0x1B85) is bad block

BLOCK 7275 (0x1C6B) is bad block

BLOCK 7430 (0x1D06) is bad block

BLOCK 7509 (0x1D55) is bad block

Partition[0], type=0x20, start=0x2, total=0x63E

Partition[1], type=0x23, start=0x640, total=0xA40

Partition[2], type=0x25, start=0x1080, total=0x1D780

Partition[3], type=0x4, start=0x1E800, total=0x59380

CE Total Length(with sector info) = 0xF4F4000

CE CheckSum Length(without sector info) = 0xF400000

Again according to the recover.log this is located in the data part of the system.

And I am seeing many people having the same issue. Now being that I have a tmous, but obviously with limited room now with bad blocks, I decided to attempt installing a EU version of my ROM which uses SD-Ext, and App2SD in it on my bad phone, repartitioned my phone from 400mb to 220mb in the system, flashed it and all the issues I had disappeared completely.

Now having a Tmous phone and doing this makes it obviously easy to by pass this problem, and for how long its unknown, but the Eu Versions of the phone will not be so lucky, and again its showing, because in the EU phones having only 512mb of space they have no choice but to use their SDcards already, so if they start running into this situation, they really have no alternative way to install Android except to move completely over to the SD version of android.

So what am I looking for with making this post?

Making Aware:

To the Chefs that certain issues that arise not to dismiss that someone did something wrong, understand that the possibility of the bad blocks can cause issues as I stated, and it could end up getting progressively worse.

To the Dev's hoping that someone will take on the task of trying to either a) find a way to implement an error checking routine script that can be used in a ROM so that locations that come back bad, can be marked bad or remembered so that they are not written to and stop the misc. issues that can occur, b) re-write the magdlr or clk &/or CWR as to check for these errors and mark them bad, just as a Hard Drive would, c) Write a program that actually fixes the bad blocks since mtty cannot.

To the Users: Understand that the Roms created work differently on every phone, no two phones will respond the same hence no different then computers. But also that people should start making it a habit to pull their recovery logs after a flash and check them to make sure their phones are clean and everything went fine. Because by checking the log if you see Bad Blocks, or blocks that couldn't be erased, it would be safe to say that you should expect errors or possibly erratic behavior of your phone on a daily basis.

How to See if you have Bad Blocks:

Okay since people are asking, here is a short step by step for both EU and TMous:

1) Format your Boot, Data, Cache, System, Dalvik Cache (Eu users your Dalvik Cache is on your sdcard on the SD-EXT)

2) Flash your rom.

3) After flashing DO NOT REBOOT.

4) Go to Advanced, then Error Report.

5) This will copy the Recover.log to your SDCard.

6) Go Back and enter Mount & Storage.

7) Mount USB SD.

8) On your computer navigate your SD Drive.

9) Look for a folder called: clockworkmod.

10) Inside you will find a file called: recovery.log

11) Copy this to your Desktop.

12) Open with Wordpad or Notepad++

If you see in that whole log, Could not erase blah blah bad block, or anything that says bad block, with the exception of a location called "system/xbin/badblocks" (This location is normal hats a file name), then you have bad blocks, and the more you have, the smaller your cwr partition actually is.