[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: wait for the boot device



Ferenc Wagner <wferi@niif.hu> writes:

> md@Linux.IT (Marco d'Itri) writes:
>
>> On Mar 22, Ferenc Wagner <wferi@niif.hu> wrote:
>>
>>> I really hoped you'd provide some pointers how to attack this best, or
>>
>> I have never used this feature. If you are not totally sure about what
>> you are doing please refrain from dumping a probable grave bugs generator
>> on me... :-)
>
> I'm pretty sure it won't cause any harm, but will recheck with the
> kernel guys.
>
>>> if [ -d /sys/bus/scsi ]; then
>>
>> If you do this before udevadm settle, you have a race.
>
> Thanks.  Then I guess I'll have to put this after, and do another
> udevadm settle afterwards, just like in the separate script.

So I'm back again, with the below patch running fine on a couple of
our production machines for a couple of months now.  Please consider
incorporating it in some form.

Thanks,
Feri.

--- /usr/share/initramfs-tools/scripts/init-premount/udev	2009-04-15 23:05:42.000000000 +0200
+++ udev	2009-06-04 17:31:05.919424375 +0200
@@ -20,6 +20,14 @@
 udevadm trigger
 udevadm settle || true
 
+if [ -d /sys/bus/scsi ]; then
+	echo -n "Waiting for SCSI scan ..."
+	modprobe scsi_wait_scan
+	modprobe -r scsi_wait_scan
+	udevadm settle || true
+	echo " SCSI scan finished."
+fi
+
 # If the rootdelay parameter has been set, we wait a bit for devices
 # like usb/firewire disks to settle.
 if [ "$ROOTDELAY" ]; then


Reply to: