linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* trouble with mounting ext2/jffs2
@ 2007-05-22 19:08 Jonathan Kotta
  2007-05-23  8:23 ` Semih Hazar
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Kotta @ 2007-05-22 19:08 UTC (permalink / raw)
  To: linux-mtd

Hello,

I am new to MTDs and to embedded Linux in general.  I have a
at91sam9260ek board.  I just got my NAND flash working, in the sense
that the kernel can see it and do things with it (the kernel sees it
as "NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND
256MiB 3,3V 8-bit)"
, which is correct).  However I can't get it to work with either
ext2fs or jffs2 filesystems.  I think my problem with jffs2 might be
because I don't have a config option for CONFIG_JFFS2_FS_NAND in my
kernel.  I am using 2.6.21.1 with Maxim patches at
http://maxim.org.za/at91_26.html.  Is there another patch I need?  The
mount command I'm using is the one from BusyBox, which the docs say
doesn't work with a certain syntax, but don't really go into much more
detail.  Anyway, I tried with the syntax in
http://www.linux-mtd.infradead.org/faq/jffs2.html and the "vanilla"
syntax that appears below, with the same results.

This is what I've tried:
# flash_eraseall -j /dev/mtd0
Erasing 128 Kibyte @ 10c0000 --  6 % complete. Cleanmarker written at 10c0000.
Skipping bad block at 0x010e0000
Erasing 128 Kibyte @ 5aa0000 -- 35 % complete. Cleanmarker written at 5aa0000.
Skipping bad block at 0x05ac0000
Erasing 128 Kibyte @ 6780000 -- 40 % complete. Cleanmarker written at 6780000.
Skipping bad block at 0x067a0000
Erasing 128 Kibyte @ 7540000 -- 45 % complete. Cleanmarker written at 7540000.
Skipping bad block at 0x07560000
Erasing 128 Kibyte @ 7b40000 -- 48 % complete. Cleanmarker written at 7b40000.
Skipping bad block at 0x07b60000
Erasing 128 Kibyte @ 8ca0000 -- 54 % complete. Cleanmarker written at 8ca0000.
Skipping bad block at 0x08cc0000
Erasing 128 Kibyte @ 8fa0000 -- 56 % complete. Cleanmarker written at 8fa0000.
Skipping bad block at 0x08fc0000

Skipping bad block at 0x08fe0000
Erasing 128 Kibyte @ 91a0000 -- 56 % complete. Cleanmarker written at 91a0000.
Skipping bad block at 0x091c0000
Erasing 128 Kibyte @ fda0000 -- 99 % complete. Cleanmarker written at fda0000.
Skipping bad block at 0x0fdc0000
Erasing 128 Kibyte @ ffe0000 -- 99 % complete. Cleanmarker written at ffe0000.
# mount -t jffs2 /dev/mtd0 /mnt
mount: mounting /dev/mtd0 on /mnt failed
# mount -t jffs2 /dev/mtdblock0 /mnt
Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
empty_blocks 0, bad_blocks 10, c->nr_blocks 2048
mount: mounting /dev/mtdblock0 on /mnt failed

ext2fs doesn't work either.  The way I understand it, the MTD block
driver makes MTDs look like block devices, thus I should be able to
format with ext2fs like any other block device.  I don't plan on using
this method, because it's warned against many times over, but I wanted
to just get something working.

# mke2fs /dev/mtdblock0
mke2fs 1.39 (29-May-2006)
ext2fs_check_if_mount: No such file or directory while determining
whether /dev/mtdblock0 is mounted.
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
65536 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
32 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729, 204801, 221185

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
# mount -t ext2fs /dev/mtdblock0 /mnt
mount: mounting /dev/mtdblock0 on /mnt failed
#

It feels like I'm close to getting this to work, and I'm just missing
a couple of little things.  Does anyone have advice for me?

-- 
Thanks,

Jonathan Kotta

Hofstadter's Law:
    It always takes longer than you expect, even
    when you take into account Hofstadter's Law.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: trouble with mounting ext2/jffs2
  2007-05-22 19:08 trouble with mounting ext2/jffs2 Jonathan Kotta
@ 2007-05-23  8:23 ` Semih Hazar
  2007-05-23 21:23   ` Jonathan Kotta
  0 siblings, 1 reply; 3+ messages in thread
From: Semih Hazar @ 2007-05-23  8:23 UTC (permalink / raw)
  To: Jonathan Kotta; +Cc: linux-mtd

Jonathan Kotta wrote:
> # mount -t jffs2 /dev/mtdblock0 /mnt
> Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
> empty_blocks 0, bad_blocks 10, c->nr_blocks 2048
> mount: mounting /dev/mtdblock0 on /mnt failed
>   
Can you try to mount /dev/mtdblock0 after doing flash_eraseall /dev/mtd0 
(without -j)
As far as I see jffs2 doesn't like an empty flash with cleanmarkers. But 
it works fine with an all-empty flash. I think cleanmarkers are written 
as data is written.

Another (and maybe better ?) way to go is
* create a jffs2 image with mkfs.jffs2
* erase the flash with -j so that cleanmarkers are written
* and then use nandwrite to write your image to mtd.

Regards,
-- 
Semih Hazar

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: trouble with mounting ext2/jffs2
  2007-05-23  8:23 ` Semih Hazar
@ 2007-05-23 21:23   ` Jonathan Kotta
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Kotta @ 2007-05-23 21:23 UTC (permalink / raw)
  To: Semih Hazar; +Cc: linux-mtd

On 5/23/07, Semih Hazar <semih.hazar@indefia.com> wrote:
> Can you try to mount /dev/mtdblock0 after doing flash_eraseall /dev/mtd0
> (without -j)
> As far as I see jffs2 doesn't like an empty flash with cleanmarkers. But
> it works fine with an all-empty flash. I think cleanmarkers are written
> as data is written.

Omitting the -j works.

> Another (and maybe better ?) way to go is
> * create a jffs2 image with mkfs.jffs2
> * erase the flash with -j so that cleanmarkers are written
> * and then use nandwrite to write your image to mtd.
>

Again, omitting -j works.

Thanks for the nudge.  Now I need to get DataFlash working...

-- 
Thanks,

Jonathan Kotta

Hofstadter's Law:
    It always takes longer than you expect, even
    when you take into account Hofstadter's Law.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-05-23 21:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-22 19:08 trouble with mounting ext2/jffs2 Jonathan Kotta
2007-05-23  8:23 ` Semih Hazar
2007-05-23 21:23   ` Jonathan Kotta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).