deleted grub retrival???

Status
Not open for further replies.

romeo_8693

"The RaCaLaNGeL"©
say one wants to install fc5(dvd) with ubuntu and windows already present and for some reason the fc5 installs fails at last step..now u boot and find grub has error...now is there any way to fix grub loader using ubuntu live cd????
 

borg

In the zone
You have to install GRUB on the MBR (Master Boot Record). To do this just follow this steps:

(First of all, enter your BIOS setup and in BOOT Sequence window choose to boot with CDROM first.)

1) Boot with your Fedora Core Installation CD 1.

2) Type "linux rescue" at the prompt.

3) Answer the questions about keyboard and language.

4) Tell the rescue mode to use your proper partition to mount (the one that you want to get booted into)

5) When you come to the console prompt type: chroot /mnt/sysimage

6) Type grub

7) Set the GRUB's root device to the partition containing the boot directory like this:

grub> root (hd0,0)

Filesystem type is ext2fs, partition type 0x83

I have Windows 98 in hd0,0 ; Windows XP in hd0,1, Fedora Core /boot partition in hd0,2 and Mandrake /boot partition in hd0,6. So in my case the command should be: > root (hd0,2)

If you are not sure which partition actually holds this directory, use the command 'find' like this:

grub> find /boot/grub/stage1

This will search for the file name '/boot/grub/stage1' and show the devices which contain the file.
Once you've set the root device correctly, run the command 'setup'.

8) Then, run the command setup

grub> setup (hd0)

Checking if "/boot/grub/stage1" exists....... no
Checking if "/grub/stage1" exists....... yes
Checking if "/grub/stage2" exists....... yes
Checking if "/grub/e2fs_stage1_5" exists....... yes
Running "embed /grub/e2fs_stage1_5 (hd0)"....... 15 sectors are embedded
succeded
Running "install /grub/stage1 (hd0) (hd0) 1+15 p (hd0,2)/grub/stage2 /grub/grub.conf....... succeded
Done

This command will install GRUB boot loader on the Master Boot Record (MBR) of the first drive.

9) Type quit

grub> quit

GRUB is now in the MBR.
 

borg

In the zone
You have the FC install disk, don't you?. If u do, then do as explained earlier. If u don't then try the same out with the ubuntu install disk. I don't see why it isn't possible to do the same with the ubuntu install disk. Just make sure that u set the root to the correct hard disk partition.
 
OP
romeo_8693

romeo_8693

"The RaCaLaNGeL"©
i checked the ubuntu cd but i dont think there is any rescue feature in there...correct me if wrong.
 

borg

In the zone
No, no, there is no rescue in ubuntu. Just boot fron ubuntu. Open the terminal & mount ur linux partiton (ur /boot partition, its about 100 MB or so) & then continue from step 6.
 
OP
romeo_8693

romeo_8693

"The RaCaLaNGeL"©
do u mean boot from ubuntu install cd right????if yes how am i supposed to get access to terminal?if you are talking abt live cd...i tried the method u told for fedora....tho it found satge1 it wouldnt run setup(hd0,2){thats my ubuntu partion}..it wud say it cannot be mounted...(yeah i changed did execute root (hd0,2)...any ways i re-installed ubuntu...but still i want to know if it can be fixed.....
 

borg

In the zone
The best way to retrieve your Fedora Core installation was to use a FC disk 1 & follow the simple procedure of reinstalling the Grub bootloader.

Though I have never tried it my self, but I see no reason as to why you wouldn't be able to install grub using a Ubuntu live CD instead of a FC disk. I repeat again, I have never tried it myself, but see no reason why it cannot be done.

What you need to do is to-
1. Boot from Ubuntu Live CD
2. Open terminal by clicking on application menu & choosing terminal from accessories.
3. In the terminal type grub. This will change the prompt to grub> or something like that.

4. The next thing is to find your /boot partition (find out which partion it is hd0,1 or hd0, 2 or whatever). To do this you need to mount your /boot partition. To mount it, open another teminal window, type
sudo fdisk -l
In the list, find a partition about 100MB in size with ext3 filesystem. Suppose it is /dev/hda2. We would mount it by typing
sudo mkdir /mnt/boot
sudo mount -t ext3 /dev/hda2 /mnt/boot
This would mount the boot partition.

5. next, go back to the first terminal window where you typed grub & now type
find /grub/stage1
this will return a drive name in the form (hd0, 2) or something like that.

6. Next use that drive name & then type
root (hd0, 2)

7. Then type setup (hd0)

This should setup grub on your MBR. You might also need to edit your grub.conf file & add an entry for fedora core.

I know this all seems very complicated & may not work as it should, but what can we do. This is how it is.
 

Rollercoaster

-The BlacKCoaT Operative-
PS: u might not have a different /boot partition. if not then it is in the root partition i.e on the partition u installed FC on.

after doing chmode is will be under "/boot" directory
 
OP
romeo_8693

romeo_8693

"The RaCaLaNGeL"©
thanks for the info....any ways i re-installed ubuntu..but ill keep this in case i get same error in future..
 
Status
Not open for further replies.
Top Bottom