Posted By

developer on 04/27/13


Tagged

grub reinstall


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

tazjel


How to Repair, Restore, or Reinstall Grub 2 with a Ubuntu Live CD or USB


 / Published in: Bash
 

URL: http://howtoubuntu.org/how-to-repair-restore-reinstall-grub-2-with-a-ubuntu-live-cd#.UXu_FCuUXw0

Grub 2 typically gets overridden when you install Windows or another Operating System. To make Ubuntu control the boot process, you need Reinstall (Repair/Restore) Grub using a Ubuntu Live CD.

Warning:

Using the sudo command, especially from a Live CD can do serious damage to your system. Read all instructions and confirm you understand before executing any commands. When pasting into the Terminal, use Ctrl+Shift+V, NOT Ctrl+V.

Terminal Commands:

Mount the partition your Ubuntu Installation is on. If you are not sure which it is, launch GParted (included in the Live CD) and find out. It is usually a EXT4 Partition. Replace the XY with the drive letter, and partition number, for example: sudo mount /dev/sda5 /mnt.

  1. sudo mount /dev/sdXY /mnt
  2. Now bind the directories that grub needs access to to detect other operating systems, like so:
  3.  
  4.  
  5. Now we jump into that using chroot.
  6.  
  7.  
  8. Now install, check, and update grub.
  9.  
  10. This time you only need to add the partition letter (usually a) to replace X, for example: grub-install /dev/sda, grub-install –recheck /dev/sda.
  11.  
  12. grub-install /dev/sdX
  13. grub-install --recheck /dev/sdX
  14.  
  15. Now grub is back, all that is left is to exit the chrooted system and unmount everything.
  16.  
  17.  
  18. Shut down and turn your computer back on, and you will be met with the default Grub2 screen.
  19.  
  20. You may want to update grub or re-install burg however you like it.
  21.  
  22. Congratulations, you have just Repaired/Restored/Reinstalled Grub 2 with a Ubuntu Live CD!

Report this snippet  

You need to login to post a comment.