GRUB re-install GRand Unified Bootloader

GRUB 2 is the default boot loader and manager for Ubuntu since version 9.10 (Karmic Koala). As the computer starts, GRUB 2 either presents a menu and awaits user input or automatically transfers control to an operating system kernel. GRUB 2 is a descendant of GRUB (GRand Unified Bootloader)


  1. Boot from the live CD or live USB, in "Try Ubuntu" mode.
  2. Determine the partition number of your main partition. GParted (which should already be installed, by default, on the live session) can help you here. I'm going to assume in this answer that it's /dev/sda2, but make sure you use the correct partition number for your system!
  3. Mount your partition:
    sudo mount /dev/sda2 /mnt  #Replace sda2 with your partition number
    
  4. Bind mount some other necessary stuff:
    for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt$i"; done
    
  5. If Ubuntu is installed in EFI mode (see this answer if you're unsure), use GParted to find your EFI partition. It will have a label of EFI. Mount this partition, replacing sdXY with the actual partition number for your system:
    sudo mount /dev/sdXY /mnt/boot/efi
    
  6. chroot into your Ubuntu install:
    sudo chroot /mnt
    
  7. At this point, you're in your install, not the live session, and running as root. Update grub:
    update-grub
    
    If you get errors or if going up to step 7 didn't fix your problem, go to step 8. (Otherwise, it is optional.)
  8. Depending on your situation, you might have to reinstall grub:
    grub-install /dev/sda
    update-grub # In order to find and add windows to grub menu.
    
  9. If everything worked without errors, then you're all set:
    exit
    sudo reboot
    
  10. At this point, you should be able to boot normally.

Comments

Popular posts from this blog

HAproxy logging

teamcity Automatic Agent Start under Linux

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all