Setting GRUB after re-installing windows

Discussion regarding the installation and configuration of Linux distributions.
Post Reply
Ahmad ullah
Lance Naik
Posts: 28
Joined: Fri Sep 28, 2007 12:29 pm
Location: Quetta
Contact:

Setting GRUB after re-installing windows

Post by Ahmad ullah »

Dear Brothers/sisters
Assa lamo Alaikum WW.
Hope you all are fine and living a life of comfort. As usual, i come here and past some lines describing the problem which i face recently. Today, as usual, i have faced one problem and hope you will never hesitate to help me in this prob as well for which i shall be thankfull for ever.
The problem is:
How to set GRUB to show multiple Operating Systems when windows OS is reinstalled and Linux still exists on the Hard drive? I had both linux and wondows and the GRUB used to give me the choice of the Operating System, now after reinstalling windows, windows starts by default and The window for GRUb is even not shown. How to solve this problem?

Thanks for your your help.
What is not possible is not impossible!

Ahmad achakzai BUITEMS
03342430905
mudasir
Captain
Posts: 565
Joined: Tue Oct 17, 2006 5:23 am
Location: Dubai
Contact:

Post by mudasir »

AOA,

Dear Ahmed Ullah,

Boot with Linux CD and go in to the LINUX RESCUE mode. Type the command.

/sbin/grub-install /dev/hda

(Replace HDA with you Master drive, dont enter any number like HDA1 or HDA2.)
Kind Regards
Mudasir Mirza (RHCE)
(+971)55-1045754
http://www.crystalnetworks.org
http://www.diglinux.com
Ahmad ullah
Lance Naik
Posts: 28
Joined: Fri Sep 28, 2007 12:29 pm
Location: Quetta
Contact:

further explaination

Post by Ahmad ullah »

Dear mudasir!
Can you ( or some other brother ) explain the line:
(Replace HDA with you Master drive, dont enter any number like HDA1 or HDA2.)

in alittle more details, because i did not understand (dont enter any number like HDA1 or HDA2) which could mean " i should not use capital letters" or some thing else. I think the installation of Linux on my system is on hda0. should i give that?
What is not possible is not impossible!

Ahmad achakzai BUITEMS
03342430905
geoaxis
Cadet
Posts: 1
Joined: Wed Dec 29, 2004 10:33 am
Location: Islamabad
Contact:

How to reinstall grub on MBR

Post by geoaxis »

Don't take this the wrong way.

-Please don't write stories, people who want to help you are not here for your prayers and to know how your day went. Just straight away describe your problem.

Your problem is very simple. When you reinstalled Windows, you overwrote your MBR, Assuming that your linux installation is still intact, do what mudasir suggested. Boot from a Live CD.

and then follow steps from the section titled
Alternative: Setting up GRUB using manual instructions

on http://www.gentoo.org/doc/en/handbook/h ... #doc_chap2

I am not sure if grub-install as mentioned would be present in every linux distro, but the way i mentioned can be done from any system with grub.
x2oxen
Major General
Posts: 1114
Joined: Wed Aug 22, 2007 3:17 pm
Location: Faisalabad
Contact:

Post by x2oxen »

your mbr overwritten when you re-installed windows so you need to reinstall grub boot loader just follow mudassir's instruction and restore your grub
Muhammad Usman
+92-321-6640501
Chemonics International
http://usmanpk.com
hamidabrar
Lance Naik
Posts: 31
Joined: Thu May 10, 2007 2:29 pm
Location: Saudi Arabia (Dammam)
Contact:

Same case

Post by hamidabrar »

Dear All

ihave same case, sorry to admin, by mistake i have started an other thred.
i did same as firends suggest me and Mr. Ahmad, but when i am trying to install grub, get failure.
i have installed linux again, but want to know how to recover/reinstall bootloader(grub). how can i practice for boot loader installation but dont want to destroy my linux box.

thanks all guys
I want to be a Master not JAck
x2oxen
Major General
Posts: 1114
Joined: Wed Aug 22, 2007 3:17 pm
Location: Faisalabad
Contact:

Post by x2oxen »

About other thread you can delete it.

And about your grub re-installation practice you can use vmware or virtual pc .
Muhammad Usman
+92-321-6640501
Chemonics International
http://usmanpk.com
hamidabrar
Lance Naik
Posts: 31
Joined: Thu May 10, 2007 2:29 pm
Location: Saudi Arabia (Dammam)
Contact:

its working.

Post by hamidabrar »

Dear All
i have reinstalled/recored my bootloader
using these commands/step one my Linux Guru suggest.

Step 1:

Boot from the same version Linux CD 1 i.e if you want to recover redhat 9 then redhat 9 CD 1 will be used.
At the time when we enter to start installation. Before enter type linux rescue. Then you will be booting in rescue mode. You will find your typing at the end of the screen like

Boot: linux rescue

Step 2:

Press OK for both keyboard and language configuration, if it ask to start network interface just skip it.

Step 3:

After configuring the keyboard and language it will then prompt you the message which summary is that resccue mode will going to find your linux what you want to do. Press CONTINUE

Step 4:

After pressing CONTINUE it will give you message that it finds your linux press OK. (Note if it says that it did'nt find your linux then you deleted your linux).

Step 5:

After pressing OK you will get prompt and enter the following commands to get back your bootloader

# chroot /mnt/sysimage
# /sbin/grub-install /dev/hda (note: there is a space between /sbin/grub-install and /dev/hda)
# exit
# exit
_________________
I want to be a Master not JAck
I want to be a Master not JAck
mudasir
Captain
Posts: 565
Joined: Tue Oct 17, 2006 5:23 am
Location: Dubai
Contact:

Post by mudasir »

AOA,

Dear

I think this is what i suggested in my first post
Boot with Linux CD and go in to the LINUX RESCUE mode. Type the command.

/sbin/grub-install /dev/hda

(Replace HDA with you Master drive, dont enter any number like HDA1 or HDA2.)
Kind Regards
Mudasir Mirza (RHCE)
(+971)55-1045754
http://www.crystalnetworks.org
http://www.diglinux.com
ghulam yaseen
Naik
Posts: 68
Joined: Thu Aug 07, 2008 6:09 pm
Location: karachi

Yaseen

Post by ghulam yaseen »

Hello :) ,

This means that you want the master boot record(hda) of your hard disk to fetch grub.conf instead of hda1 or hda2.
-----------------
/sbin/grub-install /dev/hda

(Replace HDA with you Master drive, dont enter any number like HDA1 or HDA2.)
-----------------
I hope that you understood the point.
8)
Post Reply