* UBI 1MiB size partition
@ 2014-11-24 9:01 Angelo Dureghello
2014-11-24 10:08 ` Richard Weinberger
2014-11-28 9:39 ` Artem Bityutskiy
0 siblings, 2 replies; 7+ messages in thread
From: Angelo Dureghello @ 2014-11-24 9:01 UTC (permalink / raw)
To: linux-mtd@lists.infradead.org
Dear all,
i read UBI faq and surfed the net, but can't find still a clear answer
to this:
I have a 1MiB partition on a nand flash o would like to format as UBI.
I already have the rootfs atrtached as UBI0 / UBI0_0, so i am going
to attach this partition as UBI1.
But with the available ubi commands i am not able. Is this a limitiation
due to the small partition size ?
[root@barix ~]# flash_erase /dev/mtd5 0 8
Erasing 128 Kibyte @ e0000 -- 100 % complete
[root@barix ~]# ubiattach -m 5
UBI: attaching mtd5 to ubi1
UBI: scanning is finished
UBI: empty MTD device detected
UBI warning: print_rsvd_warning: cannot reserve enough PEBs for bad PEB
handling, reserved 4, need 20
UBI: attached mtd5 (name "config", size 1 MiB) to ubi1
UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
UBI: good PEBs: 8, bad PEBs: 0, corrupted PEBs: 0
UBI: user volume: 0, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 0/0, WL threshold: 4096, image sequence
number: 193419012
UBI: available PEBs: 0, total reserved PEBs: 8, PEBs reserved for bad
PEB handling: 4
UBI: background thread "ubi_bgt1d" started, PID 2686
UBI device number 1, total 8 LEBs (1015808 bytes, 992.0 KiB), available
0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
[root@barix ~]#
[root@barix ~]# ubimkvol /dev/ubi1 -N config -m
ubimkvol: error!: UBI device does not have free logical eraseblocks
As you see, i can't create a volume so i cannot mount.
From the tools help, seems i cannot set bad PEB handling count.
Every help is very appreciated.
Thanks
angelo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: UBI 1MiB size partition
2014-11-24 9:01 UBI 1MiB size partition Angelo Dureghello
@ 2014-11-24 10:08 ` Richard Weinberger
2014-11-24 10:18 ` Angelo Dureghello
2014-11-28 9:39 ` Artem Bityutskiy
1 sibling, 1 reply; 7+ messages in thread
From: Richard Weinberger @ 2014-11-24 10:08 UTC (permalink / raw)
To: Angelo Dureghello; +Cc: linux-mtd@lists.infradead.org
On Mon, Nov 24, 2014 at 10:01 AM, Angelo Dureghello <angelo70@gmail.com> wrote:
> Dear all,
>
> i read UBI faq and surfed the net, but can't find still a clear answer
> to this:
>
>
> I have a 1MiB partition on a nand flash o would like to format as UBI.
> I already have the rootfs atrtached as UBI0 / UBI0_0, so i am going
> to attach this partition as UBI1.
>
> But with the available ubi commands i am not able. Is this a limitiation
> due to the small partition size ?
>
> [root@barix ~]# flash_erase /dev/mtd5 0 8
> Erasing 128 Kibyte @ e0000 -- 100 % complete
>
> [root@barix ~]# ubiattach -m 5
> UBI: attaching mtd5 to ubi1
> UBI: scanning is finished
> UBI: empty MTD device detected
> UBI warning: print_rsvd_warning: cannot reserve enough PEBs for bad PEB
> handling, reserved 4, need 20
> UBI: attached mtd5 (name "config", size 1 MiB) to ubi1
> UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
> UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
> UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
> UBI: good PEBs: 8, bad PEBs: 0, corrupted PEBs: 0
> UBI: user volume: 0, internal volumes: 1, max. volumes count: 128
> UBI: max/mean erase counter: 0/0, WL threshold: 4096, image sequence number:
> 193419012
> UBI: available PEBs: 0, total reserved PEBs: 8, PEBs reserved for bad PEB
> handling: 4
> UBI: background thread "ubi_bgt1d" started, PID 2686
> UBI device number 1, total 8 LEBs (1015808 bytes, 992.0 KiB), available 0
> LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
> [root@barix ~]#
>
> [root@barix ~]# ubimkvol /dev/ubi1 -N config -m
> ubimkvol: error!: UBI device does not have free logical eraseblocks
>
> As you see, i can't create a volume so i cannot mount.
> From the tools help, seems i cannot set bad PEB handling count.
The number depends on CONFIG_MTD_UBI_BEB_LIMIT.
What is your use case for UBI on such a small MTD partition?
--
Thanks,
//richard
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: UBI 1MiB size partition
2014-11-24 10:08 ` Richard Weinberger
@ 2014-11-24 10:18 ` Angelo Dureghello
2014-11-24 10:21 ` Richard Weinberger
0 siblings, 1 reply; 7+ messages in thread
From: Angelo Dureghello @ 2014-11-24 10:18 UTC (permalink / raw)
To: linux-mtd@lists.infradead.org; +Cc: Richard Weinberger
Hi Richard,
>
> The number depends on CONFIG_MTD_UBI_BEB_LIMIT.
> What is your use case for UBI on such a small MTD partition?
My company uses UBI as rootfs, and jffs2 for a small partition to keep
some system configurations.I would like to use UBI here as well.
CONFIG_MTD_UBI_BEB_LIMIT is system wide i guess. So changing it, it
impacts also the main rootfs.ubi, right ?
>
Thanks,
angelo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: UBI 1MiB size partition
2014-11-24 10:18 ` Angelo Dureghello
@ 2014-11-24 10:21 ` Richard Weinberger
0 siblings, 0 replies; 7+ messages in thread
From: Richard Weinberger @ 2014-11-24 10:21 UTC (permalink / raw)
To: Angelo Dureghello, linux-mtd@lists.infradead.org
Am 24.11.2014 um 11:18 schrieb Angelo Dureghello:
> Hi Richard,
>>
>> The number depends on CONFIG_MTD_UBI_BEB_LIMIT.
>> What is your use case for UBI on such a small MTD partition?
>
> My company uses UBI as rootfs, and jffs2 for a small partition to keep
> some system configurations.I would like to use UBI here as well.
This does not make sense.
Create one UBI for the whole MTD and then create multiple UBI volumes on it...
> CONFIG_MTD_UBI_BEB_LIMIT is system wide i guess. So changing it, it
> impacts also the main rootfs.ubi, right ?
Yes.
Thanks,
//richard
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: UBI 1MiB size partition
2014-11-24 9:01 UBI 1MiB size partition Angelo Dureghello
2014-11-24 10:08 ` Richard Weinberger
@ 2014-11-28 9:39 ` Artem Bityutskiy
2014-11-28 9:49 ` Angelo Dureghello
1 sibling, 1 reply; 7+ messages in thread
From: Artem Bityutskiy @ 2014-11-28 9:39 UTC (permalink / raw)
To: Angelo Dureghello; +Cc: linux-mtd@lists.infradead.org
On Mon, 2014-11-24 at 10:01 +0100, Angelo Dureghello wrote:
> Dear all,
>
> i read UBI faq and surfed the net, but can't find still a clear answer
> to this:
>
>
> I have a 1MiB partition on a nand flash o would like to format as UBI.
> I already have the rootfs atrtached as UBI0 / UBI0_0, so i am going
> to attach this partition as UBI1.
>
> But with the available ubi commands i am not able. Is this a limitiation
> due to the small partition size ?
>
> [root@barix ~]# flash_erase /dev/mtd5 0 8
> Erasing 128 Kibyte @ e0000 -- 100 % complete
>
> [root@barix ~]# ubiattach -m 5
> UBI: attaching mtd5 to ubi1
> UBI: scanning is finished
> UBI: empty MTD device detected
> UBI warning: print_rsvd_warning: cannot reserve enough PEBs for bad PEB
> handling, reserved 4, need 20
> UBI: attached mtd5 (name "config", size 1 MiB) to ubi1
> UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
> UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
> UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
> UBI: good PEBs: 8, bad PEBs: 0, corrupted PEBs: 0
> UBI: user volume: 0, internal volumes: 1, max. volumes count: 128
> UBI: max/mean erase counter: 0/0, WL threshold: 4096, image sequence
> number: 193419012
> UBI: available PEBs: 0, total reserved PEBs: 8, PEBs reserved for bad
> PEB handling: 4
> UBI: background thread "ubi_bgt1d" started, PID 2686
> UBI device number 1, total 8 LEBs (1015808 bytes, 992.0 KiB), available
> 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
> [root@barix ~]#
>
> [root@barix ~]# ubimkvol /dev/ubi1 -N config -m
> ubimkvol: error!: UBI device does not have free logical eraseblocks
>
> As you see, i can't create a volume so i cannot mount.
> From the tools help, seems i cannot set bad PEB handling count.
UBI is a volume manager which is designed to manage the entire flash
chip. Sometimes system designers have one or two small partitions at the
beginning of the chip, and give the rest to UBI.
You are using NAND flash, and UBI tries to reserve some amount of
eraseblocks for bad block handling. And the count of eraseblocks to
reserve is calculated from the entire chip size. So UBI says it wants
20, but reserved only 4 - all the available blocks you have. So you do
not have any more blocks left, so you have no space.
You really should re-think your design. 1MiB partition is too small,
there are too few eraseblocks. What if one or two of them become bad?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: UBI 1MiB size partition
2014-11-28 9:39 ` Artem Bityutskiy
@ 2014-11-28 9:49 ` Angelo Dureghello
2014-11-28 9:59 ` Artem Bityutskiy
0 siblings, 1 reply; 7+ messages in thread
From: Angelo Dureghello @ 2014-11-28 9:49 UTC (permalink / raw)
To: linux-mtd@lists.infradead.org; +Cc: dedekind1
Dear Artem,
thanks for your reply.
> UBI is a volume manager which is designed to manage the entire flash
> chip. Sometimes system designers have one or two small partitions at the
> beginning of the chip, and give the rest to UBI.
>
> You are using NAND flash, and UBI tries to reserve some amount of
> eraseblocks for bad block handling. And the count of eraseblocks to
> reserve is calculated from the entire chip size. So UBI says it wants
> 20, but reserved only 4 - all the available blocks you have. So you do
> not have any more blocks left, so you have no space.
>
> You really should re-think your design. 1MiB partition is too small,
> there are too few eraseblocks. What if one or two of them become bad?
>
Yes, i realized this. A redesign of the partition scheme is needed at this
stage.
I cannot actually change the partition scheme for some reasons connected
to the production process, but at least things are more clear now.
Regards,
Angelo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: UBI 1MiB size partition
2014-11-28 9:49 ` Angelo Dureghello
@ 2014-11-28 9:59 ` Artem Bityutskiy
0 siblings, 0 replies; 7+ messages in thread
From: Artem Bityutskiy @ 2014-11-28 9:59 UTC (permalink / raw)
To: Angelo Dureghello; +Cc: linux-mtd@lists.infradead.org
On Fri, 2014-11-28 at 10:49 +0100, Angelo Dureghello wrote:
> Dear Artem,
>
> thanks for your reply.
>
> > UBI is a volume manager which is designed to manage the entire flash
> > chip. Sometimes system designers have one or two small partitions at the
> > beginning of the chip, and give the rest to UBI.
> >
> > You are using NAND flash, and UBI tries to reserve some amount of
> > eraseblocks for bad block handling. And the count of eraseblocks to
> > reserve is calculated from the entire chip size. So UBI says it wants
> > 20, but reserved only 4 - all the available blocks you have. So you do
> > not have any more blocks left, so you have no space.
> >
> > You really should re-think your design. 1MiB partition is too small,
> > there are too few eraseblocks. What if one or two of them become bad?
> >
> Yes, i realized this. A redesign of the partition scheme is needed at this
> stage.
> I cannot actually change the partition scheme for some reasons connected
> to the production process, but at least things are more clear now.
Not that I recommend this for your design, but if you want to play with
your 1MiB partition, you may try the max_beb_per1024 UBI parameter, or
the CONFIG_MTD_UBI_BEB_LIMIT option. I did not try, but hopefully it
allows you to specify 0?
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-11-28 9:59 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-24 9:01 UBI 1MiB size partition Angelo Dureghello
2014-11-24 10:08 ` Richard Weinberger
2014-11-24 10:18 ` Angelo Dureghello
2014-11-24 10:21 ` Richard Weinberger
2014-11-28 9:39 ` Artem Bityutskiy
2014-11-28 9:49 ` Angelo Dureghello
2014-11-28 9:59 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).