public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* UBI: Single versus Multiple Images
@ 2012-06-05 13:21 Doug Kehn
  2012-06-06  9:14 ` Artem Bityutskiy
  0 siblings, 1 reply; 3+ messages in thread
From: Doug Kehn @ 2012-06-05 13:21 UTC (permalink / raw)
  To: linux-mtd@lists.infradead.org

Hi Everyone,

I have the following NAND flash MTD layout (presently JFFS2):

* Boot-loader
* Kernel
* Root file-system (rootfs)

* Data

I'm going to switch from JFFS2 to UBI/UBIFS.  I'm wondering if it is better to create a single UBI image containing both rootfs and data volumes or to create separate UBI images (each with a single volume) or is the answer it depends?

The data volume will be used for logging data.  The volume won't completely fill as old data will be purged to make room for new data.  For the single image multiple volume case, if I understand the 
documentation correctly, UBI will use all PEB from both volumes for mapping per-volume LEB, 
correct?  If my understanding is correct, then it's possible, after enough time, maximum PEB erase count will be reached and both rootfs and data volumes will be read-only?  If the goal is to keep the rootfs volume writable, even if the data volume become read-only, then would it be better to create multiple UBI images?  Or is my understanding all wrong?

Thanks,
...doug

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: UBI: Single versus Multiple Images
  2012-06-05 13:21 UBI: Single versus Multiple Images Doug Kehn
@ 2012-06-06  9:14 ` Artem Bityutskiy
  2012-06-06 11:53   ` Doug Kehn
  0 siblings, 1 reply; 3+ messages in thread
From: Artem Bityutskiy @ 2012-06-06  9:14 UTC (permalink / raw)
  To: Doug Kehn; +Cc: linux-mtd@lists.infradead.org

[-- Attachment #1: Type: text/plain, Size: 1999 bytes --]

On Tue, 2012-06-05 at 06:21 -0700, Doug Kehn wrote:
> Hi Everyone,
> 
> I have the following NAND flash MTD layout (presently JFFS2):
> 
> * Boot-loader
> * Kernel
> * Root file-system (rootfs)
> 
> * Data
> 
> I'm going to switch from JFFS2 to UBI/UBIFS.  I'm wondering if it is
> better to create a single UBI image containing both rootfs and data
> volumes or to create separate UBI images (each with a single volume)
> or is the answer it depends?

Are you actually talking about how to partition your flash - whether to
have one partition or several?

> The data volume will be used for logging data.  The volume won't
> completely fill as old data will be purged to make room for new data.
> For the single image multiple volume case, if I understand the 
> documentation correctly, UBI will use all PEB from both volumes for
> mapping per-volume LEB, 
> correct?  If my understanding is correct, then it's possible, after
> enough time, maximum PEB erase count will be reached and both rootfs
> and data volumes will be read-only?  If the goal is to keep the rootfs
> volume writable, even if the data volume become read-only, then would
> it be better to create multiple UBI images?  Or is my understanding
> all wrong?

I do not really understand the questions. UBI will do wear-leveling
across the mtd device it is attached to. If you have one MTD partition
which spans entire flash, you'll have wear-leveling across entire flash.
You will ave /dev/ubi0 represinting the UBI device,
and /dev/ubi0_0, /dev/ubi0_1, etc for each volume for this UBI device
number 0.

If you partition your flash, then each partition will be managed
independently, and you'll have wear-leveling per-partition. So one
partition may wear out faster than another. You'll
have /dev/ubi0, /dev/ubi1, etc for each partition. Then if you create a
volume in each UBI device, you'll have /dev/ubi0_0, /dev/ubi1_0, etc for
each volume.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: UBI: Single versus Multiple Images
  2012-06-06  9:14 ` Artem Bityutskiy
@ 2012-06-06 11:53   ` Doug Kehn
  0 siblings, 0 replies; 3+ messages in thread
From: Doug Kehn @ 2012-06-06 11:53 UTC (permalink / raw)
  To: dedekind1@gmail.com; +Cc: linux-mtd@lists.infradead.org

Hi Artem,



> From: Artem Bityutskiy <dedekind1@gmail.com>
> Sent: Wednesday, June 6, 2012 4:14 AM
> 
> On Tue, 2012-06-05 at 06:21 -0700, Doug Kehn wrote:
>>  Hi Everyone,
>> 
>>  I have the following NAND flash MTD layout (presently JFFS2):
>> 
>>  * Boot-loader
>>  * Kernel
>>  * Root file-system (rootfs)
>> 
>>  * Data
>> 
>>  I'm going to switch from JFFS2 to UBI/UBIFS.  I'm wondering if it 
> is
>>  better to create a single UBI image containing both rootfs and data
>>  volumes or to create separate UBI images (each with a single volume)
>>  or is the answer it depends?
> 
> Are you actually talking about how to partition your flash - whether to
> have one partition or several?
>

I'm asking about whether to create one UBI image that contains multiple volumes or create UBI multiple images that contain a single volume.  The layout is:

mtd0  boot-loader
mtd1  kernel
mtd2  rootfs
mtd3  data

Thus, is it better or does it matter if a single ubi.conf is used to configure rootfs and data or if multiple ubi.conf are used (1 for rootfs and 1 for data).

>>  The data volume will be used for logging data.  The volume won't
>>  completely fill as old data will be purged to make room for new data.
>>  For the single image multiple volume case, if I understand the 
>>  documentation correctly, UBI will use all PEB from both volumes for
>>  mapping per-volume LEB, 
>>  correct?  If my understanding is correct, then it's possible, after
>>  enough time, maximum PEB erase count will be reached and both rootfs
>>  and data volumes will be read-only?  If the goal is to keep the rootfs
>>  volume writable, even if the data volume become read-only, then would
>>  it be better to create multiple UBI images?  Or is my understanding
>>  all wrong?
> 
> I do not really understand the questions. UBI will do wear-leveling
> across the mtd device it is attached to. If you have one MTD partition
> which spans entire flash, you'll have wear-leveling across entire flash.
> You will ave /dev/ubi0 represinting the UBI device,
> and /dev/ubi0_0, /dev/ubi0_1, etc for each volume for this UBI device
> number 0.
> 
> If you partition your flash, then each partition will be managed
> independently, and you'll have wear-leveling per-partition. So one
> partition may wear out faster than another. You'll
> have /dev/ubi0, /dev/ubi1, etc for each partition. Then if you create a
> volume in each UBI device, you'll have /dev/ubi0_0, /dev/ubi1_0, etc for
> each volume.
> 

This clears up my confusion.

Thanks,
...doug

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-06 11:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-05 13:21 UBI: Single versus Multiple Images Doug Kehn
2012-06-06  9:14 ` Artem Bityutskiy
2012-06-06 11:53   ` Doug Kehn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox