public inbox for gentoo-embedded@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-embedded] USB Boot Problem
@ 2010-02-10 18:57 Relson, David
  2010-02-10 19:14 ` Manuel Lauss
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Relson, David @ 2010-02-10 18:57 UTC (permalink / raw
  To: gentoo-embedded

G'day,

I've got a USB boot problem.

My target hardware is a PC/104 card with a Vortex86sx processor and a
128MB DOM (disk-on-module) for mass storage.  

Currently the test version of the card has a 1GB DOM which is
partitioned as follows:

       Device Boot      Start         End      Blocks  Id System
    /dev/hda1   *           1         141      142096+  6 FAT16
    /dev/hda2             142         991      856800  83 Linux

The BIOS boots to the FAT16 partition where ldlinux.sys takes over and
starts linux and all is fine.  

When I insert my USB flash drive, it is recognized as:

    usb 1-1.2: new high speed USB device using ehci_hcd and address 3
    usb 1-1.2: configuration #1 chosen from 1 choice
    scsi0 : SCSI emulation for USB Mass Storage devices
    usb-storage: device found at 3
    usb-storage: waiting for device to settle before scanning

    scsi 0:0:0:0: Direct-Access   SanDisk  Cruzer Micro  0.1  PQ: 0
ANSI: 2
    sd 0:0:0:0: [sda] 2001888 512-byte hardware sectors: (1.02 GB/977
MiB)
    sd 0:0:0:0: [sda] Write Protect is off
    sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
    sd 0:0:0:0: [sda] Assuming drive cache: write through
    sd 0:0:0:0: [sda] 2001888 512-byte hardware sectors: (1.02 GB/977
MiB)
    sd 0:0:0:0: [sda] Write Protect is off
    sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
    sd 0:0:0:0: [sda] Assuming drive cache: write through
     sda: sda1
    sd 0:0:0:0: [sda] Attached SCSI removable disk
    usb-storage: device scan complete

I need to create a rescue/install USB flash drive.  

At present my test flash drive has ldlinux.sys and the same kernel used
by the device.  Booting with "linux root=/dev/hda2" works fine.  However
for rescue purposes I need "linux root=/dev/sda" (or equivalent).

When I boot with "linux root=/dev/sda1", I get the following

    VFS: Cannot open root device "sda1" or unknown-block(0,0)
    Please append a correct "root=" boot option; here are the available
partitions:
    0300      1000944 hda driver: ide-gd
      0301      142096 hda1
      0302      856800 hda2
    Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(0,0)

Evidently /dev/sda1 hasn't yet mounted.  The boot process runs into the
same problem when I use /dev/sda or /dev/sda2 for "root=".

In the past I've seen similar kernel panics when the kernel lacks the
proper disk driver.  Since the system boots fine from the DOM, I believe
my kernel has all the device drivers built in (except scsi_wait_scan.ko
which is a module).

How do I fix the boot problem?  Anybody familiar with this problem and
have a recommendation or, even better, a solution? 

Regards,

David





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-embedded] USB Boot Problem
  2010-02-10 18:57 [gentoo-embedded] USB Boot Problem Relson, David
@ 2010-02-10 19:14 ` Manuel Lauss
  2010-02-10 19:29 ` James Ausmus
  2010-02-10 19:43 ` joerg.faschingbauer
  2 siblings, 0 replies; 7+ messages in thread
From: Manuel Lauss @ 2010-02-10 19:14 UTC (permalink / raw
  To: gentoo-embedded

>    VFS: Cannot open root device "sda1" or unknown-block(0,0)
>    Please append a correct "root=" boot option; here are the available
> partitions:
>    0300      1000944 hda driver: ide-gd
>      0301      142096 hda1
>      0302      856800 hda2
>    Kernel panic - not syncing: VFS: Unable to mount root fs on
> unknown-block(0,0)

Try adding "rootdelay=10" (or more) to the kernel commandline.

Manuel



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-embedded] USB Boot Problem
  2010-02-10 18:57 [gentoo-embedded] USB Boot Problem Relson, David
  2010-02-10 19:14 ` Manuel Lauss
@ 2010-02-10 19:29 ` James Ausmus
  2010-02-10 19:43 ` joerg.faschingbauer
  2 siblings, 0 replies; 7+ messages in thread
From: James Ausmus @ 2010-02-10 19:29 UTC (permalink / raw
  To: gentoo-embedded

On Wed, Feb 10, 2010 at 10:57 AM, Relson, David
<david.relson@orion-sys.com> wrote:
>
> G'day,
>
> I've got a USB boot problem.
>
> My target hardware is a PC/104 card with a Vortex86sx processor and a
> 128MB DOM (disk-on-module) for mass storage.
>
> Currently the test version of the card has a 1GB DOM which is
> partitioned as follows:
>
>       Device Boot      Start         End      Blocks  Id System
>    /dev/hda1   *           1         141      142096+  6 FAT16
>    /dev/hda2             142         991      856800  83 Linux
>
> The BIOS boots to the FAT16 partition where ldlinux.sys takes over and
> starts linux and all is fine.
>
> When I insert my USB flash drive, it is recognized as:
>
>    usb 1-1.2: new high speed USB device using ehci_hcd and address 3
>    usb 1-1.2: configuration #1 chosen from 1 choice
>    scsi0 : SCSI emulation for USB Mass Storage devices
>    usb-storage: device found at 3
>    usb-storage: waiting for device to settle before scanning
>
>    scsi 0:0:0:0: Direct-Access   SanDisk  Cruzer Micro  0.1  PQ: 0
> ANSI: 2
>    sd 0:0:0:0: [sda] 2001888 512-byte hardware sectors: (1.02 GB/977
> MiB)
>    sd 0:0:0:0: [sda] Write Protect is off
>    sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
>    sd 0:0:0:0: [sda] Assuming drive cache: write through
>    sd 0:0:0:0: [sda] 2001888 512-byte hardware sectors: (1.02 GB/977
> MiB)
>    sd 0:0:0:0: [sda] Write Protect is off
>    sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
>    sd 0:0:0:0: [sda] Assuming drive cache: write through
>     sda: sda1
>    sd 0:0:0:0: [sda] Attached SCSI removable disk
>    usb-storage: device scan complete
>
> I need to create a rescue/install USB flash drive.
>
> At present my test flash drive has ldlinux.sys and the same kernel used
> by the device.  Booting with "linux root=/dev/hda2" works fine.  However
> for rescue purposes I need "linux root=/dev/sda" (or equivalent).
>
> When I boot with "linux root=/dev/sda1", I get the following
>
>    VFS: Cannot open root device "sda1" or unknown-block(0,0)
>    Please append a correct "root=" boot option; here are the available
> partitions:
>    0300      1000944 hda driver: ide-gd
>      0301      142096 hda1
>      0302      856800 hda2
>    Kernel panic - not syncing: VFS: Unable to mount root fs on
> unknown-block(0,0)
>
> Evidently /dev/sda1 hasn't yet mounted.  The boot process runs into the
> same problem when I use /dev/sda or /dev/sda2 for "root=".
>
> In the past I've seen similar kernel panics when the kernel lacks the
> proper disk driver.  Since the system boots fine from the DOM, I believe
> my kernel has all the device drivers built in (except scsi_wait_scan.ko
> which is a module).
>
> How do I fix the boot problem?  Anybody familiar with this problem and
> have a recommendation or, even better, a solution?

It's likely that the kernel hasn't fully recognized your USB device
yet (notice the "usb-storage: waiting for device to settle before
scanning" dmesg line?)

Try appending the "rootwait" kernel parameter (kernel waits forever
for the root device to show up), or the "rootdelay=" parameter
(argument is number of seconds to wait). Further information about
these and other related kernel params are in the kernel source tree
under Documentation/kernel-parameters.txt


HTH-

James


>
> Regards,
>
> David
>
>
>



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-embedded] USB Boot Problem
  2010-02-10 18:57 [gentoo-embedded] USB Boot Problem Relson, David
  2010-02-10 19:14 ` Manuel Lauss
  2010-02-10 19:29 ` James Ausmus
@ 2010-02-10 19:43 ` joerg.faschingbauer
  2010-02-10 21:37   ` [gentoo-embedded] USB progress [ was: USB Boot Problem ] David Relson
  2 siblings, 1 reply; 7+ messages in thread
From: joerg.faschingbauer @ 2010-02-10 19:43 UTC (permalink / raw
  To: gentoo-embedded, david.relson

>>>>> "David" == Relson, David <david.relson@orion-sys.com> writes:

David> When I boot with "linux root=/dev/sda1", I get the following

David>     VFS: Cannot open root device "sda1" or unknown-block(0,0)
David>     Please append a correct "root=" boot option; here are the available
David> partitions:
David>     0300      1000944 hda driver: ide-gd
David>       0301      142096 hda1
David>       0302      856800 hda2
David>     Kernel panic - not syncing: VFS: Unable to mount root fs on
David> unknown-block(0,0)

David> Evidently /dev/sda1 hasn't yet mounted.  The boot process runs into the
David> same problem when I use /dev/sda or /dev/sda2 for "root=".

David> In the past I've seen similar kernel panics when the kernel lacks the
David> proper disk driver.  Since the system boots fine from the DOM, I believe
David> my kernel has all the device drivers built in (except scsi_wait_scan.ko
David> which is a module).

David> How do I fix the boot problem?  Anybody familiar with this problem and
David> have a recommendation or, even better, a solution? 

You might want to pass "rootdelay=5" (seconds), or "rootwait" for
newer kernels (don't know when the latter was introduced).

Joerg



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [gentoo-embedded] USB progress [ was: USB Boot Problem ]
  2010-02-10 19:43 ` joerg.faschingbauer
@ 2010-02-10 21:37   ` David Relson
  2010-02-10 22:12     ` Manuel Lauss
  0 siblings, 1 reply; 7+ messages in thread
From: David Relson @ 2010-02-10 21:37 UTC (permalink / raw
  To: gentoo-embedded

On Wed, 10 Feb 2010 20:43:44 +0100 (CET)
joerg.faschingbauer@aon.at wrote:

> >>>>> "David" == Relson, David <david.relson@orion-sys.com> writes:
> 
> David> When I boot with "linux root=/dev/sda1", I get the following
> 
> David>     VFS: Cannot open root device "sda1" or unknown-block(0,0)
> David>     Please append a correct "root=" boot option; here are the
> David> available partitions:
> David>     0300      1000944 hda driver: ide-gd
> David>       0301      142096 hda1
> David>       0302      856800 hda2
> David>     Kernel panic - not syncing: VFS: Unable to mount root fs on
> David> unknown-block(0,0)
> 
> David> Evidently /dev/sda1 hasn't yet mounted.  The boot process runs
> David> into the same problem when I use /dev/sda or /dev/sda2 for
> David> "root=".
> 
> David> In the past I've seen similar kernel panics when the kernel
> David> lacks the proper disk driver.  Since the system boots fine
> David> from the DOM, I believe my kernel has all the device drivers
> David> built in (except scsi_wait_scan.ko which is a module).
> 
> David> How do I fix the boot problem?  Anybody familiar with this
> David> problem and have a recommendation or, even better, a solution? 
> 
> You might want to pass "rootdelay=5" (seconds), or "rootwait" for
> newer kernels (don't know when the latter was introduced).
> 
> Joerg

Thanks to Manuel, James, and Joerg.  All 3 of you suggested
rootdelay.  It helps but isn't a complete solution.

My syslinux.cfg now contains:

    LABEL linux
    KERNEL linux
    APPEND rootdelay=10 root=/dev/sda1

and is working better than before.

After SCSI messages:

    sd 0:0:0:0: [sda] Write Protect is off
    sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
    sd 0:0:0:0: [sda] Assuming drive cache: write through
     sda: sda1
    sd 0:0:0:0: [sda] Attached SCSI removable disk

The boot process fails with:

    VFS: Mounted root (vfat filesystem) readonly on device 8:1
    Freeing unused kernel memory: 176k freed
    Warning: unable to open an initial console
    Kernel panic - not syncing: No init found.  Try passing init=
    option to kernel

Clearly the wait is helping since 'vfat' and '8:1' are correct.  The
"init=" suggestion is puzzling.  The default boot (from the built-in
DOM) uses the following syslinux.cfg:

    DEFAULT linux

    LABEL linux
    KERNEL linux
    APPEND root=/dev/hda2

there's no "init=" in it.  Also, /etc/init.d just contains a single
script (named rcS) which does all the initialization.  There are no run
levels. FWIW, I'm using a 2.6.29.6 kernel.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-embedded] USB progress [ was: USB Boot Problem ]
  2010-02-10 21:37   ` [gentoo-embedded] USB progress [ was: USB Boot Problem ] David Relson
@ 2010-02-10 22:12     ` Manuel Lauss
  2010-02-11  0:51       ` Peter Stuge
  0 siblings, 1 reply; 7+ messages in thread
From: Manuel Lauss @ 2010-02-10 22:12 UTC (permalink / raw
  To: gentoo-embedded

On Wed, Feb 10, 2010 at 10:37 PM, David Relson <relson@osagesoftware.com> wrote:
> On Wed, 10 Feb 2010 20:43:44 +0100 (CET)
> joerg.faschingbauer@aon.at wrote:
>
>> >>>>> "David" == Relson, David <david.relson@orion-sys.com> writes:

>    VFS: Mounted root (vfat filesystem) readonly on device 8:1
>    Freeing unused kernel memory: 176k freed
>    Warning: unable to open an initial console
>    Kernel panic - not syncing: No init found.  Try passing init=
>    option to kernel
>
> Clearly the wait is helping since 'vfat' and '8:1' are correct.  The
> "init=" suggestion is puzzling.  The default boot (from the built-in
> DOM) uses the following syslinux.cfg:
>
>    DEFAULT linux
>
>    LABEL linux
>    KERNEL linux
>    APPEND root=/dev/hda2
>
> there's no "init=" in it.  Also, /etc/init.d just contains a single
> script (named rcS) which does all the initialization.  There are no run
> levels. FWIW, I'm using a 2.6.29.6 kernel.

Oh, vfat, missing permission bits:   try adding "rootflags=umask=0"
(I assume you do have a /sbin/init binary on this device).

Better yet format it with a filesystem wich does unix permissions.

Manuel



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-embedded] USB progress [ was: USB Boot Problem ]
  2010-02-10 22:12     ` Manuel Lauss
@ 2010-02-11  0:51       ` Peter Stuge
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Stuge @ 2010-02-11  0:51 UTC (permalink / raw
  To: gentoo-embedded

Manuel Lauss wrote:
> Better yet format it with a filesystem wich does unix permissions.

Or add an initramfs and a filesystem image mounted via loopback.


//Peter



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-02-11  1:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-10 18:57 [gentoo-embedded] USB Boot Problem Relson, David
2010-02-10 19:14 ` Manuel Lauss
2010-02-10 19:29 ` James Ausmus
2010-02-10 19:43 ` joerg.faschingbauer
2010-02-10 21:37   ` [gentoo-embedded] USB progress [ was: USB Boot Problem ] David Relson
2010-02-10 22:12     ` Manuel Lauss
2010-02-11  0:51       ` Peter Stuge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox