JFFS2 question : Mounting /dev/mtdblock1 failed , NOR flash

hellohello hellohello008 at 163.com
Mon Aug 16 19:44:16 EST 2010




I have one NOR flash, sector size is 128k. 
I want to make jffs2 filesystem on it to store data.
I have used flash_eraseall -j to format it as jffs2.
But I meet the problem when mount the /dev/mtdblock1.
Thanks for any pointers or ideas.

-sh-2.05b# mount -t jffs2 /dev/mtdblock1 /mnt/jffs 
Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
empty_blocks 0, bad_blocks 0, c->nr_blocks 42
mount: Mounting /dev/mtdblock1 on /mnt/jffs failed: Input/output error



I have used mtd_debug cmd to test, and result is right:

# cat /proc/mtd
dev:    size   erasesize  name
mtd1: 00540000 00020000 "jffs"
mtd2: 00180000 00020000 "others"

# mtd_debug erase /dev/mtd1 0x0 0x20000 
MTD_open
MTD_ioctl
Erased 131072 bytes from address 0x00000000 in flash
MTD_close
# dd if=/dev/zero of=file.img bs=1k count=128
128+0 records in
128+0 records out
# mtd_debug write /dev/mtdblock1 0x0 0x20000 file.img
Copied 131072 bytes from file.img to address 0x00000000 in flash
# mtd_debug read /dev/mtdblock1 0x0 0x20000 file_rd.img
Copied 131072 bytes from address 0x00000000 in flash to file_rd.img
# cmp -l file.img file_rd.img
# 



Here is the detail error info:



-sh-2.05b# flash_eraseall -j /dev/mtd1
MTD_open
MTD_ioctl
MTD_ioctl
Erasing 128 Kibyte @ 0 --  0 % MTD_ioctl
complete.MTD_write
ErasiMTD_ioctlen at 0.
ng 128 Kibyte @ 20000 --  2 % complete.MTD_write
EMTD_ioctlritten at 20000.
rasing 128 Kibyte @ 40000 --  4 % complete.MTD_write
EMTD_ioctlritten at 40000.
... ...
... ...
MTD_ioctlwritten at 500000.
Erasing 128 Kibyte @ 520000 -- 97 % complete.MTD_write
MTD_closewritten at 520000.
Erasing 128 Kibyte @ 540000 -- 100% complete.



-sh-2.05b# mount -t jffs2 /dev/mtdblock1 /mnt/jffs 
Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
empty_blocks 0, bad_blocks 0, c->nr_blocks 42
mount: Mounting /dev/mtdblock1 on /mnt/jffs failed: Input/output error
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20100816/647531a0/attachment.html>


More information about the Linuxppc-dev mailing list