Martin Heller
Contributing Writer

BCDs, MBRs, and grub

analysis
Feb 23, 20093 mins

In the last couple of days Martin learned more than he ever wanted to know about boot menus

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:

  1. Download a Super Grub Disk ISO and burn a CD.
  2. Boot from the Super Grub Disk CD.
  3. Type “c” to get to the grub command line.
  4. 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.
  5. Make that partition the root: “root (hd0,3)”
  6. Setup grub on that partition: “setup (hd0,3)”
  7. Reboot to Vista
  8. Install and run EasyBCD
  9. Add your Linux partition to the Windows boot menu
  10. Reboot, and if you choose the Linux option it should work: it worked for me.

Thanks to all who contributed constructive suggestions.

EasyBCD
Martin Heller

Martin Heller is a contributing writer at InfoWorld. Formerly a web and Windows programming consultant, he developed databases, software, and websites from his office in Andover, Massachusetts, from 1986 to 2010. From 2010 to August of 2012, Martin was vice president of technology and education at Alpha Software. From March 2013 to January 2014, he was chairman of Tubifi, maker of a cloud-based video editor, having previously served as CEO.

Martin is the author or co-author of nearly a dozen PC software packages and half a dozen Web applications. He is also the author of several books on Windows programming. As a consultant, Martin has worked with companies of all sizes to design, develop, improve, and/or debug Windows, web, and database applications, and has performed strategic business consulting for high-tech corporations ranging from tiny to Fortune 100 and from local to multinational.

Martin’s specialties include programming languages C++, Python, C#, JavaScript, and SQL, and databases PostgreSQL, MySQL, Microsoft SQL Server, Oracle Database, Google Cloud Spanner, CockroachDB, MongoDB, Cassandra, and Couchbase. He writes about software development, data management, analytics, AI, and machine learning, contributing technology analyses, explainers, how-to articles, and hands-on reviews of software development tools, data platforms, AI models, machine learning libraries, and much more.

More from this author