Repair GRUB2 for UEFI after Windows Installation

Source:

http://askubuntu.com/questions/681422/grub-menu-not-showing-with-dual-boot-uefi-mode-installation

Scenario:

A windows installation wipe out your old GRUB2. You want to repair.

Solution:

Suppose that /dev/sdaX is where your ubuntu was installed and /dev/sdaY is where you want to install GRUB2.

Boot with Ubuntu LiveCD. Open a terminal, then do the following:


# We call the Ubuntu from the LiveCD the Live Ubuntu
# We call the Ubuntu on our local partition /dev/sdaX the Local Ubuntu

sudo mount /dev/sdaX /mnt # mount the Local Ubuntu into the Live Ubuntu

sudo mount /dev/sdaY /mnt/boot/efi # mount the GRUB2 partition into the Local Ubuntu

for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
# This step is NECESSARY. It makes the Local Ubuntu see what the Live Ubuntu see. Then the update-grub can work correctly.

sudo chroot /mnt # Now we switch from the Live Ubuntu to the Local Ubuntu

sudo grub-install /dev/sdaY # Install GRUB2

sudo update-grub # Update GRUB2

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s