Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

How to Ubuntu

Custom Search

About

Countdown

Contribute

Advertisement Why are there ads?

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

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.

W eb page converted to PDF w ith the PDFmyURL PDF creation API!


Warning

Using the sudo command, especially from a Live CD can do serious damage to your system. Read all instructions and conrm 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 nd out. It is
usually a EXT4 Partition. Replace the XY with the drive letter, and partition number, for example: sudo mount /dev/sda1 /mnt.

sudo mount /dev/sdXY /mnt

Now bind the directories that grub needs access to to detect other operating systems, like so.

sudo mount --bind /dev /mnt/dev &&


sudo mount --bind /dev/pts /mnt/dev/pts &&
sudo mount --bind /proc /mnt/proc &&
sudo mount --bind /sys /mnt/sys

Now we jump into that using chroot.

sudo chroot /mnt


W eb page converted to PDF w ith the PDFmyURL PDF creation API!
Now install, check, and update grub.

This time you only need to add the drive letter (usually a) to replace X, for example: grub-install /dev/sda, grub-install recheck /dev/sda.

grub-install /dev/sdX

grub-install --recheck /dev/sdX

update-grub

Now grub is back, all that is left is to exit the chrooted system and unmount everything.

exit &&
sudo umount /mnt/sys &&
sudo umount /mnt/proc &&
sudo umount /mnt/dev/pts &&
sudo umount /mnt/dev &&
sudo umount /mnt
Shut down and turn your computer back on, and you will be met with the default Grub2 screen.

You may want to update grub or re-install burg however you like it.
W eb page converted to PDF w ith the PDFmyURL PDF creation API!
Congratulations, you have just Repaired/Restored/Reinstalled Grub 2 with a
Ubuntu Live CD!

Trending

How to Install LAMP on Ubuntu 3,164

How to Execute a .Run or .Bin file in Ubuntu 1,408

How to Cut, Copy, and Paste in the Terminal in Ubuntu 1,143

How to Install Spotify in Ubuntu 556

Social

Follow 1.1k Google+

W eb page converted to PDF w ith the PDFmyURL PDF creation API!


Facebook

Follow @htubuntu Twitter

YouTube 108 YouTube

Advertisement Why are there ads?

W eb page converted to PDF w ith the PDFmyURL PDF creation API!


Creative Commons

Attribution

Non-Commercial

Share-Alike

powered by
W eb page converted to PDF w ith the PDFmyURL PDF creation API!
Simplet
the file-based blog for github

disclaimer

copyright

cookies

privacy

terms

Ubuntu, Canonical and the Circle of Friends are registered trademarks of Canonical Ltd.

W eb page converted to PDF w ith the PDFmyURL PDF creation API!

You might also like