MTD Partition problems

Vipin Malik vipin at embeddedlinuxworks.com
Tue Aug 6 15:08:54 EDT 2002


>
> > However, if one ignores the duplicated devices, one can still use
> > partitioning and mount a JFFS2 fs on one of the partitions while having
> > something completely different on another and device access locking 
> will be
> > taken care of by the mtd driver (which is essentially what partitioning
> > provides vs. just calling add_mtd() NUM_PARTITION times in your map 
> file on
> > the same flash chip).
>
>Yes. The partitioning code basically checks the limits and hands the
>work to the base device with adjusted offset.
>
> > Additionally, (say) /dev/mtdblock2 will really provide a handle to
> > /dev/mtd4 the writable third partition on the partitioned flash chip, thus
> > mounting the JFFS2 fs on the partition originally intended (the third
> > partition).
>
>Almost. /dev/mtd4 should be minor number 8. If you check
>/usr/src/linux/Documentation/devices.txt, you will read the following:
>                   0 = /dev/mtd0         First MTD (rw)
>                   1 = /dev/mtdr0        First MTD (ro)
>Thus mtd0 has minor 0, mtd1 has minor 2, ...
>
>Also, the third partition is /dev/mtd3, as /dev/mtd0 is the real
>device. Look at the minor numbers for /dev/hda*, just the same.


I got the JFFS2 to mount on /dev/mtdblock2 (most of the partition was 
erased. I must have passed the wrong size to the mtd_debug erase. There was 
some garbage at the end).

Anyway, thanks for the explanations.

Vipin


>But what you *meant* is correct.
>
> > Unfortunately, my tests indicate that this is not happening. I know that
> > /dev/mtdblock2 (the intended third partition) is formatted. However JFFS2
> > finds data here and refuses to mount on it. I think it is really being
> > passes a handle to and accesses /dev/mtd2, which is the wrong partition.
>
>See above.
>
> > /dev/mtdblock[4,5] do not exist, even though /dev/mtd[4,5] do and 
> /dev/mtd4
> > is the correct partition that I want!
>
>See above.
>
> > Argh! I'll try your patches if you like.
>
>I would be happy if you did. But you don't need my patches, unless you
>have more than one device that you want to partition. With the two
>thinkos out of the way, you should be doing fine. :)
>
>Jörn
>
>--
>Mundie uses a textbook tactic of manipulation: start with some
>reasonable talk, and lead the audience to an unreasonable conclusion.
>-- Bruce Perens
>
>______________________________________________________
>Linux MTD discussion mailing list
>http://lists.infradead.org/mailman/listinfo/linux-mtd/





More information about the linux-mtd mailing list