• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Boot from internal device  (Read 3603 times)
byteman
Newbie
*

Karma: 1
Posts: 26


View Profile
« on: February 15, 2010, 02:48:29 PM »

Hi -

I successfully installed my system on an SD device - that's working, but I'm getting some disk errors.  So I'd like to go back and boot from the internal device and run some sort of disk fixer utility.  I change the boot device to mtdblock0 with:

setenv bootargs_root root=/dev/mtdblock0

...but it doesn't work.  Here's what I get:

Code:
List of all partitions:
1f00            4096 mtdblock0 (driver?)
1f01          519168 mtdblock1 (driver?)
No filesystem could mount root, tried:  ext3 ext2 ext4 cramfs vfat msdos jfs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,0)
[<c0032b38>] (unwind_backtrace+0x0/0xe0) from [<c0044144>] (panic+0x54/0x12c)
[<c0044144>] (panic+0x54/0x12c) from [<c0008f10>] (mount_block_root+0x1d4/0x214)
[<c0008f10>] (mount_block_root+0x1d4/0x214) from [<c00091b8>] (prepare_namespace+0x16c/0x1c4)
[<c00091b8>] (prepare_namespace+0x16c/0x1c4) from [<c0008764>] (kernel_init+0xe0/0x114)
[<c0008764>] (kernel_init+0xe0/0x114) from [<c002e444>] (kernel_thread_exit+0x0/0x8)

I'm probably doing something real stupid, but can't see it???
« Last Edit: February 16, 2010, 10:45:30 AM by byteman » Logged

birdman
Sr. Member
****

Karma: 4
Posts: 440


View Profile WWW
« Reply #1 on: February 15, 2010, 06:16:23 PM »

I'm probably doing something real stupid, but can't see it???
root will be /dev/mtdblock1/dev/mtdblock0 is what you boot off (i.e. where the uImage sits).
Logged

byteman
Newbie
*

Karma: 1
Posts: 26


View Profile
« Reply #2 on: February 15, 2010, 08:34:43 PM »


Quote
root will be /dev/mtdblock1.  /dev/mtdblock0 is what you boot off (i.e. where the uImage sits).

I get the same error:

Code:
List of all partitions:
1f00            4096 mtdblock0 (driver?)
1f01          519168 mtdblock1 (driver?)
No filesystem could mount root, tried:  ext3 ext2 ext4 cramfs vfat msdos jfs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,1)
[<c0032b38>] (unwind_backtrace+0x0/0xe0) from [<c0044144>] (panic+0x54/0x12c)
[<c0044144>] (panic+0x54/0x12c) from [<c0008f10>] (mount_block_root+0x1d4/0x214)
[<c0008f10>] (mount_block_root+0x1d4/0x214) from [<c00091b8>] (prepare_namespace+0x16c/0x1c4)
[<c00091b8>] (prepare_namespace+0x16c/0x1c4) from [<c0008764>] (kernel_init+0xe0/0x114)
[<c0008764>] (kernel_init+0xe0/0x114) from [<c002e444>] (kernel_thread_exit+0x0/0x8)

Does this mean my internal drive is screwed up???
Logged

fragfutter
Sr. Member
****

Karma: 12
Posts: 280


View Profile
« Reply #3 on: February 16, 2010, 01:16:07 AM »

read the error again. The kernel does not know the filesystem on mtdblock1. It is either jffs or ubifs. And i don't know out of my head how to mount it directly (and if it is possible) without an initrd.
Logged

byteman
Newbie
*

Karma: 1
Posts: 26


View Profile
« Reply #4 on: February 16, 2010, 09:24:53 AM »

OK - I'm really at a loss here - and I apologize for my ignorance.

Here's all I have done to my SheevaPlug:

1.  I installed the Installer Ver. 1
2.  I formatted a sd card per the instructions here: http://www.openplug.org/plugwiki/index.php/SD_Card_As_Root_File_System
3.  I was able to boot from the sd card, so i changed the bootargs_root environment variable so it would always boot from the sd card.
3.  I've installed a later kernel 2.6.32.4

Now I am getting this error every couple of minutes when I boot from the sd card:
Code:
EXT2-fs error (device mmcblk0p1): ext2_lookup: deleted inode referenced: 137702

So I want to go back and boot from my internal drive and fix the errors on my sd card.

I have not changed the file system on my internal drive.

Not sure what to try next???
« Last Edit: February 16, 2010, 10:46:18 AM by byteman » Logged

fragfutter
Sr. Member
****

Karma: 12
Posts: 280


View Profile
« Reply #5 on: February 17, 2010, 01:12:48 AM »

i don't know what is compiled in where and which setup is the default.

If you did not touch the internal nand (mtdblock) it should be formated as jffs. The kernel you installed (wherever you downloaded it) does not contain a compiled in jffs driver. So you need to either start the system with a different kernel, or boot it with an initrd that contains the driver.
Logged

byteman
Newbie
*

Karma: 1
Posts: 26


View Profile
« Reply #6 on: February 17, 2010, 08:40:34 AM »

First, thanks very much fragfutter for trying to assist.    I originally used the Installer 1.0 to install to the nand device per the instructions in the wiki - originally, it was successful - I could boot from the nand device.  I don't recall changing the file system type on the nand, but per the instructions, the choices are either ubifs or jffs2.  I'm using kernel 2.6.32.4 on the sd card, so that tells me that I should be able to mount mtdblock1 after I boot from the sd card.  Here's what I get when I try to mount using either file system type:

Code:
root@SheevaUno:/# mount -r /dev/mtdblock1 /mnt/nand -t ubifs
UBIFS error (pid 2006): ubifs_get_sb: cannot open "/dev/mtdblock1", error -22
mount: wrong fs type, bad option, bad superblock on /dev/mtdblock1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

root@SheevaUno:/# mount -r /dev/mtdblock1 /mnt/nand -t jffs2
mount: /dev/mtdblock0: can't read superblock

So am I "dead in the water" trying to boot from the nand, or is there something (hopefully simple) I can do to fix this?
« Last Edit: February 17, 2010, 08:42:13 AM by byteman » Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #7 on: February 17, 2010, 09:30:38 AM »

OK, lets try to debug this problem Tongue

First we need to know you environment. please post output of, (error message include)
  • cat /proc/filesystems
  • lsmod
  • ls -l /dev/mtd*

second I am curious you said
Quote
I'm using kernel 2.6.32.4 on the sd card, so that tells me that I should be able to mount mtdblock1 after I boot from the sd card
what let you believe kernel 2.6.32.4 will enable you mount mtdblock1?

Logged

Good Luck Smiley

byteman
Newbie
*

Karma: 1
Posts: 26


View Profile
« Reply #8 on: February 17, 2010, 11:59:02 AM »

OK, here is the output:

Code:
root@SheevaUno:/# cat /proc/filesystems
nodev   sysfs
nodev   rootfs
nodev   bdev
nodev   proc
nodev   tmpfs
nodev   debugfs
nodev   sockfs
nodev   usbfs
nodev   pipefs
nodev   anon_inodefs
nodev   rpc_pipefs
nodev   inotifyfs
nodev   devpts
        ext3
        ext2
        ext4
        cramfs
nodev   ramfs
        vfat
        msdos
nodev   nfs
nodev   nfs4
nodev   jffs2
        jfs
nodev   oprofilefs
nodev   ubifs

root@SheevaUno:/# lsmod
Module                  Size  Used by
ipv6                  246849  10
dm_crypt               12186  0
dm_mod                 60748  1 dm_crypt
mv_cesa                 4982  0

root@SheevaUno:/# ls -l /dev/mtd*
crw-rw---- 1 root root 90, 0 Feb 17 07:34 /dev/mtd0
crw-rw---- 1 root root 90, 1 Feb 17 07:34 /dev/mtd0ro
crw-rw---- 1 root root 90, 2 Feb 17 07:34 /dev/mtd1
crw-rw---- 1 root root 90, 3 Feb 17 07:34 /dev/mtd1ro
brw-rw---- 1 root disk 31, 0 Feb 17 07:34 /dev/mtdblock0
brw-rw---- 1 root disk 31, 1 Feb 17 07:34 /dev/mtdblock1

Quote
what let you believe kernel 2.6.32.4 will enable you mount mtdblock1?

The "sheeva-2.6.32.4.config" file showed the following:

Code:
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
CONFIG_JFFS2_FS_WRITEBUFFER=y
# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
# CONFIG_JFFS2_SUMMARY is not set
# CONFIG_JFFS2_FS_XATTR is not set
# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
CONFIG_JFFS2_ZLIB=y
# CONFIG_JFFS2_LZO is not set
CONFIG_JFFS2_RTIME=y
# CONFIG_JFFS2_RUBIN is not set
CONFIG_UBIFS_FS=y

I was probably mis-interpreting that the above meant the kernel had ubifs and jffs2 support???
Logged

fragfutter
Sr. Member
****

Karma: 12
Posts: 280


View Profile
« Reply #9 on: February 17, 2010, 12:24:24 PM »

your internal system is propably ubifs. To mount an ubifs volume, one does not directly access the underlying nand device (mtd). The exact procedure depends on the kernel and the state of the used backport. You need to do an ubiattach first.

With 2.6.32 you can mount it as rootfs. There is some kernel commandline parameter.
Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #10 on: February 17, 2010, 12:45:34 PM »

@byteman,

After review your past post I can not find what kind of root file system is in NAND device so we have try it one by one.

For ubi use following:
Code:
root@SheevaUno:/$ modprobe ubi #<= don't worry if it fail, this is in case your ubi was build as module.
root@SheevaUno:/$ ubinfo -a #<= If we got some information, that would mean you have ubifs based system.
############# Do following only if above ubinfo give meaningful return ###
root@SheevaUno:/$ ubiattach /dev/ubi_ctrl -m 1
root@SheevaUno:/$ mount -t ubifs ubi0:(Name of your rootfs volume) /mnt/nand

For jffs2:
Code:
root@SheevaUno:/$ mount -t jffs2 mtd1 /mnt/nand -o ro

Let me which work then we can workout the kernel parameters you need to put in u-boot.
Logged

Good Luck Smiley

byteman
Newbie
*

Karma: 1
Posts: 26


View Profile
« Reply #11 on: February 17, 2010, 03:12:39 PM »

OK - I'm getting optimistic!  Here's what I got:

Code:
root@SheevaUno:/# modprobe ubi
FATAL: Module ubi not found.
root@SheevaUno:/# ubinfo -a
UBI version:                    1
Count of UBI devices:           0
UBI control device major/minor: 10:62
root@SheevaUno:/# ubiattach /dev/ubi_ctrl -m 1
UBI device number 0, total 4055 LEBs (523192320 bytes, 499.0 MiB), available 0 LEBs (0 bytes), LEB size 129024 bytes (126.0 KiB)
root@SheevaUno:/# mount -t ubifs ubi0  /mnt/nand
root@SheevaUno:/# cd /mnt/nand
root@SheevaUno:/mnt/nand# ls
bin   dev  home  media  opt   root  selinux  sys  usr
boot  etc  lib   mnt    proc  sbin  srv      tmp  var

BTW - I'm not sure what kernel is on the nand device - I followed the installer instructions on the wiki, then I can't remember if I upgraded the nand kernel before creating the sd card system - not sure how to tell.

Update:  I believe that the kernel on the nand device is also 2.6.32.4 - I see that I copied over the kernel modules to /lib/modules/2.6.32.4

I totally appreciate your help - what next???
« Last Edit: February 17, 2010, 03:58:24 PM by byteman » Logged

birdman
Sr. Member
****

Karma: 4
Posts: 440


View Profile WWW
« Reply #12 on: February 17, 2010, 06:28:08 PM »

BTW - I'm not sure what kernel is on the nand device - I followed the installer instructions on the wiki, then I can't remember if I upgraded the nand kernel before creating the sd card system - not sure how to tell.
Mount the file system and cd to the boot dir.  It will contain a uImage file.  This contains the version number near the start, and hd will show it to you.  Here's mine:
Quote
root@plug:/mnt/nand/boot# hd -n 50 uImage
00000000  27 05 19 56 69 03 6a 0e  4a 67 c2 a0 00 27 fc 18  |'..Vi.j.Jg...'..|
00000010  00 00 80 00 00 00 80 00  d3 65 7b 82 05 02 02 00  |.........e{.....|
00000020  4c 69 6e 75 78 2d 32 2e  36 2e 33 30 2e 32 00 00  |Linux-2.6.30.2..|
00000030  00 00                                             |..|
00000032
Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #13 on: February 17, 2010, 06:52:06 PM »

@byteman

your need to set your u-boot bootargs to bootargs=... ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs.

Remember for setenv you need to quote when its argument have space.

Good luck Smiley
Logged

Good Luck Smiley

byteman
Newbie
*

Karma: 1
Posts: 26


View Profile
« Reply #14 on: February 17, 2010, 09:09:43 PM »

OMG, that worked.  I'm going to bed now, but I'm hoping that still works in the morning!

Thanks again pingtoo, fragfutter, and birdman!

And, how do you know this stuff?  (Actually a rhetorical question!)
Logged

Pages: [1]
Print
Jump to: