[HD2 General] ASCIIker:
i was wondering if my device has developed any bad blocks the other day. so the next time i had to restore my rom from a backup, i decided to look into it, using whatever steps/concepts i could remember.

i wanted to know which partition(s) had bad blocks, as opposed to a raw address that has to be interpreted later on. i remembered reading here that ClockworkModRecovery's "recovery.log" will contain this information when a partition or all partitions are formatted.

so i have a habit of formatting all partitions (except sd's FAT32) before i restore a backup. i did so and told CWM to copy the recovery.log to my sd's FAT32. perhaps you can use the same approach, i.e. take a CWM backup, then wipe all partitions, copy the recovery.log, and restore your backup. effectively, you will get your rom back just the way you left it and you will have determined if your device has bad blocks and how many and in which partitions.

then i continued with the restore.

when i had time later on, i opened the "recovery.log" i had copied earlier and noticed that it contained the following (notice the part in

bold+underline

below):

-- Wiping cache...
Formatting /cache...
Cache wipe complete.
rm: can't remove '/data/dalvik-cache': No such file or directory
rm: can't remove '/cache/dalvik-cache': No such file or directory
rm: can't remove '/sd-ext/dalvik-cache': No such file or directory
Dalvik Cache wiped.

-- Formatting boot...
Formatting /boot...

-- Formatting system...
Formatting /system...

-- Formatting data...
Formatting /data...
[U][B]mtd: erase failure at 0x09020000[/B][/U]
Formatting /sdcard/.android_secure...
I:Formatting unknown device.
rm: can't remove '.' or '..'
rm: can't remove '.' or '..'

-- Formatting cache...
Formatting /cache...

-- Formatting sd-ext...
Formatting /sd-ext...
mke2fs 1.41.12 (17-May-2010)
warning: 256 blocks unused.

Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=64 blocks, Stripe width=64 blocks
65664 inodes, 262144 blocks
0 blocks (0.00%) reserved for the super user
First data block=0
8 block groups
32768 blocks per group, 32768 fragments per group
8208 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376

Writing inode tables: 0/81/82/83/84/85/86/87/8done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 21 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
tune2fs 1.41.6 (30-May-2009)
Setting default hash algorithm to tea (2)
All partitions formatted.
mtd: successfully wrote block at 0
I:Set boot command ""
mtd: successfully wrote block at 0
I:Set boot command ""
0+1 records in
0+1 records out
116 bytes (116B) copied, 0.002137 seconds, 53.0KB/s
dd: can't open '/tmp/fstypes': No such file or directory

so i guess that part means there is a bad block in my data partition...of course some other partitioning could make the bad block land in some other partition.

but what i remember reading here on xda is that the phone's internal NAND management avoids bad blocks until all "spare" blocks are used up. after that, software (i.e. ClockworkModRecovery) can mark blocks as bad at the filesystem level...so really nothing to worry about (i think!) unless there are so many bad blocks that you have to "expand" one or more partitions' sizes to compensate for the bad blocks.

i hope the above helps...!