[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] Mount JFFS2 returns "No such device" onexistingdevice.



For all those of you who have reached the end of this thread and still looking for an answer to how to get JFFS2 up and working, here was my solution.

the core of my problem was under the kernel settings i had JFFS2 set as a module, not as built in - once i set this to be built in everything worked.

My solution:

1. from "make menuconfig" > Kernel Settings > File systems > Miscellaneous file systems enable JFFS2 and write buffering support. ensure these have a <*> for  built in.

2. under Vendor settings > Flash tools > MTD utils tick mtd-utils, mkfs.jffs2, eraseall... you may need other apps depending on your configuration.

3. build the file system, erase partition and mount

cat /proc/mtd      -- this will display a list of your partitions, choose one to install a JFFS2 partition on, by default you should install it on "spare"

eraseall /dev/mtd[n]  -- where '[n]' is the mtd number for the spare partition

cd /var    -- change directory to a writeable directory

mkdir image
cd image
echo "if i can read this JFFS2 is mounted and working!!!" > atextfile.txt
cd ..
mkfs.jffs2 -r image -o image.jffs2
cp image.jffs2 /dev/mtd[n]
mount -t jffs2 /dev/mtdblock[n] /mnt
cd /mnt
ls
cat atextfile.txt

some other notes: use the mount command availiable from busybox, the standalone mount is for kernel version 2.0.x and i don't even think it is an option to select this in 0.4-final release of petalinux.

best of luck to everyone else.

Cheers, Michael Allwright.


Brettschneider Falk wrote:
-----Original Message---From: Michael Allwright
  
Thanks for your reply Falk, i'm rebuilding the kernel images now
- out of interest what is the difference between the standalone
mount and the mount from busybox 
    
I can't exactly remember which commands it were as I got my kernel running, but sometimes it seemed like only one of them works, busybox or standalone version.

CU, Falk


P.S.:
For your interest, my console /etc/rc is:
  #!/bin/sh
  PATH=/bin:/sbin:/usr/bin:/usr/sbin
  echo "Mounting proc: "
  mount -t proc proc /proc
  ...
  echo "Mounting flash to /mnt: "
  mount -t jffs2 -o noatime /dev/mtdblock1 /mnt
  ...


and the console boot output is:
  ...
  Linux version 2.6.20-uc0 (devel@linux) (gcc version 3.4.1 ( PetaLinux 0.20 Build -rc1 050607 )) SvnVersion 173, #313 PREEMPT Tue Apr 21 12:13:10 CEST 2009
  ...
  Kernel command line: mtdparts=physmap-flash.0:12M(image),20352K(filesystem),128K(config)
  ...
  JFFS2 version 2.2. (C) 2001-2006 Red Hat, Inc.
  ...
  physmap platform flash device: 02000000 at f0000000
  physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
   Amd/Fujitsu Extended Query Table at 0x0040
  physmap-flash.0: 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.
  3 cmdlinepart partitions found on MTD device physmap-flash.0
  Creating 3 MTD partitions on "physmap-flash.0":
  0x00000000-0x00c00000 : "image"
  0x00c00000-0x01fe0000 : "filesystem"
  0x01fe0000-0x02000000 : "config"
  uclinux[mtd]: RAM probe address=0x821ad75c size=0x13a000
  Creating 1 MTD partitions on "RAM":
  0x00000000-0x0013a000 : "ROMfs"
  uclinux[mtd]: set ROMfs to be root filesystem index=3
  ...
  Mounting proc:
  ...
  Mounting flash to /mnt:
  ...

___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/