bamboccio Posted October 27, 2010 Report Share Posted October 27, 2010 Hello, I have an installation of 2010.1 and I would like to reinstall grub which has been deleted by mistake while trying to repair a windows install on another HD. Any easy way of doing so? Thanks! [moved from Installing Mandriva by spinynorman] Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted October 27, 2010 Report Share Posted October 27, 2010 Yes, you can boot into rescue mode from a Mandriva CD. You will need to know of course, which partition is your / and also /boot if you have it separately, but probably you have everything under /. Here is an example of how I would do it. Replace my partition in my example with your / partition. In my example, /dev/sda2 is my / partition. mkdir /mnt/mandriva mount /dev/sda2 /mnt/mandriva mount -t proc proc /mnt/mandriva/proc mount -o bind /dev /mnt/mandriva/dev chroot /mnt/mandriva /bin/bash source /etc/profile alternatively, if you have a problem with the chroot command I just gave, just change it slightly: chroot /mnt/mandriva source /etc/profile of course, still mounting all the stuff as previously mentioned. That will get you into an environment for reinstalling grub, then all you need to do: grub root (hd0,1) setup (hd0) and that will do the grub part. Grub should be installed to the MBR, and you can now reboot. Remember the hd0,1 is specific to the partition, so for example: /dev/sda1 = hd0,0 /dev/sda2 = hd0,1 /dev/sda3 = hd0,2 /dev/sda5 = hd0,4 and so on. You will know if you found it correctly. Maybe / on your system is /dev/sda5 but I cannot be sure of it. You can verify all of this in /boot/grub/menu.lst because it will show the root in there with hd0,1 or whatever. Once you have done that, exit cleanly from the chroot environment. exit umount /mnt/mandriva/dev /mnt/mandriva/proc /mnt/mandriva and reboot. Quote Link to comment Share on other sites More sharing options...
bamboccio Posted October 27, 2010 Author Report Share Posted October 27, 2010 Thank you for the prompt reply! One more question, I have a live CD of 2010.0 (not 2010.1 !), do you think I can use that one, boot in live mode and enter the grub command from there hence avoiding the need to do all the mount stuff? Once I am back in my installationhen I would reinstall grub from 2010.1 . Thank you! Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted October 27, 2010 Report Share Posted October 27, 2010 Yes, you can. It doesn't matter on the CD. It could be Ubuntu, or even Gentoo. Just need to chroot like I mentioned, and you can do all you need. Unfortunately, you will have to type it as I said. You won't be able to do it easily in a GUI way. It's not complicated to type and mount as I mentioned. Quote Link to comment Share on other sites More sharing options...
bamboccio Posted October 28, 2010 Author Report Share Posted October 28, 2010 Hello, I managed to reinstall Grub, thank you! I used the install disk and went to the system repair section. In there there is an option to reinstall Grub, I used it and it failed because there where 2 hard disks installed and Linux was on the second one. So I unplugged the first hard disk (the one containing Windows) and repeated the procedure and it worked like a charm! Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.