Pages

How to repair, restore, or reinstall GRUB 2 with Ubuntu Live CD

Wednesday, January 15, 2014

There is many cases that cause losing boot loader, such as installing windows after ubuntu, then you will loose ubuntu's boot loader (GRUB), anyway if you lost boot loader or it has been damaged for whatever reason you can reinstall/repair it easly using Live CD via the following steps

The first thing is "Boot your computer with the Ubuntu CD"After that you will need to follow one of the following two methods to recover/install GRUB


 (Command Line Method)

Step 1: Press Crtl + Alt + T to open terminal


Step 2: Find the system partition that where is your Ubuntu installation exist

sudo fdisk -l

Step 3: Mount the system partition

sudo mount /dev/sdXX /mnt

Step 4: Bind the directories that grub needs to detect other operating systems

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

Step 5: Jumping into mnt folder

sudo chroot /mnt

Step 6: Install, check, and update grub

sudo grub-install /dev/sdX
sudo grub-install --recheck /dev/sdX
sudo update-grub

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

exit
sudo umount /mnt/dev
sudo umount /mnt/dev/pts
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt

or

type in Crtl + D to exit chroot then type the following command

sudo for i in /sys /proc /dev/pts /dev; do sudo umount /mnt$i; done

Step 8: Reboot

sudo reboot


(The GUI Method)

Step 1: Go through the installation process until you reach "[!!!] Disk Partition" Step 2: Select Manual Partition
Step 3: Mount your appropriate linux partions:
/
/boot 
swap 
... 
Step 4: DO NOT FORMAT THEM.
Step 5: Finish the manual partition
Step 6: Say "Yes" when it asks you to save the changes
Step 7: It will give you errors saying that "the system couldn't install ....." after that
Step 8: Ignore them, keep select "continue" until you get back to the Ubuntu installation menu
Step 9:  Jump to "Install Grub ...."
Step 10: Once it is finished, just restart your computer


--
http://askubuntu.com/questions/83771/recovering-grub-after-installing-windows-7
https://help.ubuntu.com/community/LiveCdRecovery

No comments:

Post a Comment

 

Popular Posts

Sidebar One