ubifs: handling dirty data (writing back) + power cuts
Richard Weinberger
richard at nod.at
Fri Feb 25 06:46:30 PST 2022
Rafał,
----- Ursprüngliche Mail -----
> Von: "Rafał Miłecki" <zajec5 at gmail.com>
> On 25.02.2022 15:17, Rafał Miłecki wrote:
>> My actual problem is related to ubifs behaviour for power cuts happening
>> between 5 and 35 seconds after saving a file:
>> date > /mount/ubifs/test.txt && sleep 15 && echo CUT POWER *NOW*
>>
>> On the next boot test.txt exists but it's EMPTY (file size 0).
>
> FWIW I get acceptable ubifs behaviour if power cut happens in less than
> 5 seconds after saving a file. For example:
> date > /mount/ubifs/foo.txt && sleep 4 && echo CUT POWER *NOW*
>
> On the next boot foo.txt simply doesn't exist.
>
>
> Everything works fine for power cuts happening after 30 + 5 seconds:
> date > /mount/ubifs/bar.txt && sleep 35 && echo CUT POWER *NOW*
>
> On the next boot bar.txt exists and it contains a date.
See:
http://www.linux-mtd.infradead.org/faq/ubifs.html#L_empty_file
Please let me know whether this helped.
I guess mounting UBIFS in sync mode is what you want.
But please also keep this in mind:
http://www.linux-mtd.infradead.org/doc/ubifs.html#L_sync_semantics
Thanks,
//richard
More information about the openwrt-devel
mailing list