[Droid Eris Q&A, Help & Troubleshooting] bftb0:
If it provides you any comfort, I just tried both the -N and -u options on my boot (mtd2) partition.

/ # mount /sdcard
/ # mkdir /dev/foo
/ # cd /dev/foo
/dev/foo # cp /sdcard/mtdflash/flash_erase /sdcard/mtdflash/flash_info /dev/foo/
/dev/foo # chmod 755 *

/dev/foo # ./flash_erase -N /dev/mtd/mtd2 0 0
Erasing 128 Kibyte @ 260000 -- 100 % complete

/dev/foo # ./flash_erase -N -u /dev/mtd/mtd2 0 0
Erasing 128 Kibyte @ 0 -- 0 % complete libmtd: error!: MEMUNLOCK ioctl failed f
or eraseblock 0 (mtd2)
error 95 (Operation not supported)
flash_erase: error!: /dev/mtd/mtd2: MTD unlock failure
error 95 (Operation not supported)

/dev/foo # ./flash_erase -N /dev/mtd/mtd2 0 0
Erasing 128 Kibyte @ 260000 -- 100 % complete
/dev/foo # mount -o rw -t yaffs2 /dev/block/mtdblock2 /dev/mymount
mount -o rw -t yaffs2 /dev/block/mtdblock2 /dev/mymount

/dev/foo # df /dev/mymount
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/block/mtdblock2 2560 1152 1408 45% /dev/mymount

/dev/foo # umount /dev/mymount

/dev/foo # ./flash_erase -N /dev/mtd/mtd2 0 0
Erasing 128 Kibyte @ 260000 -- 100 % complete
/dev/foo # flash_image boot /sdcard/nandroid/HT9*/BDS-20101103-0311/boot.img

Couple of things - note that "df" is not a very good indicator of used space in a small partition like "boot" - it takes up nearly 1.1 MB in overhead - just from mounting it, and the partition is only 2.5 MB. So, this test isn't going to tell you much about bad blocks in that partition. But, I am rebooting my phone right now into CELBFroyo - I didn't destroy it ;)

Second, note that the "MEMUNLOCK" ioctl does not seem to be present.

Next, I gained a little courage and did the "flash_erase -N /dev/mtd/mtd3 0 0" ... my system partition!

/dev/foo # ./flash_erase -N /dev/mtd/mtd3 0 0
Erasing 128 Kibyte @ 7b40000 -- 72 % complete libmtd: error!: MEMERASE ioctl fai
led for eraseblock 986 (mtd3)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd/mtd3: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ a9e0000 -- 100 % complete

/dev/foo # ./flash_erase /dev/mtd/mtd3 0 0
Erasing 128 Kibyte @ 7b20000 -- 72 % complete flash_erase: Skipping bad block at
07b40000
Erasing 128 Kibyte @ a9e0000 -- 100 % complete

/dev/foo # mount /system

/dev/foo # df /system
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/block/mtdblock3 174080 1280 172800 1% /system

/dev/foo # cd /system
/system # unyaffs /sdcard/nandroid/HT9*/BDS-20101103-0311/system.img
end of image

/system # cd / ; sync ; umount /system

Note my system partition had one (or several contiguous) pages that were bad; running "flash_erase -N" in this case did not succeed on that location - probably because the erase attempt failed at the page level, because it was a honest-to-goodness bad page(s) - but then it continued running to completion.

I have booted back to CELB after having run the above trial.

BTW, note the difference in restoring /system and /data versus the boot partition from a Nandroid backup - the first two you mount the partition as a yaffs2 mount point, and then run "unyaffs" from Amon_RA using the (respective) Nandroid image (.img) file, whereas with the boot partition, the image file is a "raw" or binary image, so in that case it is just blasted into the partition using "flash_image" in Amon_RA. (This is exactly the same procedure that the "nandroid-mobile.sh" script goes through).

Hopefully that will give you some confidence to try it on your phone.

At this point - since this whole exercise has been based upon a conjecture that there are "fixable" bad pages on your phone, it seems less likely that running this will make your phone any worse than it already is.

It might turn out that this fixes the fixable blocks - or does nothing at all. I'm hoping for the former; what a waste of time if not.

bftb0