Jump to content

Bad blocks on internal flash


Guest The_Knife

Recommended Posts

Guest The_Knife

I can't get any version of CyanogenMod more recent than 7.1.0-RC1 to boot and the problem appears to be corruption of boot.img (see here). If I go to Advanced->Show log in ClockworkMod Recovery after installing the ROM, I get errors like this:

mtd: not writing bad block at 0x00340000 (ret 1 errno 2)

If I do Advanced->Report Error and then check the recovery.log file created, it has two errors like that after the line "flashing boot from /tmp/boot.img". Could the bad blocks be the cause of the corruption? Is it possible to fix or work around the bad blocks?

Full log here.

Link to comment
Share on other sites

Guest unrandomsam

I can't get any version of CyanogenMod more recent than 7.1.0-RC1 to boot and the problem appears to be corruption of boot.img (see here). If I go to Advanced->Show log in ClockworkMod Recovery after installing the ROM, I get errors like this:

mtd: not writing bad block at 0x00340000 (ret 1 errno 2)

If I do Advanced->Report Error and then check the recovery.log file created, it has two errors like that after the line "flashing boot from /tmp/boot.img". Could the bad blocks be the cause of the corruption? Is it possible to fix or work around the bad blocks?

Full log here.

Try flashing the boot.img with fastboot instead.

Link to comment
Share on other sites

Guest targetbsp

Flash memory blocks can leave the factory dead or last 10's of 1000's of writes. As hedgepigdaniel says, it should be handled. In fact I seem to recall wbaw increasing the size of the splash partition in the tpt because there wasn't enough space to handle a bad block in someones splash partition. So it obviously worked in that case!

Link to comment
Share on other sites

Guest The_Knife

Try flashing the boot.img with fastboot instead.

Didn't help. Booting the new boot.img directly with "fastboot boot boot.img" works though!

Why would booting from flash fail while booting from RAM works? I guess this makes it even more likely that the problem is with the flashing process.

Flash memory blocks can leave the factory dead or last 10's of 1000's of writes. As hedgepigdaniel says, it should be handled. In fact I seem to recall wbaw increasing the size of the splash partition in the tpt because there wasn't enough space to handle a bad block in someones splash partition. So it obviously worked in that case!

How can I tell if I've run out of space on the boot partition?

I think my boot partition is 5 MiB but boot.img is just 3.5 MiB, and there are only error messages for two out of 30 128 KiB blocks, so it seems unlikely to be a space issue.

From /proc/kmsg:

Partition (from atag) recovery -- Offset:156 Size:28

Partition (from atag) boot -- Offset:17e Size:28

...

Partition (from atag) system -- Offset:1c3 Size:500

If I take size as a hexadecimal multiple of 128 KiB, I get 160 MiB for system (which is correct) and 5 MiB for boot.

i was wondering if/when something like this would happen. too much rom flashing the cause?

I hadn't flashed that many ROMs before I ran into this CM booting problem. No more than ten, I think. Since then I've done 20+ times though...

Link to comment
Share on other sites

Guest The_Knife

I guess you can try using a difffernt firmware so that the boot partition resides on a different section of flash?

To move the boot partition I'd have to repartition using TPT though, right?

Link to comment
Share on other sites

Guest unrandomsam

To move the boot partition I'd have to repartition using TPT though, right?

If CM7.1-RC1 works don't understand why anything else wouldn't

I suppose you could (Temporary) just install the boot.img into recovery

(and then fastboot boot recovery.img when you need it).

I have had situations where flash_image hasn't worked properly but fastboot did.

(Fair few people had problems with very recent clockworkmod's flashing from rommanager or recovery).

Link to comment
Share on other sites

Guest The_Knife

I suppose you could (Temporary) just install the boot.img into recovery

It worked! Thanks! Even more proof that something is wrong with my boot partition.

I also flashed a recovery to the boot partition and that appeared to work too. So now I can boot Android by holding Power+Vol- and boot recovery by holding just the power button. :lol:

fastboot flash boot recovery-clockwork-5.0.2.0-blade.img

fastboot flash recovery boot.img

How would I extract the data from those partitions to check for corruption?

Edited by The_Knife
Link to comment
Share on other sites

Guest unrandomsam

It worked! Thanks! Even more proof that something is wrong with my boot partition.

I also flashed a recovery to the boot partition and that appeared to work too. So now I can boot Android by holding Power+Vol- and boot recovery by holding just the power button. :lol:

fastboot flash boot recovery-clockwork-5.0.2.0-blade.img

fastboot flash recovery boot.img

How would I extract the data from those partitions to check for corruption?

You can use

dump_image (from clockworkmod)

i.e mount the sdcard

adb shell

dump_image boot /sdcard/boottest.img

dump_image recovery /sdcard/recoverytest.img

I don't know whether they are expected to be identical to what you flashed though.

You might have luck trying to go through the whole windows flashing process.

Link to comment
Share on other sites

Guest unrandomsam

You can use

dump_image (from clockworkmod)

i.e mount the sdcard

adb shell

dump_image boot /sdcard/boottest.img

dump_image recovery /sdcard/recoverytest.img

I don't know whether they are expected to be identical to what you flashed though.

You might have luck trying to go through the whole windows flashing process.

No those results don't mean anything.

777287e4a51c90c30f8e952785ebd062 recovery-clockwork-5.0.2.0-blade.img

6a71a639673b9100d7f83701f8fdedb4 recovery_clockwork_5.2.0.img

Guess

flashing / dump / then fastboot boot might (if it failed) explain something, (Windows flasher (The same layout) might be more helpful though)

think hedgepigdaniel has a guide.

Link to comment
Share on other sites

Guest hedgepigdaniel

sounds like you got a fairly good solution

The idea was to try using a different option to what you have from either a Gen2 firmware for Gen1 TPTs or a Gen2 firmware that accepts image.bin files (like a stock Gen2). Reason is that I think the normal partitions start a good 15MB later in stock Gen2 than wbaws firmwares (remember people worked out how to move them back to where they were in Gen1)

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.