Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm running linux-3.4.9 compiled with genkernel, and booting from a USB HDD. I was slightly annoyed by the slow boot process, in particular, during the execution of genkernel scripts at the modprobe & mdev stage.

So after having loaded the modules, it seems to wait a fixed amount of time for the devices to initialize. Is there a deep reason for that? Why not just wait until the specific root device becomes available? Or is my understanding of the situation totally incorrect?

share|improve this question
2  
Yes, it wait for 10 seconds, I hate that too. Just modify it yourself –  warl0ck Oct 9 '12 at 1:40
add comment

1 Answer 1

The first thing that must be considered here is that since you are able to boot from USB, it means your PC's BIOS supports booting from a USB device. This in turn means that the BIOS has embedded firmware that includes a USB protocol stack, and can control a target device like a USB HDD over the Universal Serial Bus. After the USB handshake protocol is established between the USB host (the PC that needs to boot) and the USB gadget (USB HDD), the control and data mechanism provided by USB can be abstracted away, and upper layers of the BIOS boot code can treat the USB HDD just like an internal HDD. That is, the first sector of the "disk drive" has to be read in order to obtain its Master Boot Record (MBR).

However some problems like yours start because of some changes made to the way USB initializes.Previously , each usb had a sleeping time of 100ms as a part of the initialization.However, the new usbs' use the delayed work mechanism to schedule the next initialization step 100ms in the future. For kernels which have the USB change built-in, this allows the boot thread to do other work, rather than block waiting for these delays. However, kernels which do not have this functionality took a longer time to boot due to the change of future delay.

share|improve this answer
    
Well, right, the boot thread does other work. According to the genkernel script, it does "sleep 10s". –  Alexander Shamov Oct 9 '12 at 13:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.