restore GRUB after Windows install

DON'T post new tutorials here! Please use the "Pending Submissions" board so the staff can review them first.
Post Reply
User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

restore GRUB after Windows install

Post by bad_brain »

my XP system became buggy (well, more than usual :lol: ) yesterday, so I decided to do a new setup. my main system is a dual OS one with XP and Debian, and of course the new XP install replaced the GRUB bootloader with the Windows one, so it was not possible anymore to boot into Linux.

usually I kill the whole HDD and reinstall both OSs, but this time my Debian system was really well configured (I worked a lot on it in the last time) so I had to restore the GRUB bootloader.
there are different ways to do this, the ones I found were mostly unnecessarily complicated, so I will show how to do it with just a couple of commands:

you need is a Linux Live CD, I used Damn Small Linux for example, and you need to know on which HDD and partition Linux is installed.
in my case Debian is on the first HDD, 2nd partition, which equals hd0,1

ok, let's go:

boot the live CD, when done open a shell:

Code: Select all

##enter the GRUB shell###
grub

###tell GRUB where Linux is installed###
root (hd0,1)

###install GRUB in the MBR###
setup (hd0)
voila....now you can reboot and the GRUB loader will work again... :)

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Post by ayu »

nice :)
"The best place to hide a tree, is in a forest"

User avatar
Lyecdevf
cyber Idi Amin
cyber Idi Amin
Posts: 1222
Joined: 16 Mar 2006, 17:00
18
Location: In between life and death.
Contact:

Post by Lyecdevf »

I always install grub on a floppy. I have once installed grub on the HD where I also had windows and it messed up every thing so that I had to reinstall windows again.

I am still very weary about installing another OS on the same HD. For one I would have to create another partition on the HD. Now if I do that I can not use truecrypt to have my entire HD encrypted because truecrypt can only encrypt a HD with a single partition. :x

Nice tut though! Can come in handy one day~! :D
We will either find a way, or make one.
- Hannibal

Post Reply