[lug] How to recover after installing Broken Grub?

David L. Anselmi anselmi at anselmi.us
Thu Jul 19 17:12:51 MDT 2007


siegfried wrote:
[...]
> Well, now I cannot boot windows. With the default BIOS settings, it tries to
> boot from the USB drive first and that fails. So I go to the BIOS and tell
> it not to boot from removable devices and try again. GRUB comes up but does
> not list the windows partition -- only the debian partition on the USB
> drive.

So you really wanted grub installed on the USB drive, not the internal 
drive.  Windows probably has a way to fix that from the install disk. 
And there's a way to tell grub at boot time to use the Windows 
partition, look at the grub docs.

> So I try to boot from the debian partition and it says 
> 
> ALERT! /dev/mapper/sheintze-vpn-hp-root does not exist. Dropping into shell.
> BusyBox v1.1.13 (debian 1:1.1.3-4) Built in shell (ash)
> Enter 'Help' for a list of built-in commands.

Seems like you're using LVM (grub doesn't boot LVM partitions).  But it 
looks like grub loaded the kernel, the initrd ran, and failed to mount 
the root partition.

Rebuilding the initrd should fix it, if you can get into the system. 
You can probably boot from a live CD, mount up everything on the USB 
drive correctly (or at least root and boot), chroot into it and then run 
update-initramfs.

You can't really fix it from the boot prompt the initrd leaves you in 
because you need to set up LVM and then pivot-root into your root 
partition.  I don't know how to run pivot-root by hand (but maybe it can 
be done).

> Should I be able to edit the GRUB settings so it can boot windows without
> the USB drive attached? I hope so. Otherwise, I will want to remove GRUB and
> I don't know how to do that. How do I do that?

Yes, you can do that in the grub config, or at the command line during 
boot.  The easy way to remove grub is:

dd if=/dev/zero of=/dev/hda bs=512 count=1

(change hda to your hard drive device).  Or put back the Windows MBR.

> ls tells me there is a /dev directory but no /dev/mapper directory.

/dev/mapper is made by the dm-mod module, I think.

Dave




More information about the LUG mailing list