public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Question about ubiformat and how to better use UBIFS
@ 2014-09-04 12:17 t kevin
  2014-09-08 11:43 ` Artem Bityutskiy
  2014-09-09  8:23 ` Konstantin Tokarev
  0 siblings, 2 replies; 3+ messages in thread
From: t kevin @ 2014-09-04 12:17 UTC (permalink / raw)
  To: linux-mtd

Hi ,

Currently I'm trying to create ubifs for rootfs on my device which has
a Nand flash on board.

Right now I know two approaches to do that.
1. On host,mkfs.ubifs+ubinize to generate one ubi.img. On target
board, ubiformat -f ubi.img on the MTD device, ubiattach then mount
and it's done.
or
2. On host, just tar -cz rootfs to generate root.tgz. On target board,
(for the first time)ubiformat the mtd device, ubiattach,ubimkvol, then
mount ubifs. Then untar the root.tgz to the mounted ubi volume.

Eventually the mountpoint should contain same files.

So here are my questions.
1. (Generally speaking) Which one is better? I know ubiformat is going
to erase every PEB  so right now I prefer the second approach since I
don't have to do ubiformat everytime. It sounds like the erase counter
grows slower.

2. I'm working on an embedded device which has limited CPU power so
I'd like to use compressed_method=none. It can be done by passing -x
none to mkfs.ubifs. But I don't see similar option in ubiformat or
ubimkvol. So when I go to the 2nd approach the mounted rootfs is
always compressed.
http://www.linux-mtd.infradead.org/faq/ubifs.html#L_comproff
This method is not helping much. I want to disable compression on the
entire fs, just like mkfs.ubifs -x none did.

Thank you for your time
Kevin

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

* Re: Question about ubiformat and how to better use UBIFS
  2014-09-04 12:17 Question about ubiformat and how to better use UBIFS t kevin
@ 2014-09-08 11:43 ` Artem Bityutskiy
  2014-09-09  8:23 ` Konstantin Tokarev
  1 sibling, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2014-09-08 11:43 UTC (permalink / raw)
  To: t kevin; +Cc: linux-mtd

On Thu, 2014-09-04 at 20:17 +0800, t kevin wrote:
> So here are my questions.
> 1. (Generally speaking) Which one is better? I know ubiformat is going
> to erase every PEB  so right now I prefer the second approach since I
> don't have to do ubiformat everytime. It sounds like the erase counter
> grows slower.

If the second way works for you, you may stick to it.

Back when I was working in Nokia, where we had to flash newly produced
devices in the factory pipeline, we had to have a flash-able image. So
we used the mkfs.ubifs approach.

So generally, the mkfs.ubifs approach was designed for real production,
and the mount approach was originally supported just to make developers'
life easier.

But use whatever is better for your needs.

> 2. I'm working on an embedded device which has limited CPU power so
> I'd like to use compressed_method=none. It can be done by passing -x
> none to mkfs.ubifs. But I don't see similar option in ubiformat or
> ubimkvol.

Well, there is no compression involved in the UBI level, and both of
these tools work on the UBI level, they do not know anything about
UBIFS. That's why you do not see this option.

>  So when I go to the 2nd approach the mounted rootfs is
> always compressed.

Use 'mount -o compr=none', check Documentation/filesystems/ubifs.txt.

> http://www.linux-mtd.infradead.org/faq/ubifs.html#L_comproff
> This method is not helping much. I want to disable compression on the
> entire fs, just like mkfs.ubifs -x none did.

Yeah, that section misses -o compre=none. I've just fixed it up, thanks!

-- 
Best Regards,
Artem Bityutskiy

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

* Re: Question about ubiformat and how to better use UBIFS
  2014-09-04 12:17 Question about ubiformat and how to better use UBIFS t kevin
  2014-09-08 11:43 ` Artem Bityutskiy
@ 2014-09-09  8:23 ` Konstantin Tokarev
  1 sibling, 0 replies; 3+ messages in thread
From: Konstantin Tokarev @ 2014-09-09  8:23 UTC (permalink / raw)
  To: t kevin, linux-mtd@lists.infradead.org



04.09.2014, 16:21, "t kevin" <kevint324@gmail.com>:
> Hi ,
>
> Currently I'm trying to create ubifs for rootfs on my device which has
> a Nand flash on board.
>
> Right now I know two approaches to do that.
> 1. On host,mkfs.ubifs+ubinize to generate one ubi.img. On target
> board, ubiformat -f ubi.img on the MTD device, ubiattach then mount
> and it's done.
> or
> 2. On host, just tar -cz rootfs to generate root.tgz. On target board,
> (for the first time)ubiformat the mtd device, ubiattach,ubimkvol, then
> mount ubifs. Then untar the root.tgz to the mounted ubi volume.
>
> Eventually the mountpoint should contain same files.
>
> So here are my questions.
> 1. (Generally speaking) Which one is better? I know ubiformat is going
> to erase every PEB  so right now I prefer the second approach since I
> don't have to do ubiformat everytime. It sounds like the erase counter
> grows slower.
>
> 2. I'm working on an embedded device which has limited CPU power so
> I'd like to use compressed_method=none. It can be done by passing -x
> none to mkfs.ubifs. But I don't see similar option in ubiformat or
> ubimkvol. So when I go to the 2nd approach the mounted rootfs is
> always compressed.
> http://www.linux-mtd.infradead.org/faq/ubifs.html#L_comproff
> This method is not helping much. I want to disable compression on the
> entire fs, just like mkfs.ubifs -x none did.
>

Why do you want to do ubiformat everytime? You can prepare UBIFS image with
mkfs.ubifs and flash it with ubiupdatevol to existing UBI volume.


-- 
Regards,
Konstantin

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

end of thread, other threads:[~2014-09-09  8:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-04 12:17 Question about ubiformat and how to better use UBIFS t kevin
2014-09-08 11:43 ` Artem Bityutskiy
2014-09-09  8:23 ` Konstantin Tokarev

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