Description of problem:
The sleep 8 that mkinitrd used to emit after usb-storage is no longer there,
which makes USB disks unusable for raid, lvm and others. While putting it back
in, it might be nice to introduce it in such a way that it applies to both
usb-storage and sbp2, but the sleep is added after the last of the two if
they're both present.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.Add alias scsi_hostadapter usb-storage to /etc/modprobe.conf
Note that it no longer waits 8 seconds for the USB bus to stabilize before it
brings up raid devices, volume groups et al
FWIW, this is not fixed yet in mkinitrd-5.0.41-3. It looks like the delays in
stabilize are too short. Adding an explicit --interval 1500 next to the
stabilize calls, then rebuilding mkinitrd, fixes it for me.
I noticed today that having USB PVs in the VG that contains the root filesystem
... results in a system that won't boot (FC5). I presume that this bug report
covers that situation as well (?) but haven't make a custom initrd to verify.
Using an external USB drive as a PV in a pinch is a reasonable use case, but
this does not appear to be possible with the standard initrd.
I still need --interval 1500 in the `stabilized' command lines for my external
disks to be brought up in time :-(
It keeps getting worse :-(
I'm no longer sure the --interval is needed with mkinitrd-5.0.46-1, because the
multipath configuration now brought up by default stops raid auto-detection from
finding the raid 1 members in the USB disk, even if it is detected in time :-(
stabilized is utterly broken on mkinitrd-5.0.47-1, it sleeps for hundreds of
seconds! Just try:
echo stabilized / | strace nash
Still broken in 5.1.1-1 :-(
<broken_record>Still broken in mkinitrd-5.1.2-1</broken_record> :-(
This small patch serves as a temporary work-around, but I can't even
install-test these systems with this feature broken :-(
--- /sbin/mkinitrd~ 2006-07-26 15:43:41.000000000 -0300
+++ /sbin/mkinitrd 2006-07-28 17:45:50.000000000 -0300
@@ -1201 +1201 @@
- emit "stabilized /proc/bus/usb/devices"
+ emit "stabilized --iterations 3 --interval 2 /proc/bus/usb/devices"
@@ -1205 +1205 @@
- emit "stabilized /sys/bus/ieee1394/drivers/sbp2"
+ emit "stabilized --iterations 3 --interval 2
Created attachment 133287 [details]
Patch that fixes the bug
The conversion from nanoseconds to microseconds was missing a division by 1000
in udelayspec(). It didn't make sense to convert to usecs just to have it
converted back to timespec in udelay(), and udelay() was doing too much work to
handle EINTR, so I just implemented udelayspec() as a simple loop and
re-implemented udelay() in terms of it, simplifying (and fixing the
off-by-one-usec/sec) the conversion to timespec while at that.
I fixed stabilizedCommand() similarly, and had to also fix stabilizedMtime to
actually use mtime consistently, instead of setting last to the atime and then
comparing it partially with mtime, partially with atime. Without a limit on
iterations, that would never finish.
With this patch, stabilized appears to work.
Thanks, will be in 5.1.7 .