I’ve written about this elsewhere, but thought it was worth repeating. While I do have systems that run exclusively on Linux, my laptop, (and a good number of installations in the real world,) are dual-boot installs. In the past, this has never been that big of an issue. I’ve always just let GRUB handle the task, and all was well. In fact, when I bought the laptop, it came preloaded with Windows Vista. I adjusted the partition size, set up my linux partitions, and did a standard install, allowing GRUB to write itself to the MBR, and all was happy. Then, I upgraded my Windows installation to Windows 7, (namely because I wanted to switch to all 64-bit operating systems).
I don’t know if this is just an issue with the 64-bit version of Windows 7, or if this inherent with all versions of Windows 7, or if only certain “lucky” people experience this, but I know that I am not alone in this problem; thus, the impetus for this article and its predecessor. Upon upgrading to Windows 7 and reinstalling GRUB, Windows 7 decided that something was broken. When it “fixed” the supposed problem, all of my software, including Microsoft Office 2007, had been uninstalled. When I reinstalled any of the software, the so-called problem returned.
My first instinct was to try to install everything from scratch. I wiped the hard-drive. Reinstalled both Windows 7 and Linux, but with GRUB in charge of loading, the problem of Windows not allowing any software to be installed without thinking something was wrong remained. What I finally deduced is that unlike its predecessors, Windows 7 will only be happy if Windows Boot Loader is in the Master Boot Record (MBR). This makes dual-booting with Linux a tricky proposition, but not impossible. Unless you are very familiar with the Windows command line tool, bcdedit, I would recommend EasyBCD from NeoSmart.net to aid in this process.
I will now relate to you the method to effectively get Windows 7 and Linux to dual-boot on your system. These instructions assume that you’ve already set up Windows 7 and set aside unpartitioned space for your Linux distribution.
Step 1: Make sure /boot has its own partition. Typically, I do this anyway, even if I’m not dual-booting a system. My normal setup for a desktop or laptop system that is going to be dual-booting is to use 4 primary partitions set up as follows: NTFS (Windows) on /dev/sda1, /boot on /dev/sda2, swap on /dev/sda3, and root (/) on /dev/sda4.
Step 2: Install Linux normally except for the bootloader. Allow Linux to install using all the regular settings you normally would except when it comes to installing GRUB. Depending on the distribution you are using depends on exactly when and how you will need to make these changes which are in the next step.
Step 3: Install GRUB to the /boot partition. If you have followed my partitioning scheme, you will need to tell GRUB to install to /dev/sda2 instead of the MBR (/dev/sda0). Also, if you have the option to customize the GRUB menu entries at this time, go ahead and remove any references to Windows that have most likely been added. Some versions of Linux won’t let you do that at this point, so if you can’t modify the menu entries, don’t worry about it, and just change where GRUB will be installed. Remember, if you have set up your partitions differently, use the partition that has /boot assigned to it.
Step 4: Modify the Windows Boot Loader. Once Linux is done installing, allow your system to reboot. It should reboot back into Windows 7. Use your tool of choice (bcdedit from the command line, or EasyBCD) to add a menu entry to the Windows Boot Loader and to modify the time out setting so you have time to make a choice when the menu shows. Your menu entry should point to the /boot partition. This is why I recommend using EasyBCD. All you have to do is select the operating system type, give it a name, decide on the amount of time you want for the delay, pick what boot loader you are using (for Linux, default is GRUB), and what partition it’s located on, and EasyBCD takes care of all the complicated back-end stuff that you have to do manually if you use bcdedit.
Once you have completed step 4, you can reboot your system again. You should see your new entry below Windows 7. Go ahead and select your Linux entry and hit the enter key. This should now bring up the GRUB menu. Choose your Linux entry from the GRUB menu and it should happily load. You can now go and modify your GRUB menu if you weren’t able to do so during the installation process, to remove the reference to your Windows installation and possibly eliminate the timer so you don’t have to go through two menus to load Linux; though, some versions of Linux have multiple load options, so the latter option might not be that good of an idea.
If you have successfully completed all four steps, you are now happily dual-booting Windows 7 and Linux. Why go to all that trouble? There are multiple reasons, ranging from the comfort level of the user to application-specific necessity, but for me there were really only two reasons: first, despite the fact that I am a huge fan of Linux, I still like Windows; and second, to prove it can be done.
