By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,660 Members | 1,295 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,660 IT Pros & Developers. It's quick & easy.

Where's my GRUB?

AmberJain
Expert 100+
P: 884
Well,
I installed Red hat linux a few days ago and recently I tried to repair my XP installation on same machine. It displayed the following message when I expected it to repair my XP-"Setup is performing requested operations on your hard disk" or something similar (I don't actually remember the message displayed). But instead of repairing XP it did something unexpected. My GRUB boot loader got lost into nowhere.

When I tried booting with DamnSmallLinux LiveCD and searched for older Linux parttions on my PC, then I found that both Linux and Linux Swap partitions are fine and all files are in order. I have set of Redhat bootable CD's .

I want to bring GRUB back so that I can boot into Redhat linux installed on my PC.

Hope I have given enough information and if you expert need more information, tell me so that I can provide them to you.

THANKS in advance..............

============
AmbrNewlearner
============
Jun 26 '08 #1
Share this Question
Share on Google+
6 Replies

micmast
100+
P: 144
You gave enough info, you could have also said I tried to repair XP after installing any linux distro...

Microsoft doesn't care that you have grub/lilo or any other bootloader installed and will simply remove it and install the windows bootloader. There are a few solutions to solve this problem.

The first is use the SuperGrub Boot Disk: http://www.supergrubdisk.org/

Another option, but a bit more difficult, is using a liveCD (I would say ubuntu or something, or maybe even fedora/redhat, but I haven't tried those). When you use a liveCD you have to follow the following steps:
(I assume everything below is done as root in a terminal)

1. mount your linux partition; for example: mount /dev/sda2 /mnt/sda2
2. Mount /dev, /proc and /sys to the correct directories of your original system
mount --bind /dev /mnt/sda2/dev
mount --bind /proc /mnt/sda2/proc
mount --bind /sys /mnt/sda2/sys

3. The next step is going back to your orginal machine.
chroot /mnt/sda2

Now everything you do, will be applied to the linux version on your sda2 device instead of on the CDROM.

4. Reinstall grub
grub-install

5. If you want to leave the chroot environment, you have to do the following steps:

umount /proc (Not 100% sure this is required)
CTRL+D (The keycombination)
umount /mnt/sda2/dev
umount /mnt/sda2/proc
umount /mnt/sda2/sys

That should reinstall the grub on your MBR. But the supergrubdisk is a lot quicker & easier :D

Hope this helps
Jun 26 '08 #2

AmberJain
Expert 100+
P: 884
THANKS micmast......I will try as you advised me to do and then I will reply back with the result.

============
AmbrNewlearner
============
Jun 27 '08 #3

AmberJain
Expert 100+
P: 884
You gave enough info, you could have also said I tried to repair XP after installing any linux distro...

Microsoft doesn't care that you have grub/lilo or any other bootloader installed and will simply remove it and install the windows bootloader. There are a few solutions to solve this problem.

The first is use the SuperGrub Boot Disk: http://www.supergrubdisk.org/

Another option, but a bit more difficult, is using a liveCD (I would say ubuntu or something, or maybe even fedora/redhat, but I haven't tried those). When you use a liveCD you have to follow the following steps:
(I assume everything below is done as root in a terminal)

1. mount your linux partition; for example: mount /dev/sda2 /mnt/sda2
2. Mount /dev, /proc and /sys to the correct directories of your original system
mount --bind /dev /mnt/sda2/dev
mount --bind /proc /mnt/sda2/proc
mount --bind /sys /mnt/sda2/sys

3. The next step is going back to your orginal machine.
chroot /mnt/sda2

Now everything you do, will be applied to the linux version on your sda2 device instead of on the CDROM.

4. Reinstall grub
grub-install

5. If you want to leave the chroot environment, you have to do the following steps:

umount /proc (Not 100% sure this is required)
CTRL+D (The keycombination)
umount /mnt/sda2/dev
umount /mnt/sda2/proc
umount /mnt/sda2/sys

That should reinstall the grub on your MBR. But the supergrubdisk is a lot quicker & easier :D

Hope this helps
Instead of going with supergrubdisk, I tried manual recovery of GRUB as you advised.
I booted into damn small linux live cd and then I did as you advised. Everything went fine till following command.
chroot /mnt/hdd2

When I executed above command, I got on to bash of my hdd2 partitions linux.
Then I entered following at the terminal--->
grub-install

But I get a error- "Format of install_device not recognised". I tried various combinations for install_device but couldnot find the appropriate one. So what should I do now.

THANKS for your help....
Jul 4 '08 #4

micmast
100+
P: 144
o sorry, I made a small error
it should be: grub-install /dev/<your harddrive>

That should install it.
Jul 4 '08 #5

AmberJain
Expert 100+
P: 884
o sorry, I made a small error
it should be: grub-install /dev/<your harddrive>

That should install it.
Hello,
I did as you advised but still GRUB doesnot comes up.......
_______________
grub-install /dev/hdd5

I have enclosed below a screenshot of terminal when I executed the commands at Damn Small Linux terminal. (point your mouse pointer over the image so that you can view the enlarged and original image).



It says- "installation finished-No errors reported". But my GRUB sill don't appear when I boot my PC i.e. IBM/Windows bootloader is still the defaullt bootloader.

What is wrong now.
THANKS for your help in advance.........
Jul 4 '08 #6

AmberJain
Expert 100+
P: 884
SUCCESS.......
problem solved. I made a mistake. I typed

grub-install /dev/hdd5
instead of

grub-install /dev/hdd.

THANKS for help...........
Jul 5 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.