Your Ad Here

Repair GRUB2 after install windows 7 : dual boot ubuntu 9.10

November 30, 2009

Fix your grub2 after Windows 7 (Ubuntu installed 1st) installation for dual or multi boot with Ubuntu 9.10 Karmic Koala. Here is how:

Tool required:
Live CD Ubuntu 9.10 Karmic Koala
  • Boot using your live CD 

  • Select " Try Ubuntu without any change to your computer "
  • Once you've login to desktop run Terminal ( Application > Accessories > Terminal )
  • Change to root, using this [enter only blue lines] command in Terminal:
ubuntu@ubuntu:~$ sudo -i
  • Find partition location of your Ubuntu:
root@ubuntu:~# fdisk -l
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x10031003
Device Boot Start End Blocks Id System
/dev/sda1 * 1 6374 51199123+ 7 HPFS/NTFS
/dev/sda2 6375 19457 105089197+ f W95 Ext'd (LBA)
/dev/sda5 6375 11473 40957686 7 HPFS/NTFS
/dev/sda6 11474 19457 64131448+ 83 Linux <--- Here

  • Create mount-point for ubuntu's partition
root@ubuntu:~# mkdir /media/root
  • Mount the partition using this line:
root@ubuntu:~# mount /dev/sda6 /media/root
  • Confirm your root location by typing this line:
root@ubuntu:~# ls /media/root
bin dev initrd.img lib32 media proc selinux tmp vmlinuz
boot etc initrd.img.old lib64 mnt root srv usr vmlinuz.old
cdrom home lib lost+found opt sbin sys var
if those line above appear, you may proceed by installing GRUB 2:
root@ubuntu:~# sudo grub-install --root-directory=/media/root /dev/sda
Installation finished. No error reported. This is the contents of the device map /media/root/boot/grub/ Check if this is correct or not. If any of the lines is incorrect, fix it and re-run the script `grub-install'. (hd0) /dev/sda
  • Reboot your system!

No Windows 7 ?
No worries...
  • Boot to your ubuntu
  • Run Terminal to update GRUB2 so that grub able to identify mount-point location for Windows 7. This can be done by typing this command in Terminal:
ubuntu@ubuntu:~$ sudo update-grub2
[sudo] password for ubuntu:
Generating grub.cfg ...
Found Debian background: apollo.tga
Found linux image: /boot/vmlinuz-2.6.31-15-generic
Found initrd image: /boot/initrd.img-2.6.31-15-generic
Found linux image: /boot/vmlinuz-2.6.31-14-generic
Found initrd image: /boot/initrd.img-2.6.31-14-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
Try reboot again & you should be able to see Windows 7 at Grub menu.

blog comments powered by Disqus