Fix Ubuntu GRUB rescue prompt problem

When trying to install a second Linux OS (CentOS) from a bootable USB, I accidentally unplugged the USB while shutdown was still in progress. This caused my Ubuntu GRUB failed to show the boot menu and ended up to the “GRUB rescue prompt”.

Here is the procedure to fix the problem.

1. Boot the system with a bootable Ubuntu USB or CD

2. Select “Try Ubuntu” when asked

3. After booted, find the original “Ubuntu” Partition on the “Application Launch Panel” and open it. Put mouse on the “Ubuntu” Partition icon and type “Ctrl + L”, the location of this partition will show up on the opened window. It shall be like “/media/ubuntu/aee35a52-e58d-42a7-8c67-0f6e86e6e5d5”.

4. Open a “Terminal” and issue the following commands:

  • sudo mount –bind /dev /media/ubuntu/aee35a52-e58d-42a7-8c67-0f6e86e6e5d5/dev
  • sudo mount –bind /sys /media/ubuntu/aee35a52-e58d-42a7-8c67-0f6e86e6e5d5/sys
  • sudo mount –bind /proc /media/ubuntu/aee35a52-e58d-42a7-8c67-0f6e86e6e5d5/proc
  • sudo chroot /media/ubuntu/aee35a52-e58d-42a7-8c67-0f6e86e6e5d5
  • sudo grub-install /dev/sda

(make sure sda is /media/ubuntu/aee35a52-e58d-42a7-8c67-0f6e86e6e5d5 by checking the properties of it in /dev directory.)

you may see the following output of the above command.

“sudo: unable to resolve host ubuntu
/usr/sbin/grub-bios-setup: warning: Sector 32 is already in use by the program `FlexNet’; avoiding it.  This software may cause boot or other problems in future.  Please ask its authors not to store data in the boot track.
Installation finished. No error reported.”

After this operation, the fix is done.

Reboot the system and takeout the bootable USB when the system is complete down.