How to Install Grub2 From Live CD?

So I’m trying to restore my triple boot Macbook Pro to a new hard drive, and when I restored Ubuntu partition with Clonezilla, I can’b boot it from rEFIt. At first I thought it’s because I hadn’t restored the MBR, while it turned out that I don’t really need MBR info ’cause I’d installed Grub2 to the PBR of my Ubuntu Partition. So I just reinstalled Grub2 from the live CD and now I can boot Ubuntu on my new HDD. Here is how to install grub2 from live CD:

Open up Terminal when the live CD is started.

Then type the following commands:

sudo mount /dev/sda4 /mnt
sudo grub-install –root-directory=/mnt /dev/sda4

/dev/sda4 is my Ubuntu partition. If you want to install Grub2 to MBR, you can just use /dev/sda instead of /dev/sdax.

If it won’t work, then try adding “–force” option in the “grub-install” command. See if you get a message that “Installation finished”. If it says so, then you should be good to go. Reboot you MBP, and choose Ubuntu icon, you should now see the grub menu.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/23815.html