Thomas Luetzel
|
ETFS and static wear-leveling corrupted file
|
Thomas Luetzel
07/08/2013 3:32 AM
post102954
|
ETFS and static wear-leveling corrupted file
Hi,
we did a some mistake in our application. A module was continuously writing log data
onto our NAND flash (128MB) using etfs as filesystem.
After some time the system was forced to do a restart. The application was not starting.
I did some analysis and saw that ldd came up with an error that it can't load libssl.so.1?
What went wrong? Why it is not possible to load this file, no one touch it for any reason. Then I had a read through
again on the wear-leveling ...
======================================================================
Static wear-leveling
Filesystems often consist of a large number of static files that are read but not written. These files will occupy flash
blocks that have no reason to be erased. If the majority of the files in flash are static, this will cause the
remaining blocks containing dynamic data to wear at a dramatically increased rate.
ETFS notices these under-worked static blocks and forces them into service by copying their data to an over-worked block
. This solves two problems: It gives the over-worked block a rest, since it now contains static data, and it forces the
under-worked static block into the dynamic pool of blocks.
======================================================================
And it looks like that exactly this happened. The file was relocated, but during this process something went wrong. I
compared the binary data see the following hex dump.
[ORIGINAL]
=========================================================
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000 7F 45 4C 46 01 02 01 00 00 00 00 00 00 00 00 00 .ELF............
00000010 00 03 00 14 00 00 00 01 00 00 E6 2C 00 00 00 34 ..........æ,...4
00000020 00 04 4A E4 00 00 80 00 00 34 00 20 00 05 00 28 ..Jä..€..4. ...(
00000030 00 1E 00 1B 00 00 00 01 00 00 00 00 00 00 00 00 ................
00000040 00 00 00 00 00 04 0E 68 00 04 0E 68 00 00 00 05 .......h...h....
00000050 00 00 10 00 00 00 00 01 00 04 0E 88 00 04 1E 88 ...........ˆ...ˆ
00000060 00 04 1E 88 00 00 37 24 00 00 50 D0 00 00 00 07 ...ˆ..7$..PÐ....
00000070 00 00 10 00 00 00 00 02 00 04 16 04 00 04 26 04 ..............&.
00000080 00 04 26 04 00 00 00 B8 00 00 00 B8 00 00 00 06 ..&....¸...¸....
00000090 00 00 00 04 00 00 00 04 00 04 45 AC 00 00 00 D4 ..........E¬...Ô
000000A0 00 00 00 D4 00 00 00 20 00 00 00 00 00 00 00 04 ...Ô... ........
000000B0 00 00 00 04 00 00 00 04 00 04 45 D0 00 04 0E 70 ..........EÐ...p
000000C0 00 04 0E 70 00 00 00 18 00 00 00 00 00 00 00 04 ...p............
000000D0 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000F0 00 00 00 00 00 00 02 09 00 00 03 09 00 00 02 C4 ...............Ä
00000100 00 00 01 0F 00 00 02 64 00 00 02 9D 00 00 02 D5 .......d.......Õ
00000110 00 00 01 C3 00 00 02 2F 00 00 00 00 00 00 02 C5 ...Ã.../.......Å
00000120 00 00 02 E4 00 00 02 66 00 00 02 8F 00 00 02 9F ...ä...f.......Ÿ
00000130 00 00 02 25 00 00 02 06 00 00 02 C0 00 00 02 B7 ...%.......À...·
00000140 00 00 01 40 00 00 02 F5 00 00 01 61 00 00 00 00 ...@...õ...a....
=========================================================
[CORRUPTED]
=========================================================
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
View Full Message
|
|
|