Static UBI volumes and ubiupdatevol ?
Ricard Wanderlof
ricard.wanderlof at axis.com
Wed Dec 15 03:06:56 EST 2010
Hi,
I've looked through the documentation on
http://www.linux-mtd.infradead.org but I can't find the answer to the
following question(s):
Using 'static' UBI volumes seems to be the preferred way of creating read
only file systems.
While it seems possible to use ubinize to make a complete ubi image
containing static volumes and then write it to the flash using ubiformat,
is it possible to update just a single volume using ubiupdatevol?
I've tried using ubimkvol to create a static volume, then using
ubiupdatevol to write an ubifs image to it. That works, but when I try to
mount it subsequently I get things like
[ 6656.114000] UBIFS: static UBI volume - read-only mode
[ 6656.129000] UBIFS error (pid 866): mount_ubifs: can't format empty UBI
volume: read-only UBI volume
mount: mounting ubi1_0 on /volume1/ failed: Read-only file system
which in a way makes sense to me; if the volume is static = read only then
it shouldn't be possible to write to it.
The only thing I haven't tried is matching the size of the image I'm
writing to the size of the partition. With dynamic volumes that doesn't
seem to be an issue; as long as there is space for the data in the target
volume. The free space just seems to get truncated to the available free
space in the flash volume. (On the other hand, writing an image that is
smaller than the flash volume doesn't seem to 'grow' to fit the available
space according to df; it remains the same no matter how large the target
volume is). So I've been rather careless with the size of the image vs.
the size of the target volume.
A related question: With static volumes, I assume you still get the
benefit of scrubbing, which in turn means that UBI can move the data
around if it deems necessary?
Which begs a final question: is it possible to verify the integrity of a
static UBI volume? Even with JFFS2, if mounted readonly the flash in that
particular partition is never written to, so it is possible to use a
simple checksum to verify data integrity. With JFFS2 this can be
important, as missing JFFS2 nodes don't necessarily result in mount time
or run time failures, it just results in missing files or parts of files.
/Ricard
--
Ricard Wolf Wanderlöf ricardw(at)axis.com
Axis Communications AB, Lund, Sweden www.axis.com
Phone +46 46 272 2016 Fax +46 46 13 61 30
More information about the linux-mtd
mailing list