All of lore.kernel.org
 help / color / mirror / Atom feed
* How do I tell when a USB disk is ready?
@ 2011-10-25  0:10 Chris Tapp
  2011-10-25  8:45 ` Gary Thomas
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Tapp @ 2011-10-25  0:10 UTC (permalink / raw)
  To: yocto

I've got a minimal root file system that will be used to install a  
poky image from a USB stick.

The init script this uses mounts sda1 (from where it's just booted),  
but sda1 isn't ready when it tries to do this - I can see the bus  
enumeration messages on the console after the mount fails.

How can my script test to see when the device is ready?

Chris Tapp

opensource@keylevel.com
www.keylevel.com





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

* Re: How do I tell when a USB disk is ready?
  2011-10-25  0:10 How do I tell when a USB disk is ready? Chris Tapp
@ 2011-10-25  8:45 ` Gary Thomas
  2011-10-25 12:32   ` Chris Tapp
  0 siblings, 1 reply; 3+ messages in thread
From: Gary Thomas @ 2011-10-25  8:45 UTC (permalink / raw)
  To: Chris Tapp; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 720 bytes --]

On 2011-10-24 18:10, Chris Tapp wrote:
> I've got a minimal root file system that will be used to install a poky image from a USB stick.
>
> The init script this uses mounts sda1 (from where it's just booted), but sda1 isn't ready when it tries to do this - I can see the bus enumeration messages on the console after the
> mount fails.
>
> How can my script test to see when the device is ready?

You could try looking for /dev/sda1 in /proc/partitions like in
attached script.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

[-- Attachment #2: wd --]
[-- Type: text/plain, Size: 147 bytes --]

#! /bin/sh

while ! grep -q sdc1 /proc/partitions; do
      echo "... waiting for disk"
      sleep 1
done
echo "Disk /dev/sdc1 is ready"


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

* Re: How do I tell when a USB disk is ready?
  2011-10-25  8:45 ` Gary Thomas
@ 2011-10-25 12:32   ` Chris Tapp
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Tapp @ 2011-10-25 12:32 UTC (permalink / raw)
  To: yocto

On 25 Oct 2011, at 09:45, Gary Thomas wrote:

> On 2011-10-24 18:10, Chris Tapp wrote:
>> I've got a minimal root file system that will be used to install a  
>> poky image from a USB stick.
>>
>> The init script this uses mounts sda1 (from where it's just  
>> booted), but sda1 isn't ready when it tries to do this - I can see  
>> the bus enumeration messages on the console after the
>> mount fails.
>>
>> How can my script test to see when the device is ready?
>
> You could try looking for /dev/sda1 in /proc/partitions like in
> attached script.

Thanks Gary, that's just what's needed :-)

Chris



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

end of thread, other threads:[~2011-10-25 12:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-25  0:10 How do I tell when a USB disk is ready? Chris Tapp
2011-10-25  8:45 ` Gary Thomas
2011-10-25 12:32   ` Chris Tapp

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.