Monday, November 28, 2016

Cannot boot into Ubuntu 12.04 after reinstalling Windows 7



I had to reinstall my Windows 7 due to some problems, before that I was running a dual boot with Ubuntu 12.04, which was originally installed from Windows (via Wubi) in a separate partition.



After reinstalling Windows the screen where I could choose the OS to boot to was gone, I searched for a solution and installed EasyBCD, from there installed Neogrub, added an entry for Ubuntu (tried type GRUB2 and GRUB Legacy, nothing changed). Now I get to Windows boot manager after rebooting, but if I choose Ubuntu it says 'Windows was not installed correctly', so clearly something is wrong. This is the boot menu:




There are a total of 3 entries listed in the bootloader.



Default: Windows 7
Timeout: 15 seconds
Boot Drive: C:\

Entry #1
Name: Windows 7
BCD ID: {current}

Drive: C:\
Bootloader Path: \Windows\system32\winload.exe

Entry #2
Name: NeoGrub Bootloader
BCD ID: {8355e9dd-8693-11e2-94ba-98e0820b23a5}
Drive: C:\
Bootloader Path: \NST\NeoGrub.mbr

Entry #3

Name: Ubuntu
BCD ID: {8355e9df-8693-11e2-94ba-98e0820b23a5}
Drive: E:\
Bootloader Path: \NST\AutoNeoGrub0.mbr


I`m no expert, but the Bootloader Path for Entry #3 looks wrong, however I don't know how to change it (or what should I change it to).



Now I realised I should have installed Ubuntu from a Live CD not wubi, but it's too late for that. I'm thinking there has to be some way to acces Ubuntu, cause it`s all there in its partition.




edit: I tried running wubi to refresh my memory, now I remember what I did, I changed the 'Installation drive' from C to E, which is a partition I created just for Ubuntu and which is still there, unformatted.



To answer my own question (in case anybody else has this problem, it is possible to fix this. Using EasyBCD is just the first step, after creating an entry for Ubuntu (be sure to set the Type to wubi, not GRUB) you have to tell Windows where to boot Ubuntu from. To do this, open a command prompt with administrator rights, and run



bcdedit and look at the end of the output under 'Real-Mode Boot Sector' at the identifier.



Then run bcdedit /set {device_id} partition=X:



where device_id is the ID from above and X is the partition where you installed Ubuntu.




Lastly, run



bcedit /set {device_id} path \your_ubuntu_path\winboot\wubildr.mbr



Again, replace device_id and 'your_ubuntu_path' with the path to the wubildr.mbr file (probably it`s in \ubuntu\winboot\ on the partition where you installed Ubuntu)



That`s it, the dual-boot should work correctly again (at least for me it did).


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...