IT Community - Software Programming, Web Development and Technical Support

How to restore the GRUB boot loader when you loose the boot sector in a dual boot PC?

This is a discussion on How to restore the GRUB boot loader when you loose the boot sector in a dual boot PC? within the Operating Systems forums, part of the Computer Hardware/Software and Networking category; How to restore the GRUB boot loader when you loose the boot sector in a dual boot PC?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Computer Hardware/Software and Networking > Operating Systems

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-18-2007, 10:42 PM
bluesky bluesky is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 201
bluesky is on a distinguished road
Question How to restore the GRUB boot loader when you loose the boot sector in a dual boot PC?

How to restore the GRUB boot loader when you loose the boot sector in a dual boot PC?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-19-2007, 12:39 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default Re: How to restore the GRUB boot loader when you loose the boot sector in a dual boot

GRUB is the default boot manager in linux. It helps to choose the desired OS to boot on the booting stage.It shows a list of OS, so that we can choose anyone to boot. GRUB is so powerful that can understand the file system without booting the system.

n the dual boot machines, often the windows should be reinstalled because of various reasons. When we do the reinstallation of windows, it erases the GRUB which resides at MBR normally.

So, after re-installing windows, Most of newbies think that we have to re-install linux too. No. No. No. Linux never went out. It is safely in its partition only, until you deleted that partition.

Only the GRUB is washed out by windows. we can recover it easily.

Here are some ways to do it.

Needed Materials:

1. Any LiveCD or Live DVD like ubuntu, knoppix
or
The installation CD of your or any Distro.

Way - 1:

1. Pop in the Live CD, boot from it until you reach the desktop.

2. Open a terminal window or switch to a tty.

3. Type “grub”

4. Type “root (hd0,6)”, or whatever your harddisk + boot partition
numbers are (my /boot is at /dev/sda7, which translates to hd0,6 for
grub).

5. Type “setup (hd0)”, or whatever your harddisk nr is.

6. Quit grub by typing “quit”.

7. Reboot.

Way -2:

1. Boot from a Live CD, like Ubuntu Live, Knoppix, Mepis, or similar.

2. Open a Terminal. Go SuperUser (that is, type “su”). Enter root passwords as necessary.

3. Type “grub” which makes a GRUB prompt appear.

4. Type “find /boot/grub/stage1?. You’ll get a response like “(hd0)” or
in my case “(hd0,3)”. Use whatever your computer spits out for the
following lines.

5. Type “root (hd0,3)”.

6. Type “setup (hd0)”. This is key. Other instructions say to use
“(hd0)”, and that’s fine if you want to write GRUB to the MBR. If you
want to write it to your linux root partition, then you want the number
after the comma, such as “(hd0,3)”.

7. Type “quit”.

8. Restart the system. Remove the bootable CD.

Way - 3:

1. Boot with any live CD (I’ve done it with Knoppix 3.x and Ubuntu)

2. Get a root shell and make a folder (mkdir ubuntu)

3. mount the root (/) partition of ubuntu (e.g. mount /dev/hdb ubuntu if you have two disks)

4. chroot the mounted partition (chroot ubuntu)

5. grub-install /dev/hda

5. Exit the shell

6. Reboot
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Intel or AMD (dual core) ventyra Computer Hardware 2 12-25-2007 07:50 AM
Restore CentOS if crashed $enthil Operating Systems 4 09-12-2007 06:19 AM
Vista - Dual Booting XP with pre-installed bluesky Operating Systems 1 08-17-2007 06:57 AM
Default Boot Device vigneshgets Operating Systems 0 07-18-2007 03:36 AM
Intel's Dual Core juol The Lounge 2 03-14-2007 09:49 PM


All times are GMT -7. The time now is 01:16 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0