Help - Search - Members - Calendar
Full Version: Reinstalling Grub
Linuxhelp > Support > Technical Support
Stevey_G
Yep thats right, Ive got the age old problem of a dual boot system which has overwritten GRUB when reinstalling windows. I have booted the machine in rescue mode and mounted my linux system at /dev/hda3, in the directory /mnt/foo. But when I try to chroot to /mnt/foo it says /bin/sh has an i/o error? Any ideas? Obviosuly I cant reinstall GRUB if I cent get into my system.

Cheers Chaps
Corey
i'm not quite sure, but you may need to mount the proc filesystem as well:

QUOTE
mount /dev/hda3 /mnt/foo
mount -t proc none /mnt/foo/proc
chroot /mnt/foo /bin/bash
source /etc/profile
Stevey_G
Still get the same I/O error unsure.gif
michaelk
BTW what distribution are you running?
Stevey_G
Fedora Core 3 - X86-64 however Im booting using a core 1 cd then using the rescue console. Will this make a difference?
michaelk
I wouldn't think so but then I do not have a 64bit PC yet.

It has been awhile... but I thought that rescue mode will automatically mount the root partition at /mnt/sysimage. Maybe this might be causing the error.
Stevey_G
Ok. the Fedora installation is now mounted at /mnt/sysimage for definite, but if i try to chroot /mnt/sysimage OR chroot /mnt/sysimage /bin/bash I still get an I/O error. Im assuming I cant just do grub-install /dev/hda from the current shell root as it will attempt to reinstall to the wrong drive?
michaelk
Do you have any problems accessing data on the root partition via /mnt/sysimage?
Stevey_G
Nope.
Stevey_G
Right!!!! I have this bloody problem yet again. Basically this time though, if i chroot to /mnt/sysimage and run grub-install /dev/sda, it cannot find the block device /dev/sda. However, if i run the command without changing the root, it recognises the device BUT the command isnt recognised, because there is no sbin. Any clever ideas? It appears that /mnt/sysimage/dev is empty. Can I symlink /dev/sda to /mnt/sysimage/dev?
michaelk
I do not see why creating a link will not work.
Stevey_G
Sorted it! biggrin.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.