Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] rootfs.ubifs not able to mount by kernel
@ 2011-01-30  8:45 nataraj at vaaraahi.com
  2011-01-30 10:30 ` Marcus Osdoba
  0 siblings, 1 reply; 4+ messages in thread
From: nataraj at vaaraahi.com @ 2011-01-30  8:45 UTC (permalink / raw)
  To: buildroot

An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110130/4066633e/attachment-0001.html>

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

* [Buildroot] rootfs.ubifs not able to mount by kernel
  2011-01-30  8:45 [Buildroot] rootfs.ubifs not able to mount by kernel nataraj at vaaraahi.com
@ 2011-01-30 10:30 ` Marcus Osdoba
  2011-01-30 14:20   ` Thomas Petazzoni
  0 siblings, 1 reply; 4+ messages in thread
From: Marcus Osdoba @ 2011-01-30 10:30 UTC (permalink / raw)
  To: buildroot

Am 30.01.2011 09:45, schrieb nataraj at vaaraahi.com:
> Hi Jacmet, Kos_tom & friends
>
> I am trying to boot from a ubifs file system from u-boot. I am able to
> write my "rootfs.ubifs" onto nand flash, and then, mount and list
> using 'ubimount' and 'ubifsls' commands, in u-boot. But getting kernel
> panic when kernel tries to mount the rootfs.I am using arm-linux
> kernel on at91sam9263 Soc gadget having 256M Nand flash.
Hi,

Writing a ubiFS on NAND (with RAW u-boot command) and mounting 
afterwards is not possible. The produced ubiFS must be ubinized to a UBI 
image.
I must admit, that I did not exactly understand the diffrence between 
ubifs and ubi, but as explained on the mtd-utils page, the ubifs is the 
FS layer to the kernel in a traditional sense (like ext2FS) and ubi is a 
technical layer between RAW NAND and FS.
http://www.linux-mtd.infradead.org/doc/ubi.html
http://www.linux-mtd.infradead.org/doc/ubifs.html

I already used ubifs and ubiimages on my target device and can confirm, 
that you have to create the ubifs image AND afterwards you have to 
UBINIZE it BEFORE writing it on NAND.

Excerpt from 
http://gitorious.org/dockstar/emdebian-multistrap/blobs/master/mkubi-img.sh
..
echo "Generating UBIFS out of target dir: $ROOTFS"
mkfs.ubifs -r $ROOTFS $UBIFS_OPTS -o $UBIFS_IMAGEFILE
echo "Generating UBI image out of file $UBIFS_IMAGEFILE"
ubinize $UBINIZE_OPTS ubinize.cfg -o $UBI_IMAGEFILE
..

I wrote the ubinized image on the NAND flash and the linux kernel could 
be read via u-boot ubifsload from that nand partition without problems. 
Furthermore the kernel accepted the ubifs on the ubi parition as rootfs.

>
> Specific errors being:-
> UBIFS error (pid 1): ubifs_get_sb: cannot open "ubi0:rootfs", error -19
> VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)
I guess, the ubifs on the UBI(without fs) parition could not be loaded 
(because you didn't create one ;-) ).

I think it is possible to write a ubifs image onto a formerly created 
ubi parition with mtd-utils (this would preserve the write counters of 
the ubi layer). But I never tried that (because I didn't bookmark the 
site where I found that information...).

May be it is possible to "format" or better prepare the ubi parition 
with some u-boot command and write the ubiFS image on it... But I was 
happy with my ubi image and since it worked, I didn't have a deeper look 
into u-boot commands...

Regards,
Marcus

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

* [Buildroot] rootfs.ubifs not able to mount by kernel
  2011-01-30 10:30 ` Marcus Osdoba
@ 2011-01-30 14:20   ` Thomas Petazzoni
  2011-01-31 21:18     ` Marcus Osdoba
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2011-01-30 14:20 UTC (permalink / raw)
  To: buildroot

Hello Marcus,

On Sun, 30 Jan 2011 11:30:54 +0100
Marcus Osdoba <marcus.osdoba@googlemail.com> wrote:

> Writing a ubiFS on NAND (with RAW u-boot command) and mounting 
> afterwards is not possible. The produced ubiFS must be ubinized to a UBI 
> image.

Correct. But Nataraj did create the UBI volume with U-Boot, and has
written the UBIFS image inside this UBI volume.

> I must admit, that I did not exactly understand the diffrence between 
> ubifs and ubi, but as explained on the mtd-utils page, the ubifs is the 
> FS layer to the kernel in a traditional sense (like ext2FS) and ubi is a 
> technical layer between RAW NAND and FS.
> http://www.linux-mtd.infradead.org/doc/ubi.html
> http://www.linux-mtd.infradead.org/doc/ubifs.html

UBI is a bit like a LVM (Logical Volume Manager) for MTD devices. On
top of physical erase blocks, it creates volumes composed of virtual
erase blocks. This level of indirection allows UBI to handle bad block
replacement, wear leveling and other low-level flash issues.

Note that since recently, Buildroot is capable of generating a
ubinize'd UBI filesystem image, thanks to the work done by Julien
Boibessot from Armadeus. This is available in Buildroot git, and will
be part of the next Buildroot release.

Regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] rootfs.ubifs not able to mount by kernel
  2011-01-30 14:20   ` Thomas Petazzoni
@ 2011-01-31 21:18     ` Marcus Osdoba
  0 siblings, 0 replies; 4+ messages in thread
From: Marcus Osdoba @ 2011-01-31 21:18 UTC (permalink / raw)
  To: buildroot

Am 30.01.2011 15:20, schrieb Thomas Petazzoni:
> Hello Marcus,
>
> On Sun, 30 Jan 2011 11:30:54 +0100
> Marcus Osdoba<marcus.osdoba@googlemail.com>  wrote:
>
>> Writing a ubiFS on NAND (with RAW u-boot command) and mounting
>> afterwards is not possible. The produced ubiFS must be ubinized to a UBI
>> image.
>
> Correct. But Nataraj did create the UBI volume with U-Boot, and has
> written the UBIFS image inside this UBI volume.
True. I should have read the entire output ;-)
But what I miss is the name of the volume inside the ubiparition. 
Nataraj gave root=ubi0:rootfs on the command line. In my example project 
I set this parameter in ubinize.cfg. But the manual way with u-boot like 
Nataraj did, doesn't show a setting like:
"An ubi-volume named rootfs resides on an mtdpart named data."
I ubinized the image outside u-boot and my kernel accepts the 
root=ubi0:rootfs. As noticed, I hardly see a volume_name definition 
"rootfs" in Nataraj's u-boot log....

May be that's the problem? A mixup of the label "data" for mtdpart name 
and ubi volume name?
"U-Boot> ubi create data" should be
"U-Boot> ubi create rootfs" or "root=ubi0:data"
Without warranty ... but @Nataraj, could you try on of the above?

> Note that since recently, Buildroot is capable of generating a
> ubinize'd UBI filesystem image, thanks to the work done by Julien
> Boibessot from Armadeus. This is available in Buildroot git, and will
> be part of the next Buildroot release.
Good news.

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

end of thread, other threads:[~2011-01-31 21:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-30  8:45 [Buildroot] rootfs.ubifs not able to mount by kernel nataraj at vaaraahi.com
2011-01-30 10:30 ` Marcus Osdoba
2011-01-30 14:20   ` Thomas Petazzoni
2011-01-31 21:18     ` Marcus Osdoba

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