UBIFS data integrity

Mats Kärrman Mats.Karrman at tritech.se
Tue Jan 14 04:32:15 EST 2014


Hi,

On Tuesday, January 14, 2014 3:51 AM, rcrb rcrb [rcrbsw at gmail.com] wrote:
> I am considering using a database over UBIFS on my embedded device.
> The database file is approximately 1 MiB. I wonder if I can rely on
> the filesystem to be sure than this file will never have a corruption,
> even in case of power cut during update. Will the filesystem guarantee
> that, after reboot, the file will be either in the pre-update state or
> be correctly updated ?

First of all, UBIFS relies on the underlying MTD driver also
doing its job so you should also make sure this works on your
board.
If your MTD driver works, UBIFS is supposed to guarantee
that every write operation is atomic, i.e. it is either fully written or
discarded.
If your database is guaranteed  correct after a power-cut then
depends on if it is consistent after every write or if it requires
several write operations to produce a new consistent state.
In general this requires that your database also is implemented
in a fault tolerant way.

BR // Mats



More information about the linux-mtd mailing list