Skip to content

Instantly share code, notes, and snippets.

@theamith
Last active December 14, 2015 10:59
Show Gist options
  • Save theamith/5076488 to your computer and use it in GitHub Desktop.
Save theamith/5076488 to your computer and use it in GitHub Desktop.
Windows 7 not booting after installing Ubunutu
I have fed up for one day after i was unable to load my windows 7 after installing Ubuntu 12.04 LTS.
I'm gonna share some things i learned while recovering my system from this problem.
Mistakes Done by me:
1. Formatted the small partition(some thing around 200 MB) created automatically wile installing Windows 7.
2. Did not allocate swap space while installing Ubuntu.
Outcome of the Mistakes:
1. Dual boot mode is not working.
2. By default Ubuntu is booting.
3. There is no boot menu at all.
My Approach to Solve the problem:
1. I thought that while installing ubuntu, Windows 7 booting link was missed.So I thought to re-establish the link to boot Windows 7.
2. I googled and did the following procedure to bring a boot menu.
3. I installed boot-repair and done recommented repair:
3.a sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
3.b sudo apt-get install boot-repair
4. I installed Grub Customizer
4.a sudo add-apt-repository ppa:danielrichter2007/grub-customizer
4.b sudo apt-get update
4.c sudo apt-get install grub-customizer
5. Now boot menu came. but windows 7 is not there.
6. So I thought to add windows 7 to boot menu by
6.a cd /etc/grub.d
6.b sudo gedit 40_custom
6.c Add the following lines to the end of the file:
menuentry "Windows 7" --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root UUID-GOES-HERE
drivemap -s (hd0) ${root}
chainloader +1
}
hd0 means 1st hard disk.
msdos1 means first partition of the disk(sda1 means msdos1,sda2 means msdos2,..etc). we can find out where boot of windows 7 is installed using the command "sudo fdisk -l"
UUID can be obtained by the following command "sudo blkid"
7. sudo update-grub2
8. sudo reboot
9. Now Windows 7 is showing in boot menu.
10. When I clicked its showing error "bootmgr is missing.. press ctrl+alt+del to restart".
11. Now I installed windows 7 usb boot and did the following steps:
11.a In Command prompt type:
11.a.i. bootrec /RebuildBcd
11.a.ii. bootrec /FixMbr
11.a.iii. bootrec /Fixboot
11.b. Give option automatically fix boot issues.
12. restart and load windows 7. now its working.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment