JFFS2 trouble
I have been working with nfs root filesystems during last months for my openembeded targeted system. I am going to receive the first prototype of our custom design soon so I have tested the jffs2 images generated by OE for my bootstrap-image.
I can boot on the jffs2 images loading them into flash, which is nice. However I have noticed that these jffs2 images have several problems:
1) Running the nfsroot on the dev board, when I want to mount the jffs2 filesystem from the corresponding mtd device, I have to use the corresponding mtdblock and not directly the mtd device. But I have no error in dmesg.
Quoted 29 lines
root@mx31ads:/$ mount -t jffs2 /dev/mtd2 /media/flash mount: wrong fs type, bad option, bad superblock on /dev/mtd2, missing codepage or other error In some cases useful info is found in syslog - try dmesg | tail or soroot@mx31ads:/$ dmesg | tail <6>eth0: using half-duplex 10Base-T (RJ-45) <4>IP-Config: Complete: <4> device=eth0, addr=128.178.145.106, mask=255.255.255.0, gw=128.178.145.1, <4> host=128.178.145.106, domain=, nis-domain=(none), <4> bootserver=128.178.145.68, rootserver=128.178.145.68, rootpath= <5>Looking up port of RPC 100003/2 on 128.178.145.68 <5>Looking up port of RPC 100005/1 on 128.178.145.68 <4>VFS: Mounted root (nfs filesystem). <6>Freeing init memory: 196K <6>w1_master_driver w1_bus_master1: Family 9 for 09.000003c61301.1d is not registered. root@mx31ads:/$ mount -t jffs2 /dev/mtdblock2 /media/flash root@mx31ads:/$ cd /media/flash/ root@mx31ads:/media/flash$ ls -al drwxr-xr-x 16 root root 0 Jan 1 00:00 . drwxr-xr-x 11 root root 1024 Jun 7 2007 .. drwxr-xr-x 2 root root 0 Jan 1 00:00 bin drwxr-xr-x 2 root root 0 Jan 1 00:00 boot drwxr-xr-x 3 root root 0 Jan 1 1970 dev drwxr-xr-x 26 root root 0 Jan 1 1970 etc drwxr-xr-x 3 root root 0 Jan 1 00:00 home drwxr-xr-x 5 root root 0 Jan 1 00:00 lib drwxr-xr-x 10 root root 0 Jan 1 00:00 media
Quoted 8 lines
drwxr-xr-x 2 root root 0 Jan 1 00:00 mnt drwxr-xr-x 2 root root 0 Jan 1 00:00 proc drwxr-xr-x 2 root root 0 Jan 1 00:00 sbin drwxr-xr-x 2 root root 0 Jan 1 00:00 sys lrwxrwxrwx 1 root root 8 Jan 1 1970 tmp -> /var/tmp drwxr-xr-x 10 root root 0 Jan 1 00:00 usr drwxr-xr-x 7 root root 0 Jan 1 00:00 var root@mx31ads:/media/flash$
However, according to the jffs2 documentation, I should use /dev/mtd2 and not /dev/mtdblock2:
http://www.linux-mtd.infradead.org/faq/jffs2.html#L_mtdblock
2) I have seen many times the problems described on the jffs2 help page:
- http://www.linux-mtd.infradead.org/faq/jffs2.html#L_magicnfound
- http://www.linux-mtd.infradead.org/faq/jffs2.html#L_messages
So has anyone experienced similar problems ? Could this be related to the mkfs.jffs2 used by openembedded which is to old ? I don't think so because I guess the mkfs.jffs2 used by OE is this one which seems up to date:
Quoted 2 lines
valentin@lsro1pc307:/usr/local/OE/tmp/work/i686-linux/mtd-utils-native-1.0. 0+git-r2/git$ ./mkfs.jffs2 --version mkfs.jffs2: revision 1.50
I want to precise that I am working on a imx31ads board, running a freescale 2.6.19 kernel (I have recipe for it, it's not the one present by default on OE) and I am using the redboot bootloader.
Do you think my problems could be due to (bad) redboot usage ? Does anyone know what could be the cause of these (not so severe) issues ?
Thank you
Signature · 3 lines
Valentin Longchamp PhD Student http://people.epfl.ch/valentin.longchamp
Am 07.06.2007 um 15:19 schrieb Valentin Longchamp:
Quoted 5 lines
I have been working with nfs root filesystems during last months for my openembeded targeted system. I am going to receive the first prototype of our custom design soon so I have tested the jffs2 images generated by OE for my bootstrap-image.
awesome :)
Quoted 3 lines
However, according to the jffs2 documentation, I should use
/dev/mtd2and not/dev/mtdblock2:
http://www.linux-mtd.infradead.org/faq/jffs2.html#L_mtdblock
Fromt the FAQ you pointed us to: "There are two cases where this does not work. The first is when JFFS2 is used as a root filesystem. For now, this requires the mtdblock device to be specified for root= on the kernel commandline. The second case is when the mount binary that is being used does not play nicely with the above format. The busybox version of mount is known to not work without the mtdblock device."
I know you don't have a rootfs on jffs2 but do you use busybox mount?
z.
Quoted 6 lines · Holger Freyther
Quoted 5 lines
However, according to the jffs2 documentation, I should use
/dev/mtd2 and
not/dev/mtdblock2:
http://www.linux-mtd.infradead.org/faq/jffs2.html#L_mtdblock
Quoted 9 lines
Fromt the FAQ you pointed us to: "There are two cases where this does not work. The first is when JFFS2 is used as a root filesystem. For now, this requires the mtdblock device to be specified for root= on the kernel commandline. The second case is when the mount binary that is being used does not play nicely with the above format. The busybox version of mount is known to not work without the mtdblock device."
I know you don't have a rootfs on jffs2 but do you use busybox mount?
That was one of the first things I had tried to test but I have forgotten to tell about it in the mail. Anyway, OE does not include mount in busybox and builds the "usual" one:
Quoted 8 lines
root@mx31ads:~$ which mount /bin/mount root@mx31ads:~$ ls -al /bin/mount lrwxrwxrwx 1 root root 16 Jan 1 00:00 /bin/mount -> mount.util-linux root@mx31ads:~$ ls -al /bin/mount.util-linux -rwsr-xr-x 1 root root 60604 Jan 1 00:00 /bin/mount.util-linux root@mx31ads:~$ mount --version mount: mount-2.12
But thank you for the quick and pertinent answer.
Signature · 3 lines
Valentin Longchamp PhD Student http://people.epfl.ch/valentin.longchamp
Quoted 10 lines · Valentin Longchamp
I can boot on the jffs2 images loading them into flash, which is nice. However I have noticed that these jffs2 images have several problems:
1) Running the nfsroot on the dev board, when I want to mount the jffs2 filesystem from the corresponding mtd device, I have to use the corresponding mtdblock and not directly the mtd device. But I have no error in dmesg.
Quoted 2 lines
root@mx31ads:/$ mount -t jffs2 /dev/mtd2 /media/flash mount: wrong fs type, bad option, bad superblock on /dev/mtd2,
Use "mtdX" instead of "/dev/mtdX". This method was mentioned on this mailing list before:
Subject: RFC: stop mounting /dev/mtdblockX but mount mtdX (without /dev)
From: Koen Kooi <[email protected]>
Date: 21/02/2007 21:20
Working example:
root@c7x0:~# mount mtd3 /home/ -t jffs2 root@c7x0:~# uname -a Linux c7x0 2.6.21 #2 PREEMPT Wed Jun 6 16:33:32 CEST 2007 armv5tel unknown
Signature · 4 lines
JID: hrw-jabber.org
OpenEmbedded developer/consultant
Warning: Dates in calendar are closer than they appear.Quoted 3 lines · Marcin Juszkiewicz
Use "mtdX" instead of "
/dev/mtdX". This method was mentioned on this mailing list before:
Thank you Marcin, it works like a charm !
Signature · 3 lines
Valentin Longchamp PhD Student http://people.epfl.ch/valentin.longchamp