reinstalling grub

If none of the more specific forums is the right place to ask

reinstalling grub

Postby anarki » 2006-05-11 08:34

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?
anarki
 
Posts: 19
Joined: 2006-03-22 13:27

Postby ajdlinux » 2006-05-11 09:23

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.
ajdlinux
 
Posts: 2480
Joined: 2006-04-23 09:37
Location: Port Macquarie, NSW, Australia

Postby anarki » 2006-05-11 19:13

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
anarki
 
Posts: 19
Joined: 2006-03-22 13:27

Postby ajdlinux » 2006-05-11 20:40

Try grub-install (hd0) which uses the GRUB harddrive name.
ajdlinux
 
Posts: 2480
Joined: 2006-04-23 09:37
Location: Port Macquarie, NSW, Australia

Postby Guest » 2006-05-12 16:21

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!?
Guest
 

Postby anarki » 2006-05-12 16:22

the post above it's mine but i forgot to login first, sorry.
anarki
 
Posts: 19
Joined: 2006-03-22 13:27

Postby ajdlinux » 2006-05-12 21:52

What model of drive is this? Is it in any weird configuration, e.g. SATA, RAID, anything like that?
ajdlinux
 
Posts: 2480
Joined: 2006-04-23 09:37
Location: Port Macquarie, NSW, Australia

Postby anarki » 2006-05-13 06:43

nope, it's an ata drive: western digital caviar 80gb
anarki
 
Posts: 19
Joined: 2006-03-22 13:27

Postby dawgie » 2006-05-13 10:57

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.
User avatar
dawgie
 
Posts: 431
Joined: 2004-06-16 21:30
Location: New Hampshire USA

Postby anarki » 2006-05-13 12:34

It worked :) . Thanks a lot .
anarki
 
Posts: 19
Joined: 2006-03-22 13:27


Return to General Questions

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable