Bug 472657 - RAID/LVM unable to use USB disk because device not (yet) stabilized
RAID/LVM unable to use USB disk because device not (yet) stabilized
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Kernel Maintainer List
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-11-22 18:54 EST by Dr. Tilmann Bubeck
Modified: 2009-12-18 01:55 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-12-18 01:55:31 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
rc.sysinit patch to wait for devices to become available (1.28 KB, patch)
2009-01-16 11:08 EST, Andrew J. Schorr
no flags Details | Diff
patch to /etc/rc.d/init.d/halt and /etc/rc.d/rc.sysinit to wait for disks (2.54 KB, patch)
2009-01-16 19:39 EST, Andrew J. Schorr
no flags Details | Diff
patch to /etc/rc.d/init.d/halt and /etc/rc.d/rc.sysinit to wait for disks (2.65 KB, patch)
2009-01-17 10:37 EST, Andrew J. Schorr
no flags Details | Diff

  None (edit)
Description Dr. Tilmann Bubeck 2008-11-22 18:54:25 EST
Description of problem:
I'm using a EEE-PC 901 with an SD card as a part of a larger RAID. This SD card is connected via USB and is normally /dev/sdb. When rc.sysinit tries to build the RAID using "mdadm -As .." this device is not yet available. Inserting a "sleep 10" fixes this problem.

A better solution could be to use "stabilize" from nash as initrd does.

Version-Release number of selected component (if applicable):

How reproducible:
Use SD card on EEE to use as part of RAID.

Steps to Reproduce:
1. Insert SD
2. Configure RAID to use SD
3. boot and watch mdadm fail
Actual results:
RAID unavailable

Expected results:
RAID available

Additional info:
Comment 1 Bill Nottingham 2008-11-24 14:19:21 EST
We already run udevsettle - if that's not enough, we need better infrastructure in the kernel.
Comment 2 Bug Zapper 2008-11-26 00:48:14 EST
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
Comment 3 Chuck Ebbert 2008-11-26 17:35:09 EST
There will never be infrastructure in the kernel to predict whether disks will appear sometime in the fiture.
Comment 4 Bill Nottingham 2008-12-01 10:52:07 EST
All we ask is some way to know that the *initial* scan (done on driver init) has finished.
Comment 5 Andrew J. Schorr 2009-01-15 15:06:48 EST
I think I'm having a similar problem.  The root filesystem is on
an IDE disk, and I have 2 external USB disks forming a raid 1 array.
The mdadm assemble command in rc.sysinit is failing because the
kernel does not see the devices yet.

I patched rc.sysinit to wait for the needed devices to appear
in /proc/partitions before mdadm is called (just loop while grepping
for the devices, with sleep 1 in between).  This works for me,
but is a hack because I have to specify the device names to seek
in /proc/partitions.  Perhaps there should be something in
/etc/sysconfig/mdadm that gives a list of devices to wait for
before calling mdadm in rc.sysinit?  Of course, this has a risk
of hanging, so a timeout (10 seconds?) would be needed.  In
my case, it just needs to wait a couple of seconds for the
devices to appear in /proc/partitions.

Should I bother to submit a patch, or is this a horrendous idea?
Comment 6 Andrew J. Schorr 2009-01-15 15:28:46 EST
On 2nd thought, that idea was a bit premature.  Presumably we
don't want to be dependent on the partition (device) names, so perhaps
we can wait for certain device UUIDs to appear before proceeding?
And I guess this is not necessarily just an mdadm issue,
since somebody could simply want to mount a (non-RAID) USB
device in /etc/fstab.  So perhaps there could be a list somewhere
in /etc/sysconfig of UUIDs to wait for before proceeding?
Comment 7 Andrew J. Schorr 2009-01-16 11:08:31 EST
Created attachment 329218 [details]
rc.sysinit patch to wait for devices to become available

This is a patch to /etc/rc.d/rc.sysinit to enable it to wait
for devices such as USB disks to become available.  It works
with a config file called /etc/sysconfig/devwait that might
look like this:

bash$ cat /etc/sysconfig/devwait 

This gives a list (numbered from 1 through $DEVWAIT_NUM) of UUIDs
to wait for (and a count for each UUID, since mdadm RAID 1 arrays
seem to use the same UUID for both partitions).  It waits up
to $DEVWAIT_TIMEOUT seconds for the devices to appear.

Is this at all useful?  It works for me...

Comment 8 Bill Nottingham 2009-01-16 17:10:58 EST
It's not very generic, so I don't see it being integrated upstream. It's certainly a workaround that can work for some people, though.
Comment 9 Andrew J. Schorr 2009-01-16 17:14:26 EST
OK, thanks for the feedback.  Can you think of a way to make
it more generic?  I thought by searching for UUIDs that it
was a pretty robust and generally applicable approach.

One possible thought that occurred to me was just to wait
for devices that appear in the cached /etc/blkid/blkid.tab
file to appear before proceeding.  That has the advantage
of requiring no configuration, but it gives the admin less
control over the process.  Perhaps combining that with the
existing patch would give the right combination of
ease-of-use plus the power to configure more deterministically
when the admin knows what he's doing?

Comment 10 Andrew J. Schorr 2009-01-16 19:39:49 EST
Created attachment 329266 [details]
patch to /etc/rc.d/init.d/halt and /etc/rc.d/rc.sysinit to wait for disks

The attached patch has the same functionality as the previous one,
plus it has some new features.  When the system is halted, if the
file /etc/sysconfig/devwait exists, then the halt script will
save a list of all disks present at that time in /var/lib/devwait.devices.

At boot time, in rc.sysinit, we will wait for any devices
in /var/lib/devwait.devices as well as any devices that are
specified explicitly in /etc/sysconfig/devwait.

So to get the automatic disk waiting behavior, simply put this in


With this in place, the system will wait up to 30 seconds at boot time
to detect all the disks that were present when it was halted.

This is pretty easy to use.  Any chance of accepting a patch
like this?

Comment 11 Andrew J. Schorr 2009-01-17 10:37:48 EST
Created attachment 329284 [details]
patch to /etc/rc.d/init.d/halt and /etc/rc.d/rc.sysinit to wait for disks

This is a minor change to the previous version to fix some problems
in /etc/rc.d/init.d/halt.  In particular, I hadn't realized
that "blkid -g" always gives a non-zero exit code.  And now
it should display proper status for saving the device list.

If this patch is of any interest, I could clean up the rc.sysinit
portion to use a function with local variables (to avoid polluting
the name space).  It also may make sense to put in some safeguards,
such as an upper limit on the value of DEVWAIT_TIMEOUT (perhaps
5 minutes?).

Comment 12 Bug Zapper 2009-11-18 03:56:26 EST
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
Comment 13 Bug Zapper 2009-12-18 01:55:31 EST
Fedora 10 changed to end-of-life (EOL) status on 2009-12-17. Fedora 10 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.