[U-Boot-Users] Reading or writing jffs2 - how?

Martin Egholm Nielsen martin at egholm-nielsen.dk
Wed Dec 15 13:56:29 CET 2004


Hi there,

I have tried to create a jffs2-image of the linux-filesystem I wish to 
use, and then write it to my flash using "nand write.jffs2 100000 0 
$(filesize)". But with no luck...
Then I began to investigate the fundamental "ls" and "nand erase" 
commands, but neither there did I have any success. Below is a trace of 
what I've tried in order to get something working.

In section 2, I'd expect the nand to be mountable from Linux - but's 
it's not.
In section 3, I'd expect the filesystem to be ls'ed correct from u-boot 
- but it's not...

Can someone tell me if there is something I've misunderstood?

********************************
********** 1 U-Boot ************
********************************
U-Boot 1.1.2 (Nov 27 2004 - 11:50:10)
CPU:   IBM PowerPC 405EP Rev. B at 333.333 MHz (PLB=111, OPB=55, EBC=37 MHz)

==== 8< 8< 8< ====

NAND:Probing at 0xff400000
   64 MB

==== 8< 8< 8< ====

=> nand erase clean

NAND erase: device 0 offset 0, size 67108864 ... OK

=> ls
Scanning JFFS2 FS:  done.
=>

*******************************
********** 2 Linux ************
*******************************
# cat /proc/mtd

dev:    size   erasesize  name
mtd0: 04000000 00004000 "Trampoline Nand Flash (128 MB)"

# mount -t jffs2 /dev/mtdblock0 mnt/nand0

jffs2: Erase block size too small (16KiB). Using virtual blocks size 
(32KiB) instead
Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
empty_blocks 1325, bad_blocks 4, c->nr_blocks 2048
mount: Mounting /dev/mtdblock0 on /mnt/nand0 failed: Invalid argument

# eraseall /dev/mtd0

Erasingnand_erase: attempt to erase a bad block at p 16 Kibyte @ 400age 
0x00000020
0 --  0 % complenand_erase: attempt to erase te.
eraseall: /a bad block at page 0x00000040
dev/mtd0: MTD Ernand_erase: attempt to erasase failure: Inpe a bad block 
at page 0x00000060
nand_erase: attempt to erase a bad blo
Erasing 16 Kibck at page 0x00000080
yte @ 8000 --  0nand_erase: attempt to er % complete.
erase a bad block at page 0x000000a0
aseall: /dev/mtd0: MTD Erase fainalure: Input/outpnd_erase: attempt to 
erase a b
ad block at page 0x000000c0
ut error
Erasinand_erng 16 Kibyte @ case: attempt to erase a bad block at page 
0x000000e0
000 --  0 % complete.
eraseall: /dev/mtd0: MTD Erase failure: Input/output error
Erasing 16 Kibyte @ 10000 --  0 % complete.
eraseall: /dev/mtd0: MTD Erase failure: Input/output error
Erasing 16 Kibyte @ 14000 --  0 % complete.
eraseall: /dev/mtd0: MTD Erase failure: Input/output error
Erasing 16 Kibyte @ 18000 --  0 % complete.
eraseall: /dev/mtd0: MTD Erase failure: Input/output error
Erasing 16 Kibyte @ 1c000 --  0 % complete.
eraseall: /dev/mtd0: MTD Erase failure: Input/output error
Erased 65536 Kibyte @ 0 -- 100% complete.

# mount -t jffs2 /dev/mtdblock0 /mnt/nand0/

jffs2: Erase block size too small (16KiB). Using virtual blocks size 
(32KiB) instead

# touch /mnt/nand0/testfile
# mkdir /mnt/nand0/testdir
# umount /mnt/nand0

jffs2: No clean, dirty _or_ erasable blocks to GC from! Where are they all?
jffs2: Couldn't find erase block to garbage collect!

# mount -t jffs2 /dev/mtdblock0 /mnt/nand0/

jffs2: Erase block size too small (16KiB). Using virtual blocks size 
(32KiB) instead

# ls -l /mnt/nand0/
drwxr-xr-x    2 0        0               0 Feb  8 05:59 testdir
-rw-r--r--    1 0        0               0 Feb  8 05:59 testfile

********************************
********** 3 U-Boot ************
********************************

=> ls
Scanning JFFS2 FS:  done.
=>


Best regards,
  Martin Egholm





More information about the U-Boot mailing list