Welcome! Log In Create A New Profile

Advanced

Can't Get Kernel Image -- multi-drive

Posted by WyoGuy 
Can't Get Kernel Image -- multi-drive
January 01, 2015 09:38PM
First of all, thanks to Bodhi and others for such a wonderful, cool project. I have been loading the rootfs image with the 3.16 kernel on a few pogoplugs and dockstars and I am amazed how well they work.

For my latest project, I am placing two Dockstars inside an old NSS4000 case (1U Rackmount box). The motherboard was shot and I am just replacing the guts with two Dockstars.

In any case, I have a Dockstar with a USB stick in it and it boots up just fine. After I add one or two more SATA drives that uBoot cannot read (not formatted ext2) uBoot gives up and says "Error: Can't get Kernel Image"

It then resets and goes into a continual boot-loop.

It is almost as if the extra drive(s) that it cannot read are confusing it.

If I leave the SATA drives powered off until the exact point that I see the linux Kernel get read off of the USB stick and then flip the power switch... Everything comes up just fine.

I am under the impression that uBoot scans all drives installed on the usb bus and looks for a partition with the rootfs label. Is there a way to exclude certain drives from the search? (I am thinking that this might fix it).

Below is the output on the console. (I have a console attached to the serial port) As you can see, the rootfs label is found, but it does not load the kernel from the ext2 or ext3 partition (I have tried both).

Side Note: In case anybody is interested, two dockstars and 4 USB/SATA adapters fit just fine inside an empty case from an NSS4000.

       scanning usb for storage devices... 3 Storage Device(s) found
Unknown command 'mmc' - try 'help'
Unknown command 'ide' - try 'help'

Partition Map for USB device 0  --   Partition Type: EFI

Part    Start LBA       End LBA         Name
        Attributes
        Type GUID
        Partition GUID
  1     0x00000800      0xe8e087ff      "RAID"
        attrs:  0x0000000000000000
        type:   a19d880f-05fc-4d3b-a006-743f0f84911e
        guid:   660d0beb-df2d-43b3-b64d-d295d70ce387


Partition Map for USB device 1  --   Partition Type: EFI

Part    Start LBA       End LBA         Name
        Attributes
        Type GUID
        Partition GUID
  1     0x00000800      0xe8e087ff      "RAID"
        attrs:  0x0000000000000000
        type:   a19d880f-05fc-4d3b-a006-743f0f84911e
        guid:   b538bdca-54c1-4ef3-9b84-ea42646c392f


Partition Map for USB device 2  --   Partition Type: EFI

Part    Start LBA       End LBA         Name
        Attributes
        Type GUID
        Partition GUID
  1     0x00000800      0x00e887ff      "rootfs"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   34226768-1ec1-4f97-8168-c6af0e19547d
loading envs from usb 0 ...
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
Unknown command 'mmc' - try 'help'
Unknown command 'ide' - try 'help'
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 5 USB Device(s) found
       scanning usb for storage devices... 3 Storage Device(s) found
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
Wrong Image Format for bootm command
ERROR: can't get kernel image!
Unknown command 'mmc' - try 'help'
** Bad device mmc 0 **
** Bad device mmc 0 **
Wrong Image Format for bootm command
ERROR: can't get kernel image!
Unknown command 'ide' - try 'help'
** Bad device ide 0 **
** Bad device ide 0 **
Wrong Image Format for bootm command
ERROR: can't get kernel image!
resetting ...
Re: Can't Get Kernel Image -- multi-drive
January 01, 2015 10:57PM
WyoGuy,

To boot with multiple drive, you need to use label for the the boot drive:
http://forum.doozan.com/read.php?3,8044,8152#msg-8152

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Can't Get Kernel Image -- multi-drive
January 03, 2015 02:54PM
Thanks for the help, Bodhi

For some reason, there is a limitation on the Dockstar so that the methods to find the correct USB boot device fails if the jump-drive is not plugged into the first physical port (the one located next to the ethernet port.

This is unfortunate, but I can jostle a few things around and make it fit this way. I am sure that there is an error in the UBoot scripting (in my case) that is preventing looking further down the list of USB devices for the rootfs.

I moved my jump drive to a different port and it works!

Since I have found my solution with a physical change instead of a software change there is no need to reply.

I continue below to ramble in case anybody else finds this interesting...
-------------------------------------

I have learned a couple of things:

* I had thought that the Table name in the gpt (parted /dev/sda print) was what the uboot was looking for. I did not know that it was looking for the partition label of the first (and only) partition.

* I did not know about changing the usb_init variable to specify the LABEL=rootfs (I thought it was automatic).

The above two things did nothing for me, but it is good to know for the future.

Interestingly enough, I have never had a problem with multiple drives before. (usb-flash stick for boot and large usb-HD for space) I have always been booting from the USB thumb-drive until I started trying to do this RAID thing.

Interestingly, I was still able to boot just fine if I left the power off of the physical external drives until the kernel started loading.

Note: When using the "run usb_scan" (mentioned in the very old post) as part of the usb_init variable, I get this:
## Error: "usb_scan" not defined

Here is the summary of what I did (That I like)

1) Move the USB jump-drive to the first USB port *** most likely to have fixed my problem ***

2) I changed the variable uenv_load
from this:
usb start; mmc rescan; ide reset; setenv uenv_loaded 0; for devtype in usb mmc ide; do for disknum in 0; do run uenv_read_disk; done; done
to this
usb start; setenv uenv_loaded 0; for devtype in usb; do for disknum in 0; do run uenv_read_disk; done; done
Probably did nothing -- but did eliminate a couple of errors durring boot.
3) I changed this variable: usb_init
from this
usb start
to this
usb start; setenv usb_root LABEL=rootfs
Which may have made no difference at all, but now that it is working, I don't want to touch it.

In short.
I am able to boot up a Dockstar from a USB Jump-Drive and have it load two large external hard drives as a RAID0 (mounted as /home)

I will have two of these (with 4 SATA hard drives total) all fit into a repurposed NSS4000 case.
Re: Can't Get Kernel Image -- multi-drive
January 03, 2015 10:12PM
WyoGuy,

Glad you got it working!

However, FWIW, the physical placement of the drives is not a real solution. It will work in your current configuration, but once you start adding another drive to the hub, all bets are off. The only foolproof solution is to use a label. Using UUID also works quite well, but also has a flaw in that replacement of the physical boot drive will mess up the UUID scheme, too.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 01/03/2015 10:12PM by bodhi.
Re: Can't Get Kernel Image -- multi-drive
January 04, 2015 02:57PM
Bodhi: Thank you for actively responding to my posts.

NOTE: I am using the 2014-07 uboot image that I downloaded from your dropbox link.

I tried and tried to get uBoot to read the "rootfs" label. I used tune2fs to put the label in the partition and verified it with blkid and I also see it listed in /dev/disk/by-label

When I watch the boot-up, I am not convinced that it goes through all three drives to find the label.

If you can explain to me how to change to look for UUID instead of partition label, I would appreciate that.

As you can see above in the text I posted, It finds all three "Storage Devices" and it displays the Partition Table Names.

It then appears to look for "/boot/uEnv.txt" only from usb device #0

It never appears to go through the partitions that it found and look for the "rootfs" label at all as far as I can tell.

However, I do see three messages saying: "Wrong Image Format for bootm command" (making me think that it is doing something with all three storage devices).

When I swap the USB jump-dirve to other port (which I would rather not do nor rely on) here is what is displayed (when it works):
loading envs from usb 0 ...
** File not found /boot/uEnv.txt **
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 5 USB Device(s) found
       scanning usb for storage devices... 3 Storage Device(s) found
2756040 bytes read in 423 ms (6.2 MiB/s)
6032465 bytes read in 575 ms (10 MiB/s)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-3.16.0-kirkwood-tld-2
   Created:      2014-09-01  23:18:31 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2755976 Bytes = 2.6 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-3.16.0-kirkwood-tld-2
   Created:      2014-09-01  23:18:48 UTC
...
Re: Can't Get Kernel Image -- multi-drive
January 04, 2015 11:26PM
WyoGuy,

I've started a new thread:
http://forum.doozan.com/read.php?3,19093

This problem occured when the booting is still in phase 1:

Quote

It never appears to go through the partitions that it found and look for the "rootfs" label at all as far as I can tell.

However, I do see three messages saying: "Wrong Image Format for bootm command" (making me think that it is doing something with all three storage devices).

Please see the thread above for explanation.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 01/06/2015 03:23AM by bodhi.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: