In the last couple of days I've probably learned more than I ever wanted to know about BCDs, MBRs, boot sectors, boot menus, lilo, Wubi, and grub. When I complained that Windows 7 had trashed my grub menu on Thursday, I didn't know what a can of worms I was opening.
I got lots of advice, and most of it was constructive. Nobody quite gave me the whole picture, but I've put it together.
First of all, my original plan was to use the Asus BIOS F8 menu to switch between hard disks. I could have accomplished that by disconnecting drive 0 while I was installing to drive 1, but that would have been unnecessarily complicated.
Second of all, when I originally installed Ubuntu Linux for x64 for dual boot with Windows Vista for x64, I accepted all of the defaults. I didn't know then that there was an option to put the grub boot menu in the partition boot sector, much less how to enable it. As a result, I wound up with a Linux grub boot menu in the master boot record (MBR) that could chain to Windows Vista.
When I installed Windows 7, it didn't know what to make of the grub boot menu, so it restored the Vista boot menu and added itself at the top. I wish Windows 7 was smart enough to detect grub and lilo boot menus, but the beta isn't. Given Microsoft's current pace for Windows 7 development, I doubt that the RC will get that feature, but stranger things have happened in the past year: the Windows Live guys have been producing sample code in Ruby, and the .Net guys have been releasing their specifications to Novell to support Mono development. This isn't your father's Microsoft.
It turns out that having a trashed Linux boot menu after a Windows installation is a very common problem. I was able to solve it nicely with a combination of two free tools suggested by two readers: Super Grub Disk and EasyBCD. The EasyBCD documentation page for Linux explains the procedure clearly:
- Download a Super Grub Disk ISO and burn a CD.
- Boot from the Super Grub Disk CD.
- Type "c" to get to the grub command line.
- Type "find /boot/grub/stage1" to find the correct disk number and partition number for the Linux partition, in my case (hd0,3) if I recall correctly.
- Make that partition the root: "root (hd0,3)"
- Setup grub on that partition: "setup (hd0,3)"
- Reboot to Vista
- Install and run EasyBCD
- Add your Linux partition to the Windows boot menu
- Reboot, and if you choose the Linux option it should work: it worked for me.
Thanks to all who contributed constructive suggestions.