LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   normal FC3 grub restore not working! (https://www.linuxquestions.org/questions/fedora-35/normal-fc3-grub-restore-not-working-307762/)

shishimo 03-30-2005 08:18 AM

normal FC3 grub restore not working!
 
I installed windows on a partition on my comp that i had previously deleted it from. my grub went away, and i tried the following to get it back:

1. boot fedora dvd
2. linux rescue
3. chroot /mnt/sysimage
4. grub-install /dev/hda

here's what happens: when i chroot, all of my dev files go away because the /dev that is under /mnt/sysimage is empty, so grub-install cant find hda. also, i tried:

ln -s /dev /dev/dev

but that didn't work. also, i tried not doing the chroot and just making symlinks from / into /mnt/sysimage whenever it told me it couldnt find something, but when i tried to do a symlink in /usr/share for the actual grub files, it told me i was in a read-only file system!

please help me get my linux system back, because i dont want to be stuck with the alternative again! help is much appreciated, because I am out of ideas..

thanks

macemoneta 03-30-2005 10:03 AM

Try this:

Make the /mnt/sysimage mountpoint /:
chroot /mnt/sysimage

Run grub:
grub

Tell grub to reinstall on the first disk, first partition:
root (hd0,0)
setup(hd0)
quit

Exit the chroot and reboot:
exit
exit

shishimo 03-30-2005 10:10 AM

thanks for the reply! ok, i tried to run those commands, and got the following errors:

grub> root (hd0,0)
Filesystem type unknown, partition type 0x7

grub> setup (hd0)

Error 17: Cannot mount selected partition

also, i might be able to chroot if i can mount /dev to /mnt/hda2/dev... but i have no idea how to do that, since there is not fstab entry for /dev, is there?

macemoneta 03-30-2005 10:36 AM

OK, that's your Windows NTFS partition (partition type 7), and grub can't find it's files there, which is to be expected. :)

Which partition contains your Linux /boot directory (usually setup as a separate partition)? Lets say that it's on the same hard drive, in the second partition (remember that grub counts from 0). In that case, change the root command in the previous post to:

root (hd0,1)

This tells grub that the /boot/grub files are on the first hard drive, second partition.

If the /boot partition is on the first partition of the second drive, then the root command would be:

root (hd1,0)

The setup command tells grub which drive's MBR to modify. If your boot drive is actually the second drive, then specify:

setup (hd1)

I hope that's clear...

ksnash 03-30-2005 02:30 PM

define grub device
 
in grub, define your grub device:

device (hd1) /dev/hda <=this can be hd0

then define which is your root partition for /boot

root (hd1, 1) <==/boot on second partition of the defined device hd1

last step

setup (hd1)

also make sure your grub.conf has correct drive specifications for everything.


All times are GMT -5. The time now is 03:55 AM.