Sunday, October 21, 2012

Restore grub after installing Windows

Grub Restored 
Often we go for dual booting but somehow the grub is overlapped and we are not getting through all of the OS listed or sometimes without Grub. Here are some tweaks described for Linux users especially for one who is up with Ubuntu to get rid of this type of problems :
Following steps are to be followed chronologically  :

  • Boot from an Ubuntu Live CD or Live USB
  • Without go for "Install" option click on "Try Ubuntu"
  • Open a Terminal 
  • Type sudo su 
  • Type fdisk -l 
  • Note which device contains your Linux partition (i.e: /dev/sda1) 
  • Type mount /dev/sdx* /mnt 

(replacing x* ; x is your device & * is the partition number )You also know this by using Gparted

  • Type mount --bind /dev /mnt/dev
  • Type mount --bind /proc /mnt/proc
  • Type cp /etc/resolv.conf /mnt/etc/resolv.conf
  • Type chroot /mnt 
  • Type grub-install --recheck /dev/sdx (replacing x with your actual device)
  • Type reboot 
  • Now remove your Live USB or CD. 


After reboot you should be presented with a GRUB2 menu. However, Windows is missing. Now fix to that.

  • Proceed to boot into your Linux environment.
  • Open a terminal and type sudo update-grub (enter your root password when prompted) 
  • Now  grub should have updated it's menu entries including existing Windows partitions

No comments:

Post a Comment