歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> How to Install Grub2 From Live CD?

How to Install Grub2 From Live CD?

日期:2017/2/28 16:12:47   编辑:Linux教程

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.

Copyright © Linux教程網 All Rights Reserved