Mounting NAND flash as the root file system

Jatin Sharma sharmaj at gmail.com
Wed Apr 29 18:12:03 EDT 2009


I thought I post how I fixed this problem. It actually turned out to
be some debug code in do_mount.c that we added which led to this
issue. After updating this file from the original BSP from Montavista,
I was able to mount rootfs on NAND. Thanks for the help from this
forum.

Regards,
Jatin

2009/4/28 Jatin Sharma <sharmaj at gmail.com>:
> After turning on JFFS2 debug, I found that kernel is trying to mount
> /dev/root even though I gave "root=/dev/mtdblock0" in my command line.
> Is the command line correct:
>
> Command line="root=/dev/mtdblock0 rootfstype=jffs2 rw"
>
> Here is the error:
> IP-Config: Complete:
>      device=WP-SED, addr=10.100.54.179, mask=255.255.255.0, gw=10.100.54.33,
>     host=10.100.54.179, domain=, nis-domain=(none),
>     bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath=
> <7>jffs2_get_sb(): dev_name "/dev/root"
> <7>jffs2_get_sb(): path_lookup() returned 0, inode 81731c94
> <0>Kernel panic - not syncing: VFS: Unable to mount root fs on
> unknown-block(0,255)
>
> I have attached complete kernel log with this email. Thanks for helping.
>
> Regards,
> Jatin
>
> 2009/4/28 Ricard Wanderlof <ricard.wanderlof at axis.com>:
>>
>> On Tue, 28 Apr 2009, Jatin Sharma wrote:
>>
>>> Actually, I was mounting the block device but wrote it wrong in the email.
>>>
>>> WDS# mount -t jffs2 /dev/mtdblock0 /mnt
>>> mount: mounting /dev/mtdblock0 on /mnt failed
>>
>> Ok. Well I don't really have any other ideas, it's just a typical mistake
>> that people make (I do it all the time...).
>>
>>> Since the flash_eraseall and nandwrite tools are working on the NAND
>>> device, NAND driver is working fine. Would you agree? I don't have the
>>> nanddump tools on my file system but will include it to make sure NAND
>>> is getting updating after being written by nandwrite.
>>
>> What happens if you erase the flash and the mount it directly (without
>> writing an image to it). An empty flash is a valid jffs2 file system, so if
>> this works, but mounting the partition with an image in it doesn't, there
>> could be something wrong with your image.
>>
>> /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
>>
>



More information about the linux-mtd mailing list