fix: recover from corrupt littlefs - #3012
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
So this PR will format FS in case of FS corruption? My T1000e corrupted FS a few times in last 3 months. |
|
@IoTThinks that’s correct. As far as I know, there is no way to recover from a corrupted file system, so you might as well just format it and start again. But if I’m wrong about that, and there is someway to run a file system repair, we should consider that first. |
|
It is still better to recover and start over instead of stuck in bootloop. Thanks a lot for the PR. |
|
@IoTThinks does this one seem ready to move out of draft? I think LittleFS v2 is better but upstream seems slow to adopt it. |
|
@benallfree I haven't tested it. I guess slowness to go live as we need to export backup, fresh install and import the backup. |
|
@IoTThinks I'm not actually sure how LittleFS becomes corrupt. Do you know how to repro? Or maybe we could add a |
|
In another PR, Otalco (sorry for spelling) explained the case. Have big contact list like 350 contacts. |
|
Yes I see now, #2964 |
Hey guys, this is a fix for a rare corner case where littlefs becomes corrupted somehow.
Currently, the device will get locked in a loop the first time it attempts to write to a corrupted littlefs.
This PR does an integrity check at boot. I'm not sure if this is the best approach but here to discuss.