Static UBI volumes and ubiupdatevol ?
Artem Bityutskiy
dedekind1 at gmail.com
Thu Dec 16 11:26:15 EST 2010
On Wed, 2010-12-15 at 11:43 +0100, Ricard Wanderlof wrote:
> I'm also wondering if anyone has any thoughts on upgrading a 'live'
> system, when the flash is managed by UBI.
>
> With a system based on mtd+jffs2 it is actually possible to reflash the
> partition with the [read only] root file system on it without unmounting,
> as long as no accesses are made to the physical flash during the rewrite
> or afterwards. In other words, immediately after reflashing the system
> must be rebooted.
Hmm, I presume you can do this with UBIFS, but you need to make sure all
the backgound stuff like moving and eraseing eraseblocs is done before
doing this by doing fsync() on your /dev/ubiX_Y device (UBI volume
character device), see the 'vol_cdev_fsync()' function. Ah, and of
course you need to sync UBIFS before this.
Then if you can guarantee that no one is reading writing to it, you can
change the flash.
Another option is to remount R/O, if you can make sure there are no
processes keeping files open in R/W mode.
> However, with UBI, given that there are background threads which might be
> doing garbage collection etc I'm suspecting such a solution might not be
> as suitable when the flash is managed by UBI. Or is there a some solution
> that someone has tried with any level of success?
Just call sync(), then fsync on the UBI volume, and you won't have
background processes if there is not I/O.
Be beware, even reading from UBIFS can cause scrubbing in UBI.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
More information about the linux-mtd
mailing list