MTD and jffs2 mount problem on Linux-2.6.23 rc2
Schlägl Manfred jun.
manfred.schlaegl at gmx.at
Wed Mar 5 04:45:23 EST 2008
Hi!
Am Mittwoch, den 05.03.2008, 09:24 +0100 schrieb Dach Miroslaw:
> Hi Grant,
>
> Thanks for your hints. As regards the endianness. I have tried both little and big endian options.
> In my case only Big endian (native for ppc405) is accepted. There is however the CRC calculation mismatch
> between the calculated one (by the kernel) during mounting the jffs2 and that one which is calculated by mkfs.jffs2.
>
> I am however not sure that the Flash memory access in my case is fine for all modes A8 A16 A32.
> I have got than idea to test jffs2 image stored somehow in RAM instead of Flash to test if jffs2 image generated by mkfs.jffs2 is consistent from kernel 2.6.23 point of view.
>
> this what I have tried was:
>
> losetup /dev/loop0 img2.jffs2
> mount -t jffs2 /dev/loop0 /mnt
>
> unfortunately mount did not work.
This can't work, because jffs2 is using the block-device mtdblock only
to get device-information about the mtd-device. jffs2 itself is using
the mtd-api directly. so jffs2 only on mtd.
>
> Maybe it is possible somehow to use RAMDISK to emulate the Flash to mount jffs2 image?
>
There is a nand-Simulator (nandsim). It simulates a nand in
kernel-virtual-memory. With nandsim you'll get a ram-mtd-device, on
witch jffs2 can be used.
Using nandsim: http://www.linux-mtd.infradead.org/faq/nand.html
Example: simulating 32MB 8bit nand-flash (page:512, eb: 16K):
* nandsim & mtd
# modprobe nandsim first_id_byte=0x20 second_id_byte=0x35
# modprobe mtdblock
# modprobe mtdchar
* erase (not neccessary)
# flash_eraseall /dev/mtd0
Erasing 16 Kibyte @ 1ffc000 -- 99 % complete.
* Create jffs2-Image
# mkfs.jffs2 -p 512 -s 512 -e 16384 -d jffs2 -o jffs2.img
* Write to nandsim
# nandwrite /dev/mtd0 jffs2.img
Writing data to block 0
Writing data to block 4000
* Mount
# mount /dev/mtdblock0 /mnt/ -t jffs2
> Best Regards
>
> M.
>
>
> -----Original Message-----
> From: Grant Erickson [mailto:gerickson at nuovations.com]
> Sent: Tue 3/4/2008 8:40 PM
> To: Dach Miroslaw
> Subject: Re: MTD and jffs2 mount problem on Linux-2.6.23 rc2
>
> On 3/4/08 11:29 AM, Dach Miroslaw wrote:
> > In fact I have NOR flash. The 'dd' command to copy data to flash and backwards
> > to the file works fine so I thing that 'dd' is not the issue.
>
> Seems reasonable.
>
> > I suspect that crc32 works differently when generating the jffs2 image file
> > and the kernel uses different calculation methode? Maybe I am wrong.
>
> Are you specifying an endianness/byte ordering on the command line when
> creating the JFFS2 file system?
>
> > Maybe it is the problem to access the Flash memory? Is there any method to
> > mount jffs2 image in RAM instead of Flash just to test the jffs2 image
> > consistency?
>
> If your kernel is so configured, you should be able to mount it via the
> loopback device:
>
> mount -t loop root.img /mnt
>
> Regards,
>
> Grant
>
>
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
Greetings
Manfred
More information about the linux-mtd
mailing list