mtd and ubifs

Bas Wijnen wijnen at
Sun Mar 14 10:20:05 EDT 2010

On Sun, Mar 14, 2010 at 02:18:26PM +0100, marc zonzon wrote:
> On Sun, Mar 14, 2010 at 12:30 PM, Bas Wijnen <wijnen at> wrote:
> > On Sun, Mar 14, 2010 at 12:19:32PM +0100, marc zonzon wrote:
> >> >> As I don't yet know uboot internals, I don't know where exactly is the
> >> >> kernel, and how uboot find it. I would need it to try a second kernel
> >> >> in micro-sd if possible?
> >> >
> >> > u-boot will read 2M data at 4M offset of nand.
> >> > for now u-boot can load the kernel at VFAT partition of sd card.
> >> >
> >> You mean mtd1 is vfat ?
> >
> > No.  U-boot simply loads the image at offset 4M, which is where the
> > partition starts.  So the partition contains no file system, but a raw
> > kernel image.  (Someone correct me if I'm wrong, I'm not really familiar
> > with this.)
> A raw kernel image must be an image of some filesystem, there is no
> other way to write an image, and I would guess it is also an ubifs but
> I didn't check. It's why I was surprised to read vfat!

The nand is just an array of bytes.  Saying it is partitioned just means
that the first bytes define some regions which should be seen as
separate arrays instead of parts of the bigger array.

In the same way, saying that an array (such as a partition) has a file
system means that some bytes contain information about what the other
bytes are (in particular, again, that they form files, which are again
arrays of bytes).

However, instead of using a filesystem, an array of bytes (in this case
a partition) can also directly contain a file (which, after all, is an
array of bytes as well).  This is the case for the boot loader (mtd0)
and the kernel (mtd1).

> Well I would like to truly understand that.  Xiangfu Liu (sorry I
> don't know what can be used as first name! so I keep both!) summarized
> it today in a very useful post that should be put in a page of the
> wiki:

Please add it!

> When reading this I understood that in state (7) kernel is yet read
> from mtd1 and only rootfs is moved to sd card.

That's what I understand from it as well.[1]

> But you seem to say that both are on sd card.

I didn't think about it, actually.  However, when I contradict others
when it comes to Linux-specific things, I'm usually wrong. :-)

> In the first case the kernel and rootfs detection can be do by block
> device and does not need an extra argument, the second option would
> imply to give  command line arguments to tell the bootloader where are
> the kernel and rootfs. I don't see well how we can do it?

I don't understand what you're asking here.  If I didn't already answer
it, could you please rephrase your question?


[1] I'm writing my own kernel, and don't have experience with this.  So
    I can only tell you what I understand from other posts as well.  I
    do know a lot about the hardware, so I may understand more. ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <>

More information about the discussion mailing list