Installed Windows 7, now Ubuntu won’t start
Ubuntu was working absolutely fine, but you thought of trying Windows 7. Earlier you were doing a dual boot with Windows Vista or XP and Ubuntu.
After Microsoft launched Windows 7 on October 22nd, you got inspired to use Windows 7 as well because you were frustrated with Vista. You got the Windows 7 installation CD and installed it on your computer.
Surprisingly, now your computer always boots in Windows 7 and you don’t even get an option to select Ubuntu. What the heck??? Where is my Ubuntu? How do I boot in Ubuntu now? Did Windows 7 overwrite it?
Well nothing like that happened except the fact that Windows 7 recreated the MBR (Master Boot Record), a record that tells the operating system from where to boot from. That’s why you don’t see the old GRUB you were used to. Don’t worry, I can help you fix it.
You will need:
- Ubuntu Alternate installation CD. (Not the Live CD) If you don’t have it, just download the latest file and burn it on a CD/DVD.
- Patience and concentration; because you are going to modify GRUB in a command line interface.
- Probably a cup of coffee.
Steps to follow:
- After you have Ubuntu Alternate installation CD in hand, REBOOT the computer with CD in the CD/DVD-ROM.
- As soon as manufacturer splash screen comes up, press a hot key (F3, F8 or F12 depending on OEM). On my Dell it is F12.
- That will boot you computer through CD and not from the hard-drive. You will see Ubuntu screen which you saw when you installed it earlier.
- Select “Rescue a Broken System” and hit Enter.
- Let it detect your hardware, keyboard and network etc.
- After that it will give you an option to select disk.
- You need to select the disk where you installed Ubuntu earlier, something like /dev/sda1, /dev/sda2 or /dev/hda1 etc etc.
- If you don’t remember it, don’t worry. You can use trial and error method because it won’t do anything unless you select the one which has the original GRUB. That will be mounted as ‘/’. In my case it was /dev/sda8.
(I selected wrong many times, but it didn’t do anything until I selected /dev/sda8)
- Select ‘Execute a shell in…”. Some line of code will run on the screen and you will be presented with the command prompt.
- Enter “# mount -a”.
- Enter “# df” to get the list of partitions.
- Search for the partition with ‘/’ as the mount. Note down the partition name, similar to previous step. Something like ‘/dev/sda8′ etc.
- Enter “#grub-install <partition without the number>”. For example, if you noted /dev/sda8′ then enter /dev/sda only.
- That’s it. If everything goes well, you will see “No error found. Installation finished properly.”
- Enter “#exit”
- Reboot your computer. You will see the same old GRUB again where you can select the operating system you want to boot in.
Enjoy the best of both worlds – Ubuntu 9.10 (Karmic Koala) and Windows 7. The steps remain same for any version of Windows and Ubuntu and any other Linux distro.
Hope you find it easy to follow. If you have any question/suggestion, drop in the comments and let us know what do you think. Probably you use some other method to regain access to your MBR file and to modify GRUB. Let us hear it in comments.