Grub hangs at "Starting up ..." when USB flash card reader is plugged in (on Ubuntu Hardy)

1

I have a PC with Ubuntu Hardy installed. The machine boots fine unless my USB flash card reader (one of those N-in-1 readers by MediaGear) is plugged in at startup. If the reader is plugged in, the boot process proceeds as normal until it gets to the screen that says "Starting up ...". At that point it just hangs forever.

To work around this I currently leave the reader unplugged when booting, and then plug it back in after I see that Ubuntu is actually starting. This is annoying though, especially when I reboot the machine (typically for updates), forget to unplug the reader, and walk away only to come back hours later to find the machine hung.

My guess is that the presence of the reader is confusing Grub about where to find the kernel. The weird thing is that Grub is on the same drive as the kernel I want it to boot so clearly the drive is still readable even when the flash card reader is plugged in. Is there some way I can tell Grub to never go looking on the flash card reader?

Laurence Gonsalves

Posted 2010-03-19T19:48:22.290

Reputation: 5 021

>

  • can you post the relevant sections of your menu.lst? 2) when this happens, is there a card in the reader? 3) at the Grub prompt, what devices are seen? (just type "root " or another command and hit TAB to get the auto-completion list.) 4) what are the contents of /boot/grub/device.map?
  • < – quack quixote – 2010-03-19T20:17:53.500

    (Un)fortunately, I am no longer able to reproduce this problem. It mysteriously went away. I've also since upgraded to Lucid. – Laurence Gonsalves – 2010-08-02T18:55:05.650

    Answers

    0

    I suspect you're catching a conflict between your system hard drive and the card reader. Grub boots and finds its configuration OK because the BIOS properly boots from the hard drive. But, then Grub enumerates the drive devices, and the flash card reader gets the devicename that the hard drive should be getting. So when Grub goes to boot the OS, it's looking at the wrong device.

    If this is the correct diagnosis, you can fix it manually, in the Grub menu, by editing the boot entry like this. At the Grub menu, select the kernel to boot, and press E. If your boot entry says:

    title           Ubuntu, kernel 2.6.20-15-generic
    root            (hd0,1)
    kernel          /boot/vmlinuz-2.6.20-15-generic root=UUID=3630dd43-f9f9-40b1-8a5f-72c13f2b309c ro quiet splash
    initrd          /boot/initrd.img-2.6.20-15-generic
    quiet
    savedefault
    

    ... you'll need to change the root line to point to the real device:

    root            (hd1,1)
    

    This may take some trial-and-error, or as I mentioned in the comment, playing around with Grub's command line to see what devices it detects. The correct device will be hdX, where X is some number (you shouldn't need to change the partition number, just the X). That should allow you to boot correctly, but you'll have to undertake those manual steps each time.

    Fixing it permanently may require adding a line for the flash card device to your /boot/grub/device.map file, or creating one if it doesn't exist. Alternately, if you'll leave this device connected permanently, you can tweak your boot entries in /boot/grub/menu.lst to point to the new device.

    If you'll post your configuration files along with what devices Grub sees, we can probably assist further.

    quack quixote

    Posted 2010-03-19T19:48:22.290

    Reputation: 37 382

    As mentioned above, the problem mysteriously went away, but I've accepted this answer since it seems reasonable... :-) – Laurence Gonsalves – 2010-08-02T18:55:53.993

    0

    Change the BIOS boot order to something closer to what you would expect. Hard drives first, then other devices. Seems that the hard drive mapping (hd#) to physical device mapping occurs when the BIOS inits.

    Richard Tx

    Posted 2010-03-19T19:48:22.290

    Reputation: 1