Using a Flash-Based RFS

Question: When attempting to boot from flash, the kernel panics with an error message similar to the following one:

kernel panic - not syncing VFS: unable to mount rootfs on unknown-block(31,2)

How do I tell the kernel to use my flash-based RFS?

Answer:

The kernel must be told the RFS type as well as its device node. Ensure that the kernel command line contains the following boot options:

root=1f02 rw rootfstype=jffs2

to get it to boot properly. This example assumes your RFS is on /dev/mtdblock2. The proper options for an RFS on /dev/mtdblock0 or /dev/mtdblock1 would be, respectively:

root=1f00 rw rootfstype=jffs2
root=1f01 rw rootfstype=jffs2