[prev in list] [next in list] [prev in thread] [next in thread] 

List:       uclinux-dev
Subject:    Re: [uClinux-dev] how to mount flash via jffs2 as dir /mnt ?
From:       "Suresh Steven Veigas" <suresh.veigas () amdlbct ! com>
Date:       2006-03-18 3:46:03
Message-ID: 003001c64a3c$ce561900$0500a8c0 () bctserver ! com
[Download RAW message or body]

hi,

mtdblock0 is entire flash,
mtdblock1 is first partition, as only one partition is there, its showing
same info to both

can mount jffs2 as follows
mount -t jffs2 /dev/mtdblock1 /mnt

and if you want to change the partition, you can edit structure in
linux-2.x.x/drivers/mtd/maps/physmap.c

it may solve your problem or may not, but still i hope this is the useful
info to you,

Regards
Steven


Hi,

> --- Ursprüngliche Nachricht ---
> Von: Erwin Authried <eauth@softsys.co.at>
> An: uClinux development list <uclinux-dev@uclinux.org>
> Betreff: Re: [uClinux-dev] how to mount flash via jffs2 as dir /mnt ?
> Datum: Fri, 17 Mar 2006 13:13:13 +0100
> 
> the entries in /dev are just special files for device nodes, that
> doesn't say anything about the existence of a device, you will even see
> them if you do not use MTD at all. The output of /proc/mtd shows the
> devices that the kernel has probed during bootup.
> There's no mtd3. You can't use fdisk at all because your flash will most
> probably not be formatted like a hard disk.
Aha. Now it's clear why fdisk displays such strange entries.

> If you want to partition
> your flash, you can either hardcode the partition tables in a mapping
> driver, or use cmdline partition table parsing on the kernel cmdline.
I just want 1 partition but only the last 4MB of the 16MB flash should be
used by jffs2. That means my mounted flash directory should offer 4MB of
free space. Therefore I configured the kernel this way (the entire flash
actually starts at fe000000):
  CONFIG_MTD_PHYSMAP=y
  CONFIG_MTD_PHYSMAP_START=fec00000
  CONFIG_MTD_PHYSMAP_LEN=400000
  CONFIG_MTD_PHYSMAP_BUSWIDTH=2
In this case, do I need to setup something via cmdline partitioning?


John Williams wrote to microblaze-uclinux@itee.uq.edu.au:
> MTD provides block and character device interfaces to the partitions -
> mtdblockN is the block interface, mtdN is the char interface
> You can only mount on block devices, not char.  You probably want
> mount -t jffs2 /dev/mtdblock0 /mnt
> Again, fdisk works on block devices, not char.
> fdisk doesn't really make sense if you are using MTD partitions - just
> put the jffs2 filesystem on an MTD partition directly, don't
> bother with
> fdisk.
This explains a lot to me, this is an important puzzle piece.
Now I'm a big step further and have done this:

----------------
The boot logging is:
  ...
  JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications
AB.
  ...
  physmap flash device: 400000 at fec00000
   Amd/Fujitsu Extended Query Table v1.3 at 0x0040
  number of CFI chips: 1
  cfi_cmdset_0002: Disabling fast programming due to code brokenness.
  physmap: no partition info available, registering whole flash (Physically
mapped flash) at once
  uclinux[mtd]: RAM probe address=0x800c5e2c size=0x58000
  uclinux[mtd]: root filesystem index=2
  VFS: Mounted root (romfs filesystem) readonly.
  Freeing init memory: 36K
  Shell invoked to run file: /etc/rc
  Command: mount -t proc proc /proc
  Command: mount -t ramfs none /var
  init: Failed to open /etc/inittab.
  Sash command shell (version 1.1.1)
  />

-----------------
mtd0 is the flash, mtd2 is the root filesystem (romfs). mtd0 is the same as
mtd1 due doubled registration (likely a bug?) in mtd/maps/physmap.c line 145
and 181, but it actually doesn't matter to the system and can be ignored:
  /> cat /proc/mtd
  dev:    size   erasesize  name
  mtd0: 01000000 00010000 "Physically mapped flash"
  mtd1: 01000000 00010000 "Physically mapped flash"
  mtd2: 00058000 00001000 "RAM"

BTW: Why is its shown size 0x1000000 (=16MB)? My .config defines:
  #
  # Mapping drivers for chip access
  #
  CONFIG_MTD_PHYSMAP=y
  CONFIG_MTD_PHYSMAP_START=fec00000
  CONFIG_MTD_PHYSMAP_LEN=400000
  CONFIG_MTD_PHYSMAP_BUSWIDTH=2
  ...
  # CONFIG_MTD_MBVANILLA is not set
  # CONFIG_MTD_MB_AUTO is not set
  ...
  # CONFIG_MTD_SUZAKU is not set
  ...
  CONFIG_MTD_UCLINUX=y
  ...

-----------------
Now I've tried to format the flash (using /var since it's writeable here):
  /> cd var
  /var> mkdir j
  /var> mkfs.jffs2 -d j -o j.img
  /var> erase /dev/mtd0
  Erase Total 1 Units
  Performing Flash Erase of length 65536 at offset 0x0 done
  /var> cp j.img /dev/mtd0
  /var> mount -t jffs2 /dev/mtdblock0 /var/j

but it seems it doesn't work and the output is just:

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000:
0xe001 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004:
0x002d instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000008:
0x8112 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000000c:
0x0001 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000014:
0x0002 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000018:
0x0048 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000020:
0xe687 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000024:
0x7a45 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000028:
0x7374 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000002c:
0xffff instead
Further such events for this erase block will not be printed
JFFS2: Erase block at 0x00000000 is not formatted. It will be erased
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400000:
0xff01 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400008:
0xfc04 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0040000c:
0x110d instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400010:
0x9420 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400014:
0xa421 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400018:
0x9401 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0040001c:
0xb000 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400020:
0x31a0 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400024:
0xb000 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400028:
0x3040 instead
Further such events for this erase block will not be printed
JFFS2: Erase block at 0x00400000 is not formatted. It will be erased
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00410000:
0xf816 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00410004:
0xf896 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00410008:
0xf876 instead
...
8<
...
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00630020:
0x1a3e instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00630024:
0xd1f8 instead
Further such events for this erase block will not be printed
JFFS2: Erase block at 0x00630000 is not formatted. It will be erased
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00640000:
0xef47 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00640004:
0xbc31 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00640008:
0xf27e instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0064000c:
0xda7f instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00640010:
0xd454 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00640014:
0xa6a8 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00640018:
0x257e instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0064001c:
0xc14b instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00640020:
0xf998 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00640024:
0x37c2 instead
Further such events for this erase block will not be printed
JFFS2: Erase block at 0x00640000 is not formatted. It will be erased
JFFS2: Erase block at 0x00800000 is not formatted. It will be erased
JFFS2: Erase block at 0x00810000 is not formatted. It will be erased
...
8<
...
JFFS2: Erase block at 0x00fc0000 is not formatted. It will be erased
JFFS2: Erase block at 0x00fd0000 is not formatted. It will be erased
JFFS2: Erase block at 0x00fe0000 is not formatted. It will be erased
JFFS2: Erase block at 0x00ff0000 is not formatted. It will be erased
Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
mount: Mounting /dev/mtdblock0 on /var/j failed: Invalid argument
pid 24: failed 256
/var>



What could be wrong here?

TIA + Cheers,
F@lk

--
Echte DSL-Flatrate dauerhaft für 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org



Confidentiality Notice:

The information contained in this electronic message and any attachments to this \
message are intended for the exclusive use of the addressee(s) and may contain \
confidential or privileged information. If you are not the intended recipient, please \
notify the sender at AMDLBCT or sysadmin@amdlbct.com immediately and destroy all \
copies of this message and any attachments.

_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic