* OneNAND - Cannot mount jffs2 partition
@ 2006-08-13 10:24 John
2006-08-13 12:10 ` Artem B. Bityutskiy
0 siblings, 1 reply; 4+ messages in thread
From: John @ 2006-08-13 10:24 UTC (permalink / raw)
To: linux-mtd
I am trying to use a OneNAND device fitted to a MIPS board.
I am the first person to use this device on this board.
And I am fairly new to the MTD world. My problems may be generic to MTD
rather than being OneNAND specific.
My Kernel is based on Linux 2.6.12 patched with the OneNAND code from
Linux 2.6.16.
I am running little endian.
My mtd-utils are from October 2005.
Questions:
Is this a suitable pair of commands?
$ flash_eraseall -j /dev/mtd5
$ mount -t jffs2 /dev/mtdblock5 /mnt/onenand
Would they work on an ordinary NAND device?
Should I be using the NFTL code is some way?
What is the likely underlying cause of the error message
"Cowardly refusing to erase blocks on filesystem with
no valid JFFS2 nodes"
I'd be very grateful for any guidance,
John
(John Smith)
Here is some log stuff from the Kernel showing what happens:
(The board has both a NOR flash device, and a oneNAND flash device)
At boot time the kernel reports:
Flash device: 1000000 at 1f000000
Mapped flash: Found 1 x16 devices at 0x0 in 16-bit bank
Amd/Fujitsu Extended Query Table at 0x0040
Mapped flash: CFI does not contain boot bank location. Assuming top.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
Creating 5 MTD partitions on "NOR flash":
0x00000000-0x00c00000 : "rootfs"
0x00c00000-0x00c80000 : "loader"
0x00c80000-0x00fff800 : "vmlinux"
mtd: partition "vmlinux" doesn't end on an erase block
-- force read-only
0x00fff800-0x00fff890 : "config"
mtd: partition "config" doesn't start on an erase block boundary
-- force read-only
0x00fff890-0x01000000 : "nvram"
mtd: partition "nvram" doesn't start on an erase block boundary
-- force read-only
MTD: pace_onenand_init
OneNAND 16MB 2.65/3.3V 16-bit (0x05)
Lock scheme is Continues Lock
Scanning device for bad blocks
Creating 2 MTD partitions on "Onenand":
0x00000000-0x00800000 : "part_one"
0x00800000-0x01000000 : "part_two"
##
## Looking at /proc/mtd, the partitions seem to exist
##
~ # cat /proc/mtd
dev: size erasesize name
mtd0: 00c00000 00020000 "rootfs"
mtd1: 00080000 00020000 "loader"
mtd2: 0037f800 00020000 "vmlinux"
mtd3: 00000090 00020000 "config"
mtd4: 00000770 00020000 "nvram"
mtd5: 00800000 00010000 "part_one"
mtd6: 00800000 00010000 "part_two"
##
## I can build a jffs2 partition on the NOR device
## (with a worring error message)
~ # flash_eraseall -j /dev/mtd0
Erasing 128 Kibyte @ be0000 -- 98 % complete. Cleanmarker written at
be0000.
~ # mount -t jffs2 /dev/mtdblock0 /mnt/nor
Eep. No valid nodes for ino #1
~ #~ # cp /my-registers.txt /mnt/nor
~ # ls -l /my-registers.txt /mnt/nor/my-registers.txt
-rw-r--r-- 1 0 0 2087754 Jan 1 00:02 /mnt/nor/my-registers.txt
-rw-r--r-- 1 0 0 2087754 Aug 13 2006 /my-registers.txt
~ # md5sum /mnt/nor/my-registers.txt /my-registers.txt
3b8b150e7067d2a7b251cfcd0200e530 /mnt/nor/my-registers.txt
3b8b150e7067d2a7b251cfcd0200e530 /my-registers.txt
(after rebooting and mounting, the file was still there)
##
## Equivalent commands on the OneNAND flash fail
##
~ # flash_eraseall -j /dev/mtd5
Erasing 64 Kibyte @ 7f0000 -- 99 % complete. Cleanmarker written at
7f0000.
~ # mount -t jffs2 /dev/mtdblock5 /mnt/onenand/
Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
empty_blocks 0, bad_blocks 0, c->nr_blocks 128
mount: Mounting /dev/mtdblock5 on /mnt/onenand failed: Input/output error
##
## And afterwards only the NOR device is mounted:
##
~ # df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/root 76255996 64592052 7790272 89% /
tmpfs 256 12 244 5% /var
/dev/mtdblock0 12288 852 11436 7% /mnt/nor
##
## mtd_debug reports the right sizes.
## (oneNAND has internal ECC logic. It has 16 bytes of OOB space
## for every 512 byte sector, several of which are reserved for use by
the
## ECC logic)
~ # mtd_debug info /dev/mtd5
mtd.type = MTD_NANDFLASH
mtd.flags = MTD_CLEAR_BITS | MTD_ERASEABLE | MTD_OOB | MTD_ECC
mtd.size = 8388608 (8M)
mtd.erasesize = 65536 (64K)
mtd.oobblock = 1024 (1K)
mtd.oobsize = 32
mtd.ecctype = MTD_ECC_NONE
regions = 0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: OneNAND - Cannot mount jffs2 partition
2006-08-13 10:24 OneNAND - Cannot mount jffs2 partition John
@ 2006-08-13 12:10 ` Artem B. Bityutskiy
2006-08-13 17:45 ` Catherine Smith
0 siblings, 1 reply; 4+ messages in thread
From: Artem B. Bityutskiy @ 2006-08-13 12:10 UTC (permalink / raw)
To: John; +Cc: linux-mtd
Hello John,
John wrote:
> Questions:
> Is this a suitable pair of commands?
> $ flash_eraseall -j /dev/mtd5
> $ mount -t jffs2 /dev/mtdblock5 /mnt/onenand
Yeah, I believe this is the right commands and should work.
> Would they work on an ordinary NAND device?
Yeah, and even on NOR.
> Should I be using the NFTL code is some way?
Nope.
> What is the likely underlying cause of the error message
> "Cowardly refusing to erase blocks on filesystem with
> no valid JFFS2 nodes"
Hmm, JFFS2 is complaining that you feed it with a flash which is neither
empty nor contains a valid JFFS2 FS image.
Try to avoid using -j ans see what happens. You also may try to enable
JFFS2's debugging prints.
I personally have never used OneNAND, and AFAIK it is rather new in MTD.
--
Best Regards,
Artem B. Bityutskiy,
St.-Petersburg, Russia.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: OneNAND - Cannot mount jffs2 partition
2006-08-13 12:10 ` Artem B. Bityutskiy
@ 2006-08-13 17:45 ` Catherine Smith
2006-08-14 15:03 ` Artem B. Bityutskiy
0 siblings, 1 reply; 4+ messages in thread
From: Catherine Smith @ 2006-08-13 17:45 UTC (permalink / raw)
To: Artem B. Bityutskiy, John; +Cc: linux-mtd
Thanks Artem.
> John wrote:
>> Questions:
>> Is this a suitable pair of commands?
>> $ flash_eraseall -j /dev/mtd5
>> $ mount -t jffs2 /dev/mtdblock5 /mnt/onenand
> Yeah, I believe this is the right commands and should work.
>
>
>> What is the likely underlying cause of the error message
>> "Cowardly refusing to erase blocks on filesystem with
>> no valid JFFS2 nodes"
> Hmm, JFFS2 is complaining that you feed it with a flash which is neither
> empty nor contains a valid JFFS2 FS image.
>
> Try to avoid using -j and see what happens. You also may try to enable
> JFFS2's debugging prints.
>
If I don't use the -j, it seems to work, though with a few warnings.
For example:
$ flash_eraseall /dev/mtd5
Eraseing 64 Kibyte @ 7f0000 -- 99 % complete
$ mount -t jffs2 /dev/mtdblock5 /mnt/onenand
Eep. no valid nodes for ino #1
Then I can create files in /mnt/onenand, and copy them around or calculate a
few signatures. All is well.
Once, when I tried to mount after a power cycle, it said:
jffs2_get_inode_nodes(): CRC failed on node at 0x002dd7c8: Read
0xffffffff, calculated 0x20f0e445
Are these warnings, the Eep and the CRC failure, typical and harmless,
or should I take a keen interest?
>
> --
> Best Regards,
> Artem B. Bityutskiy,
> St.-Petersburg, Russia.
>
Regards,
John Smith
Lancashire, England
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: OneNAND - Cannot mount jffs2 partition
2006-08-13 17:45 ` Catherine Smith
@ 2006-08-14 15:03 ` Artem B. Bityutskiy
0 siblings, 0 replies; 4+ messages in thread
From: Artem B. Bityutskiy @ 2006-08-14 15:03 UTC (permalink / raw)
To: Catherine Smith; +Cc: John, linux-mtd
Hi Catherine,
Catherine Smith wrote:
> If I don't use the -j, it seems to work, though with a few warnings.
> For example:
> $ flash_eraseall /dev/mtd5
> Eraseing 64 Kibyte @ 7f0000 -- 99 % complete
> $ mount -t jffs2 /dev/mtdblock5 /mnt/onenand
> Eep. no valid nodes for ino #1
That's harmless.
-j option means to put so-called clean marker at each etaseblock. The
cleanmarker just means that the eraseblock is clean ant it is safe to
write data at it. This is needed to guaranty data consistency - it is
not enough to just check that the eraseblock contains only 0xFF bytes.
For example, due to unclean reboots which may interrupt an erase
operation, some bits may become unstable and be read sometimes as 1, and
sometimes as 0.
If you don't use -j option, JFFS2 will re-erase empty eraseblocks
itself, and put the clean marker. It may also complain about absence of
the root inode (which isn't a brilliant idea), but it creates the root
node automatically.
> Then I can create files in /mnt/onenand, and copy them around or calculate a
> few signatures. All is well.
> Once, when I tried to mount after a power cycle, it said:
> jffs2_get_inode_nodes(): CRC failed on node at 0x002dd7c8: Read
> 0xffffffff, calculated 0x20f0e445
Did you unmount it cleanly? Or just pushed reset? If you didn't unmount
- it may be harmless.
> Are these warnings, the Eep and the CRC failure, typical and harmless,
> or should I take a keen interest?
If you didn't cleanly unmount, you could have been interrupted a delayed
wbuf flush and just lost some last-written data. This could cause CRC
failure. And as JFFS2 cannot distinguish between real corruption and
corruptions due to unclean reboots - it issued a warning.
--
Best Regards,
Artem B. Bityutskiy,
St.-Petersburg, Russia.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-08-14 15:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-13 10:24 OneNAND - Cannot mount jffs2 partition John
2006-08-13 12:10 ` Artem B. Bityutskiy
2006-08-13 17:45 ` Catherine Smith
2006-08-14 15:03 ` Artem B. Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox