* transfer jffs2 rootFS to Nand flash
@ 2007-08-29 14:10 Saravanan Chanemouganandam
2007-08-29 14:42 ` Ricard Wanderlof
0 siblings, 1 reply; 5+ messages in thread
From: Saravanan Chanemouganandam @ 2007-08-29 14:10 UTC (permalink / raw)
To: linux-mtd
Hi all,
I am fascing problem in mounting jffs2 root file system on the cm-x270 board
after flashing the jffs2 root file system image on to the MTD Nand partition
with the following steps....
1. boot cm-x270 with NAND, NOR and JFFS2 drivers built into kernel
2. mounted root file system via "nfs"
3. checked the partitions
cm-debian:~# cat /proc/partitions
major minor #blocks name
254 0 513576 nand
31 0 4096 mtdblock0 ( NOR)
31 1 524288 mtdblock1 (NAND)
cm-debian:~# cat /proc/mtd
dev: size erasesize name
mtd0: 00400000 00010000 "phys_mapped_flash"
mtd1: 20000000 00020000 "cmx270-0"
cm-debian:~#
4. cm-debian:~#flash_eraseall -j /dev/mtd1
5. on the host created jffs2 rootfs image using #mkfs.jffs2 -r cmrootfs -n -o
cmrootfs.img -e 0x20000 --pad=0x20000000
6. copied cmrootfs.img to the cm-x270 board
7. on the cm-x270, flashed rootfs image using mtd-utilities
cm-debian:~# nandwrite /dev/mtdblock1 /mnt/net/cmrootfs.img
.....
Writing data to block 1ffe0000
Data did not fit into device, due to bad blocks
: Success
cm-debian:~#
8. Tested the jffs2 rootFS using mount
cm-debian:~# mount -t jffs2 /dev/mtdblock1 /mnt/test
cm-debian:/mnt/net# ls /mnt/test
bin dev home lib media opt proc sbin sys usr
boot etc initrd lost+found mnt packages.txt root srv tmp var
After reboot, I am getting the kernel panic with boot option for root as
root=/dev/mtdblock1 rootfstype=jffs2"
...
...
IP-Config: Complete:
device=eth0, addr=192.168.6.202, mask=255.255.255.0, gw=192.168.6.1,
host=cm-x270, domain=, nis-domain=(none),
bootserver=192.168.6.1, rootserver=192.168.6.1, rootpath=
Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
empty_blocks 0, bad_blocks 8, c->nr_blocks 4096
VFS: Cannot open root device "mtdblock1" or unknown-block(31,1)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(31,1)
Could anyone please tell me where I am wrong ? and why is the JFFS doesn't
mount the file system?
Thanks
Sara
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: transfer jffs2 rootFS to Nand flash
2007-08-29 14:10 transfer jffs2 rootFS to Nand flash Saravanan Chanemouganandam
@ 2007-08-29 14:42 ` Ricard Wanderlof
[not found] ` <200708301345.36832.schane@osmozis.com>
0 siblings, 1 reply; 5+ messages in thread
From: Ricard Wanderlof @ 2007-08-29 14:42 UTC (permalink / raw)
To: Linux mtd
On Wed, 29 Aug 2007, Saravanan Chanemouganandam wrote:
> 5. on the host created jffs2 rootfs image using #mkfs.jffs2 -r cmrootfs -n -o
> cmrootfs.img -e 0x20000 --pad=0x20000000
> ...
> 7. on the cm-x270, flashed rootfs image using mtd-utilities
> cm-debian:~# nandwrite /dev/mtdblock1 /mnt/net/cmrootfs.img
> .....
> Writing data to block 1ffe0000
> Data did not fit into device, due to bad blocks
> : Success
> cm-debian:~#
You shouldn't pad the image up to the size of the device (or partition, if
you were using partitions) or you will get this error, if there are bad
blocks in your flash (there usually are). However, your subsequent test
mount seems to work, so you seem to have gotten all valid data into the
flash anyway, so it still doesn't explain why it doesn't want to be
mounted when
the kernel boots.
/Ricard
--
Ricard Wolf Wanderlöf ricardw(at)axis.com
Axis Communications AB, Lund, Sweden www.axis.com
Phone +46 46 272 2016 Fax +46 46 13 61 30
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: transfer jffs2 rootFS to Nand flash
[not found] ` <200708301345.36832.schane@osmozis.com>
@ 2007-08-30 11:51 ` Ricard Wanderlof
[not found] ` <200708301655.54224.schane@osmozis.com>
0 siblings, 1 reply; 5+ messages in thread
From: Ricard Wanderlof @ 2007-08-30 11:51 UTC (permalink / raw)
To: Saravanan Chanemouganandam; +Cc: Linux mtd
On Thu, 30 Aug 2007, Saravanan Chanemouganandam wrote:
> Thanks to your analysis and answer. I have removed the --pad option in
> mkfs.jffs2 and then flashed the image using "nandwrite -p /dev/mtdblock1
> cmrootfs.img". This time theres no "due to bad blocks" error.
Ok, well that's good anyway.
>
> The test on mounting jffs2 image was success once after flashing within the
> running linux as
>
> cm-debian:/mnt/net#mount -t jffs2 /dev/mtdblock1 /mnt/test
> cm-debian:/mnt/net# ls /mnt/test
> bin dev home lib media opt proc sbin sys usr
> boot etc initrd lost+found mnt packages.txt root srv tmp var
>
> Indeed, the test of above jffs2 mount after reboot of the system got failed
> and its a strange.
>
> cm-debian:/mnt/net# mount -t jffs2 /dev/mtdblock1 /mnt/test
> Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
> empty_blocks 0, bad_blocks 8, c->nr_blocks 4080
> mount: /dev/mtdblock1: can't read superblock
The "Cowardly refusing to erase blocks on filesystem with no valid JFFS2
nodes" indicates to me that what Linux thinks is /dev/mtdblock1 is in fact
completely erased flash.
> I hope this may explain some hidden stuffs behind the failure of mounting when
> kernel boots. I think it could be the compatibility isseu of the compulab NAND driver and
> the JFFS2. any idea from this behaviour?
The only idea I have is that the device numbers (/dev/mtdblockN) get
shifted around for some reason, i.e. you should use /dev/mtdblock0 or 2 or
something. Can't understand why though.
/Ricard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: transfer jffs2 rootFS to Nand flash
[not found] ` <200708301655.54224.schane@osmozis.com>
@ 2007-08-30 15:09 ` Ricard Wanderlof
2007-08-30 15:58 ` Saravanan Chanemouganandam
0 siblings, 1 reply; 5+ messages in thread
From: Ricard Wanderlof @ 2007-08-30 15:09 UTC (permalink / raw)
To: Saravanan Chanemouganandam; +Cc: Linux mtd
On Thu, 30 Aug 2007, Saravanan Chanemouganandam wrote:
> I have unconfigured the compulab NAND flash block driver which reinitialise
> (erases on reboot) each and everytime of reboot that conflicts with MTD nand
> driver.
That would definitely explain the symptoms you were seeing (no jffs2 nodes
found when mounting the rootfs).
>
> This fixed my problem and I can be able to successfully mount the jffs2
> rootfs.
>
> IP-Config: Complete:
> device=eth0, addr=192.168.6.202, mask=255.255.255.0, gw=192.168.6.1,
> host=cm-x270, domain=, nis-domain=(none),
> bootserver=192.168.6.1, rootserver=192.168.6.1, rootpath=
> VFS: Mounted root (jffs2 filesystem).
> Freeing init memory: 120K
> INIT: version 2.86 booting
>
> Thanks a lot for your comments and your valuable time.
Great!
/Ricard
--
Ricard Wolf Wanderlöf ricardw(at)axis.com
Axis Communications AB, Lund, Sweden www.axis.com
Phone +46 46 272 2016 Fax +46 46 13 61 30
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: transfer jffs2 rootFS to Nand flash
2007-08-30 15:09 ` Ricard Wanderlof
@ 2007-08-30 15:58 ` Saravanan Chanemouganandam
0 siblings, 0 replies; 5+ messages in thread
From: Saravanan Chanemouganandam @ 2007-08-30 15:58 UTC (permalink / raw)
To: linux-mtd
Hi all,
I got my problem fix up by gurus. The work around solution to transfer jffs2
rootfs on the cm-x270 nand ( /dev/mtdblock1 ) is to have the following
kernel configuration setup.
CONFIG_ARMCORE_FLASH is not set
CONFIG_ARMCORE_NAND is not set
CONFIG_MTD_NAND_CM_X270 is set
The "compulab Nand flash" block driver CONFIG_ARMCORE_NAND initializes
(erases) nand contents on each reboot that causes the jffs2 rootfs mounting
failure.
Unconfig CONFIG_ARMCORE_NAND fixs the problem and the jffs2 rootfs on the
cm-x270 nand mounted succesfully.
IP-Config: Complete:
device=eth0, addr=192.168.6.203, mask=255.255.255.0, gw=192.168.6.1,
host=cm-x270, domain=, nis-domain=(none),
bootserver=192.168.6.1, rootserver=192.168.6.1, rootpath=
VFS: Mounted root (jffs2 filesystem).
Freeing init memory: 120K
Regards,
Sara
Le Jeudi 30 Août 2007 17:09, vous avez écrit :
> On Thu, 30 Aug 2007, Saravanan Chanemouganandam wrote:
> > I have unconfigured the compulab NAND flash block driver which
> > reinitialise (erases on reboot) each and everytime of reboot that
> > conflicts with MTD nand driver.
>
> That would definitely explain the symptoms you were seeing (no jffs2 nodes
> found when mounting the rootfs).
>
> > This fixed my problem and I can be able to successfully mount the jffs2
> > rootfs.
> >
> > IP-Config: Complete:
> > device=eth0, addr=192.168.6.202, mask=255.255.255.0, gw=192.168.6.1,
> > host=cm-x270, domain=, nis-domain=(none),
> > bootserver=192.168.6.1, rootserver=192.168.6.1, rootpath=
> > VFS: Mounted root (jffs2 filesystem).
> > Freeing init memory: 120K
> > INIT: version 2.86 booting
> >
> > Thanks a lot for your comments and your valuable time.
>
> Great!
>
> /Ricard
> --
> Ricard Wolf Wanderlöf ricardw(at)axis.com
> Axis Communications AB, Lund, Sweden www.axis.com
> Phone +46 46 272 2016 Fax +46 46 13 61 30
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-08-30 15:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-29 14:10 transfer jffs2 rootFS to Nand flash Saravanan Chanemouganandam
2007-08-29 14:42 ` Ricard Wanderlof
[not found] ` <200708301345.36832.schane@osmozis.com>
2007-08-30 11:51 ` Ricard Wanderlof
[not found] ` <200708301655.54224.schane@osmozis.com>
2007-08-30 15:09 ` Ricard Wanderlof
2007-08-30 15:58 ` Saravanan Chanemouganandam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox