Re: How do I make mount wait for modules to load

From: Dances With Crows (danceswithcrows_at_usa.net)
Date: 07/16/03


Date: 16 Jul 2003 19:04:51 GMT

On Wed, 16 Jul 2003 18:27:09 GMT, JD staggered into the Black Sun and
said:
> Hi all, I'm having some issues with mounting a USB flash drive at boot
> time.

"Issues"? Fucking euphemisms. A *problem* won't go away because you
refer to it as a fucking "issue".

> rc.modules is being run from rc.S, and all the appropriate modules are
> being loaded to support my device. Further down in rc.S I attempt to
> mount the drive ("mount -t umsdos /dev/sda1 /cnf"), but the modules
> aren't finished loading yet and the mount fails with "mount special
> device /dev/sda1 does not exist".

Why does it needed to be mounted at boot time? Unless the device is
guaranteed to be there, it shouldn't be mounted at boot. USB devices,
since they're not permanently attached to their hosts in most
circumstances, should not be mounted at boot time.

> If I do something ugly like put in a "sleep 5" after running
> rc.modules, the mount works, but I want to do this in a more elegant
> way, because boot time is critical for this project and I can't afford
> to waste seconds

If you have full control over the hardware, you know nobody's going to
be plugging anything weird in, and you can guarantee that the USB device
will be present at boot time, why not just build USB core support, USB
chipset support, and USB Mass Storage support into the kernel? No need
to wait for module loading then. If this is some sort of embedded
device, you already know what's going to be present in terms of
hardware, so use that knowledge to your advantage.

> But this still doesn't work because mount doesn't wait for the module
> to finish loading before trying to mount the device.

Or mount the device later on, manually, via the Slack equivalent of
/etc/init.d/local ?

> I suppose I can write a script that waits for the device to show up in
> /proc/scsi/scsi before doing the mount, but I was hoping for something
> more automatic.

If timing is so critical that 5 extra seconds of boot time kills the
project, forget elegance. Try compiling the junk you need into the
kernel first, then write that script that polls /proc/scsi/scsi .

-- 
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin / 
http://www.brainbench.com     /  "He is a rhythmic movement of the
-----------------------------/    penguins, is Tux." --MegaHAL