All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gary Thomas <gary@mlbassoc.com>
To: Chris Tapp <opensource@keylevel.com>
Cc: yocto@yoctoproject.org
Subject: Re: How do I tell when a USB disk is ready?
Date: Tue, 25 Oct 2011 02:45:29 -0600	[thread overview]
Message-ID: <4EA67729.3090109@mlbassoc.com> (raw)
In-Reply-To: <0E674E98-F46F-467D-B7F2-8066AA03A454@keylevel.com>

[-- 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"


  reply	other threads:[~2011-10-25  8:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-25  0:10 How do I tell when a USB disk is ready? Chris Tapp
2011-10-25  8:45 ` Gary Thomas [this message]
2011-10-25 12:32   ` Chris Tapp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EA67729.3090109@mlbassoc.com \
    --to=gary@mlbassoc.com \
    --cc=opensource@keylevel.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.