How to reinstall GRUB after moving partitions around?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
How to reinstall GRUB after moving partitions around?
I'm using Ubuntu 8.04 but I'd like to try some other distributions; unfortunately, this is going to mean some screwing around with my partitions. Basically I'm going to have to move my root partition (with /boot, since it's not on its own partition) elsewhere. I understand in a basic way how to do this -- basically, create a new partition and copy the contents of the old one to it, and then I'm going to have to edit /boot/grub/menu.lst so that everything knows where it is. But I can't figure out how to actually reinstall GRUB.
I'm going to be doing the actual partitioning from a live CD but I don't know how to then reinstall GRUB and tell stage 1 where to find stage 2 (I think I have a handle on what those things are.) I'm going to have to reinstall GRUB on the MBR, correct? But how do I tell it where to look for stage 2? My understanding is that there's only one command line parameter to pass grub-install, which is where to put stage 1.
I'm going to have to reinstall GRUB on the MBR, correct? But how do I tell it where to look for stage 2? My understanding is that there's only one command line parameter to pass grub-install, which is where to put stage 1.
You need to install grub while running in the / partition where the grub stage2 is located. The way to do that is to:
I don't even bother with the chroot - I usually just run the grub command, either from the installed system, or from the liveCD itself. grub-install being merely a wrapper for the grub (sub-)commands.
Not something to stress over - easy to fix even if it goes wrong.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.