LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   unable to install grub.. (https://www.linuxquestions.org/questions/debian-26/unable-to-install-grub-680572/)

mahi 11-02-2008 12:42 AM

unable to install grub..
 
hello people...
I've a problem installing grub..
I've two windows and debian.
each time i reinstall windows grub gets lost and attempts to install grub always fail..
I've tried both from "install grub menu" and grub-install command at command prompt....
this forces me to re-install whole linux again...
can anyone please guide how to install grub for debian.???

tommcd 11-02-2008 01:02 AM

Here is a tutorial for reinstalling grub in Debian:
http://wiki.debian.org/GrubRecover?highlight=%28grub%29

Here is another:
http://www.cyberciti.biz/tips/restor...ot-loader.html
To mount your Debian partition, you can just mount it as explained in this tutorial, instead of the way it says in the Nix-Craft article:
http://www.linuxquestions.org/questi...rge-cd-265867/

You can also try the Super Grub Disk to recover grub. It works well:
http://www.supergrubdisk.org/

And for everything you would ever want to know about grub:
http://users.bigpond.net.au/hermanzone/p15.htm

hulk321 11-02-2008 06:56 AM

Quote:

Originally Posted by tommcd (Post 3328811)
Here is a tutorial for reinstalling grub in Debian:
http://wiki.debian.org/GrubRecover?highlight=%28grub%29

I was using F9 and have installed vista and have lost the grub. would this link work for F9 too? if not please recommend me step by step method.

pixellany 11-02-2008 07:11 AM

Installing GRUB is pretty much the same for any Linux distro. The main thing to remember is that the boot code in the MBR (GRUB Stage1) gets "hard-coded" to point to the partition containing the GRUB files (in /boot/grub). You can install GRUB from any Linux, including from a live CD, but you have to be sure that the "/boot/grub" partition is correctly identified.

I have alwasy followed the recommendation in the GRUB manual and installed from the GRUB shell (not grub-install).
First, run fdisk -l to be sure how the drives and partitions are seen from the Linux you are running to install GRUB. In the example below, the desired /boot/grub partition is the 2nd partition on the first drive (eg sda2), and the MBR boot code will go into the first drive (eg sda).
Also note that GRUB counts from 0 (drive 1 is hd0)

To install GRUB:
Code:

grub    #starts the GRUB shell
root (hd0,1)  #sets up the pointer to /boot/grub
setup (hd0)  #installs GRUB to the MBR of drive 1

finally, edit the config file (/boot/grub/menu.lst) as required.

The "booting" link in my sig below may help also.

tommcd 11-02-2008 09:09 PM

Here is another tutorial for installing grub to the MBR using the Ubuntu live CD. This tutorial explains the process a bit more. As Pixellany said, you should be able to do this from any live CD:
http://ubuntuforums.org/showthread.p...highlight=fsck


All times are GMT -5. The time now is 04:52 PM.