Grow UBI device?

Wolfgang Denk wd at denx.de
Wed Oct 9 07:33:18 PDT 2013


Dear Ricard Wanderlof,

In message <alpine.DEB.2.00.1310091038110.28562 at lnxricardw.se.axis.com> you wrote:
> 
> > Is there a way to "grow" the existing UBI device so that it now also 
> > covers the rest of the NAND chip?  Or is my only option to create a 
> > second UBI device?
> 
> UBI devices are 'attached' to existing mtd partitions. So to grow a UBI 
> device, you need to detach it from the partition, re-partition the flash 
> (and I'm not sure if this step is even possible as it involves 
> unregistering existing mtd partitions), then attach a UBI device to the a 
> new partition.

In my situation it is OK if the update involves a reboot, so it is
certainly possible to change the MTD partition layout.  So this should
not be a problem.

> Come to think of it, I'm not sure that would work anyway, as the 
> resulting, new, enlarged partition would partly contain UBI data and 
> partly old jffs2 data. I'm not sure what UBI does when it encounters 
> incorrect data, if it just erases the relevant blocks and formats them for 
> its own use, or if it barfs completely and just bails out complaining that 
> the partition does not contain UBI data. If the relevant blocks were 
> erased, then I think UBI would simply concede that the a previous erase 
> attempt had been prematurely aborted, and re-erase the blocks and write 
> its headers, so perhaps that is something to try. At any rate it involves 
> at least some mild trickery (erase the blocks that previously contained 
> jffs2 data).

well, this is the exact part where I wanted to know if (1) this is
guaranteed to work (by design), and/or (2) somebody has successfully
done it before.

> It's probably easier to create a new UBI device by attaching it to the 
> partition previously used by jffs2, after erasing it, but multiple UBI 
> devices across a flash partly defeats the purpose of wear-leveling which 
> UBI provides.

Right, and it fragments the device.  That's why I'd like to avoid
that.


Thanks!!

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Doing the good deeds is like the grass in the garden. You  don't  see
its  growth. But, it does by days. Doing the wicked deeds is like the
hone. You don't see its damage. But, it does by days.        - Buddha



More information about the linux-mtd mailing list