I've just installed my OSes on a new HDD: Windows 7 and Debian 7. As usual I first installed Windows, then Debian.

At the first attempt, GRUB seems to not have been installed properly, because my computer would just boot into Windows. I found this on debian.org, so I followed its advice:

When there is more than one disk available during installation (for example one hard disk and one USB stick, as it is commonly the case when booting the installer from a USB stick), grub-install may run into problems: it was reported several times, that the GRUB bootloader was installed onto the USB stick instead of the hard disk containing the newly-installed system.

To avoid running into this, make sure to answer "No" when the following question is asked during the installation process: "Install the GRUB boot loader to the master boot record?"; it should be possible to specify the right device at the next step: "Device for boot loader installation".

After I did this, GRUB would show up on boot, but when I selected Windows, the screen would go black and immediately pop back to the GRUB menu. I installed GRUB into the first partition, as that was the one with the boot flag.

My partitions are as follows:

  1. 100MB System Reserved
  2. 195GB Windows
  3. 2GB Swap
  4. 40GB Linux

I managed to fix the MBR with the Windows CD afterwards, but of course, now Debian is unavailable.

Should I have installed GRUB somewhere else, or is it a different problem ?

2 Answers 2


Assuming you're partitioning with MBR and not GPT.

First, you can backup and eventually restore your mbr (assuming hda is the target disk):

 dd if=/dev/hda of=/path/mbr-backup bs=512 count=1 # backup
 dd if=/path/mbr-backup of=/dev/hda bs=512 count=1 # restore

Obviously would be hda1 if you installed grub in the partition and not the disk.

Note if it is in the disk (hda) don't change your partition table between backup and restore.

Second, if your Debian is currently installed, just boot a Live CD and mount the Debian root somewhere:

mkdir /tmp/x
mount /dev/hda1 /tmp/x # Debian root partition
# mount some needed filesystem
mount proc /tmp/x/proc -t proc
mount sysfs /tmp/x/sys -t sysfs
mount --bind /dev /tmp/x/dev

Chroot into the partition and reinstall grub

chroot /tmp/x
grub-install /dev/hda # or hda1 for the partition

Don't know yet if you need an update-grub also (should verify)

The grub's os-prober should find your Windows, then if it doesn't boot there's some other problem in the chain loader.


If your disk is partitioned as GPT see this FAQ

Windows and GPT FAQ

in particular this one:

Can Windows 7, Windows Vista, and Windows Server 2008 read, write, and boot from GPT disks?

Yes, all versions can use GPT partitioned disks for data. Booting is only supported for 64-bit editions on UEFI-based systems.

If you have BIOS use MBR partitioning, if you have UEFI then use GPT.

  • Thanks for your answer, I finally found the time to try it out. I think the mistake I made was to install GRUB into the first partition (sdb1) instead of in the disk. When I tried to fix it, mount proc /tmp/x/proc -t procfs failed with the message: mount: unknown filesystem type 'procfs'. When I retried without specifying the type it said mount: special device proc does not exist. I am using Knoppix 7, but I don't think that should matter.
    – Oebele
    May 24, 2014 at 11:51
  • @AleStrooisma my fault, I've edited the answer, it is -t proc (or you could use --bind as for /dev)
    – Alex
    May 25, 2014 at 14:48
  • 1
    I should've figured that out myself. Anyway, I am writing this from Debian, so it worked. Feels good to be back in Linux! One issue I ran into, which might be worth mentioning in your answer, was that the live cd needed to be 64 bit in order to be able to chroot to my 64 bit debian installation.
    – Oebele
    May 26, 2014 at 10:41
  • @AleStrooisma glad it worked, enjoy your Debian! +1 for mentioning about the arch.
    – Alex
    May 26, 2014 at 13:23
  • I'm not sure having a 64 and chrooting into a 32 would fail, probably an argument for another question.
    – Alex
    May 26, 2014 at 13:32

I always recommend install bootloader on separate partition: "/boot" Later you can do different manipulations without fear of harm or corrupt main OS (Windows).

In your situation i think it would be better to reinstall Debian with new partitions + "/boot" installed bootloader. Also pay attention maybe you have GPT, but not MBR. It can be a reason.

  • I don't think a separate /boot has any relation to the risk of corrupting Windows. Plus, the recommendation of separate /boot is void without a proper rationale. May 18, 2014 at 17:09
  • I have had my PC installed like this for years, there's nothing wrong with the set-up. Normally however, GRUB installs correctly automatically, but this time I had to do it manually, because it had trouble picking the correct disk.
    – Oebele
    May 27, 2014 at 10:40

You must log in to answer this question.

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