I have a fresh desktop with no OS that I want to run Windows 7 and Debian stable on. All guides for dual boot setups I found so far assume a pre-installed Windows (possibly because so many PCs come that way). Because of the bootloader, it does matter what is installed first.

  • What is better, Windows or Linux first - and why?

  • What’s easier to do?

  • Especially with a Linux-first setup, I’d appreciate example of the steps that could be involved.

  • I think this question can be improved. The first of your 3 questions is good and relevant. I would ask "does the order matter?". The question about the "detailed" step by step is virtually impossible to answer. Even for something as straightforward as installing Debian Stable there are too many answers possible, too many ways to do it, depending on your hardware, your install medium and your target system. Not to mention that the Debian official documentation does a great job at detailing how to install. – rahmu Aug 8 '13 at 10:42
  • 1
    I don't get it. the question provoked two good answers that are useful not only to me, I guess. – mart Aug 8 '13 at 20:06

There are 2 main reasons for installing Windows first:

1 - The boot loader

Configuring the Windows boot loader to load Linux is a royal pain in the butt. It completely overwrites any boot loader that is already there, so if you have Linux installed already you can no longer boot Linux without playing around for hours or reinstalling Grub from a boot CD.

Most Linux distributions, however, will automatically configure Grub to include your Windows installation giving you easy access to Windows without any messing around.

2 - Distro tricks

Some Linux distributions will automatically detect that you have Windows installed and give you the option to import user accounts, settings and files into your new Linux installation.

Borrowed from majenko

So i would say it is easier to do a Windows installation first folowed by a linux Install

If you still Want to Proceed with "The not so much travelled Path"

Here's the general outline:

  • Make space for Windows
  • Install Windows
  • Reinstate GRUB
  • Mount the /boot partition
  • Install the boot loader

Step One

Open up GParted, and make sure that you have at least 20 GB available for Windows , either as a partition you can remove, or as unpartitioned space. If it's a partition, remove it from GRUB to make sure it doesn't break your Debian install -- GParted will complain if anything bad is about to happen. Make note of current /boot device. If that doesn't show up there, make note of the / device. The device name is something like sda5.

Step Two

Install Windows into the space you just made

Step Three

Load up from your debian live CD, and then run these commands.

If you DO NOT have a separate /boot partition:

sudo mount /dev/DEVICENAME_FROM_STEP_ONE /mnt
sudo rm -rf /boot    # Careful here, make sure YOU ARE USING THE LIVE CD. I tried it, it works.
sudo ln -s /mnt/boot /boot

If you have a SEPARATE /boot partition:

sudo mount /dev/DEVICENAME_FROM_STEP_ONE /boot

Step Four

Then continue with those commands:

sudo apt-get update && sudo apt-get install grub-pc
sudo grub-setup /dev/sda     # NOTE THAT THERE IS NO DIGIT
sudo umount /boot

And restart. It should work fine and boot both systems.

  • While I'm right now going down the path more travelled, (windows first), I accepted this one because this is the first rundown of doing it linux first I found. – mart Aug 10 '13 at 8:28
  • Hi. May I ask if a separate partition is the same with an unallocated ? I can create easily an unallocated space in the hard drive disc, but is that what you are referring to? Thank you. – Constantine Black Jun 5 '15 at 15:11
  • Or what I'm referring to is what you mention as a not separate boot partition? Thanks. – Constantine Black Jun 5 '15 at 15:15

I'd like to add to Stormvirux' answer with a (mostly) step-by-step explanation on how to set up dualboot with windows first:

  1. First, use gparted to partition your disk(s). The windows installer partitioner is incredibly stupid and entirely useless for anything other than creating NTFS partitions. If you have multiple disks, give serious thought to the possibility of keeping one distro per disk.

  2. Second, install windows to the first partition you created. It may have gotten better recently, but the last time I had to check windows was very touchy about wanting to be the first partition on the first drive and got downright uncooperative when it wasn't.

  3. After installing windows, install linux into the remaining empty space. Most linux distributions already assume that they may have to share the PC with other OSes and have designed their installer accordingly. I know for a fact that Debian and Ubuntu automatically take care of this; I'm fairly confident that Fedora, SuSE and most of the other big names do as well.

  4. Assuming step 3 went without a hitch, GRUB will have installed itself in the boot sector of the primary hard drive and will handle boot loading duties to let you decide what OS to boot up. Enjoy.

  • thanks a lot, worked like a charm, I think 1. was a good idea especially - see above why I accepted the other answer. – mart Aug 10 '13 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.