From: David Oberhollenzer
Both UBI and UBIFS are designed with tolerance to power-cuts in mind.
+ +UBI has an internal debugging infrastructure that can emulate power +failures for testing. The advantage of the emulation is that it emulates +power failures at the critical points where control data structures are +written to the device whereas the probability of interrupting the system at +those precise moments with physical power cut testing is rather low.
+UBI is in the main-line Linux kernel starting from version diff --git a/faq/ubi.xml b/faq/ubi.xml index f8c40f6..fdd7abb 100644 --- a/faq/ubi.xml +++ b/faq/ubi.xml @@ -898,6 +898,41 @@ similar, just a bit simpler. Here is a similar table for UBI.
+UBI suppors power-cut emulation for testing which emulates power-cuts after +a random number of writes. When a power-cut is emulated, UBI switches to +read-only mode and disallows any further write to the UBI volume, thus +emulating a power cut. The main idea of this mode is to emulate power cuts in +interesting places, e.g. when writing the vid header.
+ +Use the tst_emulate_power_cut
debugfs file to set flags for
+when to enable power-cut emulation. Possible flags for power-cut testing
+can be seen in the table below.
Use the files tst_emulate_power_cut_min
and
+tst_emulate_power_cut_max
to set the minimum and maximum number
+of successful writes, respectively, before a power-cut is emulated.
Note that UBIFS has its own power-cut emulation functions. Please, refere +to the corresponding +Power-cut recovery testing +section.
+ +Emulation type | +Flag value | +
Allow power-cut to be emulated during EC header write | +1 | +
Allow power-cut to be emulated during VID header write | +2 | +
ro_error
file.
repository) is aware of UBIFS power cut recovery testing mode and can be used
for UBIFS power-cut testing.
+Note that UBI also supports power-cut emulation for UBI testing. Please, +refere to the corresponding +Power-cut recovery testing +section.
+