LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to reinstall grub after windows instln (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-reinstall-grub-after-windows-instln-845303/)

nkd 11-19-2010 07:43 AM

how to reinstall grub after windows instln
 
hi all,
I had a dual boot system - windows in primary active /dev/sda1 and fedora in /dev/sda5 onwards till /dev/sda7 ( /boot, / and swap partitions).
I reinstalled windows vista and it removed grub and replaced it with the MBR or windows loader.So now I can't boot into the linux OS.
I tried out a live cd and tried
grub-install --root-directory=/mnt/_boot /dev/sda
(after mounting /boot partition at /mnt/_boot location from the live cd.)
But on reboot I donot get the menu.lst options, only the black screen with a grub prompt.
Can someone help me how to reinstate the grub loader from the /boot partition i.e /dev/sda5.
thanks in advance
nishtih

divyashree 11-19-2010 07:56 AM

In the black grub prompt,

Quote:

grub> find /boot/grub/stage1

(hd0,4)
Go on typing:

Quote:

grub> root (hd0,4)
You will get a system response like “(hd0,4)” or "(hd0,5)” something like this

Quote:

grub> setup (hd0,4)
The final command let you exit the grub shell:

grub> quit

Now reboot the system and remove the bootable live media.

divyashree 11-19-2010 07:57 AM

Or you can run into rescue mode from the fedora cd,

then in the command mode

Quote:

chroot /mnt/sysimage
grub-install /dev/sda

nkd 11-19-2010 12:40 PM

thanks
the fedora cd stuff worked like a charm
bye
nishith


All times are GMT -5. The time now is 11:40 PM.