Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

reinstalling grub

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
anarki
Posts: 19
Joined: 2006-03-22 13:27

reinstalling grub

#1 Post by anarki »

I have a dual-boot system (XP/Debian) and i've just reinstalled windows xp which erased grub. How can i boot into debian and how can i reinstall grub?

ajdlinux
Posts: 2452
Joined: 2006-04-23 09:37
Location: Port Macquarie, NSW, Australia

#2 Post by ajdlinux »

You used to be able to use installer CDs as rescue discs, I think that changed with sarge.

Use Knoppix or a similar Live CD - http://live.debian.net is getting good, you can just use the base version. Then sudo su to get root access, mount your Debian partition, use chroot <mountpoint> to chroot into it and then run grub-install (hd0). When you reboot Grub should be reinstalled.

anarki
Posts: 19
Joined: 2006-03-22 13:27

#3 Post by anarki »

i've done what you said but when i run grub-install /dev/hda it says: /dev/hda does not have any coresponding bios drive

ajdlinux
Posts: 2452
Joined: 2006-04-23 09:37
Location: Port Macquarie, NSW, Australia

#4 Post by ajdlinux »

Try grub-install (hd0) which uses the GRUB harddrive name.

Guest

#5 Post by Guest »

if i use grub-install (hd0) it says: unexpexted token ... (hd0) and if i use grub_install hd0 it say again the bios error. (i used simply mepis and knoppix std live cd's , i dont know if it makes a difference). i tried debian live-cd.sid but it doesnt boot!?

anarki
Posts: 19
Joined: 2006-03-22 13:27

#6 Post by anarki »

the post above it's mine but i forgot to login first, sorry.

ajdlinux
Posts: 2452
Joined: 2006-04-23 09:37
Location: Port Macquarie, NSW, Australia

#7 Post by ajdlinux »

What model of drive is this? Is it in any weird configuration, e.g. SATA, RAID, anything like that?

anarki
Posts: 19
Joined: 2006-03-22 13:27

#8 Post by anarki »

nope, it's an ata drive: western digital caviar 80gb

User avatar
dawgie
Posts: 430
Joined: 2004-06-16 21:30
Location: New Hampshire USA

#9 Post by dawgie »

Start the Grub program from the live CD:

# grub

You will get a prompt like this:
grub >

Enter the root name (in Grub language) of where the Grub menu and config files are located. I am assuming the 2nd partition of the 1st HD:

grub > root (hd0,1)

Then install the grub loader in the boot partition

grub > setup (hd0)

and then exit grub and reboot

grub > quit

Note that if you do not know the your grub files are located, you can use this command:

grub > find /boot/grub/stage1

Grub has tab completion. When you are entering a command in Grub hit the tab key to see what the possabilities are.
Once you have gotten everything back together, make a grub floppy (or CD) in case you loose your bootloader again.

There is also an option of editing the XP bootloader. If you are interested do a search on it.

anarki
Posts: 19
Joined: 2006-03-22 13:27

#10 Post by anarki »

It worked :) . Thanks a lot .

Post Reply