Ubiformat --erase-counter not always used

Darwin Rambo drambo at broadcom.com
Mon Nov 23 13:57:40 EST 2009


Hello Artem, 

This is not a bug report, just an observation on ubiformat. It only seems to take the --erase-counter parameter in certain situations. If you have alien data it seems to take it. If the blocks are FF erased or previously formatted correctly it seems to ignore the --erase-counter argument, even though it says it is using it (see below).

Should we add something in the online help or documentation to explain this better and maybe say in the ubiformat tool itself when the switch is getting used or ignored and why?

# ./ubiformat /dev/mtd4 -n --erase-counter=1234 -v -y
ubiformat: mtd4 (NAND), size 2097152 bytes (2.0 MiB), 524288 eraseblocks of 524288 bytes (512.0 KiB), min. I/O size 4096 bytes
libscan: start scanning eraseblocks 0-4
libscan: scanning eraseblock 0: alien
libscan: scanning eraseblock 1: alien
libscan: scanning eraseblock 2: alien
libscan: scanning eraseblock 3: alien
libscan: finished, mean EC 0, 0 OK, 0 corrupted, 0 empty, 4 alien, bad 0
ubiformat: warning!: 4 of 4 eraseblocks contain non-ubifs data
ubiformat: use erase counter 1234 for all eraseblocks
ubiformat: eraseblock 0: erase, write EC 1234
ubiformat: eraseblock 1: erase, write EC 1234
ubiformat: eraseblock 2: erase, write EC 1234
ubiformat: eraseblock 3: erase, write EC 1234
192.168.1.105 # ./ubiformat /dev/mtd4 -n --erase-counter=5432 -v -y
ubiformat: mtd4 (NAND), size 2097152 bytes (2.0 MiB), 524288 eraseblocks of 524288 bytes (512.0 KiB), min. I/O size 4096 bytes
libscan: start scanning eraseblocks 0-4
libscan: scanning eraseblock 0: OK, erase counter 1234
libscan: scanning eraseblock 1: OK, erase counter 1234
libscan: scanning eraseblock 2: OK, erase counter 1234
libscan: scanning eraseblock 3: OK, erase counter 1234
libscan: finished, mean EC 1234, 4 OK, 0 corrupted, 0 empty, 0 alien, bad 0
ubiformat: 4 eraseblocks have valid erase counter, mean value is 1234
ubiformat: use erase counter 5432 for all eraseblocks    <------------------ Didn't take this value
ubiformat: eraseblock 0: erase, write EC 1235
ubiformat: eraseblock 1: erase, write EC 1235
ubiformat: eraseblock 2: erase, write EC 1235
ubiformat: eraseblock 3: erase, write EC 1235 

Thanks.

Regards,
Darwin





More information about the linux-mtd mailing list