Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When doing a fresh install of a Linux distro (Ubuntu, for instance) on a fresh hard drive, if I want to install Linux first, and Windows later, is it possible to make grub think there's a Windows install on the first partition so that it'll be added to the boot menu after the installation is complete?

To illustrate, I have a new hard drive and have created two primary partitions (both still raw) and two logical (Ext4 and Swap). I want to install Ubuntu on the Ext4 partition first, and some version of Windows on the first primary partition only after that (because I currently don't have a Windows install disk, but do have one for Ubuntu). Is it possible to make Ubuntu add an entry for Windows right now and avoid having to repair grub after I've installed Windows?

share|improve this question
up vote 7 down vote accepted

Do the Windows install first.

That's generally how it should be done, for future reference. In your situation, I don't know much about Windows install behavior, but it will always overwrite GRUB.

You'll have to reinstall it no matter what you do.

The GRUB entry is like so:

title Windows
rootnoverify (hd0,0)
chainloader +1

GRUB doesn't actually check for what you want to boot; it will assume you're correct. So, add it and don't use it.

share|improve this answer
you can backup the mbr using dd on the command line and restore it after windows is installed to skip having to go through a full grub re-installation. – Evan Plaice Mar 1 '11 at 20:20
@Evan True that, but dd has given me nightmares (I zeroed out my root partition). I think that for many users, the principle of "least privelige" definitely applies here. – new123456 Mar 1 '11 at 21:40
lol, that's pretty funny. Maybe it's because I have brass ones in the face of breaking stuff but I don't even flinch when I use dd. Of course, I would consider multi-os installs to be a pretty advanced practice. – Evan Plaice Mar 3 '11 at 20:05

Or you could use grldr and boot using the native Windows boot loader:

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .