What happened when you installed windows is that windows wrote the windows bootloader to the MBR (Master Boot Record) of the hard disk, where you had grub's first stage. Now you need to re-write grub first state to the MBR.
Question: How do you have your Linux partitioned? Do you have /boot in a seperate partition? If so, try: # grub-install --root-directory=/boot /dev/hda
If not, you could try the older (pre grub-install) set of commands:
1) grub> find /boot/grub/stage1
This will search for the file name `/boot/grub/stage1' and show the
devices which contain the file.
2) grub> root (hd0,0)
NOTE: This is the partition where stage2, menu.lst, and vmlinuz are installed (the location returned by the find command given above).
Stage1 will be installed either in the MBR, or in the boot sector of the OS
partition (see setup instructions 3 paragraphs down).
3) grub> setup (hd0)
This command will install GRUB on the MBR in the first drive. If you
want to install GRUB into the "boot sector" of a partition instead of
the MBR, specify a partition into which you want to install GRUB:
grub> setup (hd0,0)
If you install GRUB into a partition or a drive other than the first
one, you must chain-load GRUB from another boot loader. Refer to the
manual for the boot loader to know how to chain-load GRUB.
4) Grub should now prompt you for the next entriy. Something like:
Run "embed /boot/grub/e2fs_stage1_5 (hd0)"
16 sectors are embedded.
Run "install /boot/grub/stage1 d (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2"
grub>
This will have successfully loaded grub, although it does have a problem. It will not have installed GRUB to use your menu.lst file. The solution to this is simple. Since GRUB has now provided you with all the necessary options for the stage1, 1.5 and 2 installation, simply duplicate the following portion of the last line:
install /boot/grub/stage1 d (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2
and add (hd0,0)/boot/grub/menu.lst to the end so that the line would read:
install /boot/grub/stage1 d (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 (hd0,0)/boot/grub/menu.lst
This will install GRUB so that it uses the /boot/grub/menu.lst file for your boot options. Note that the install lines shown above are all on one line, although they may wrap due to length as they did in the formatting of this document.
Once this is completed, type quit to exit the GRUB menu, and restart your system.
Sources: Grub Manual and Zen and the Art of Using Grub.
Last edited by bigrigdriver; 09-20-2005 at 05:11 PM.
|