Cannot boot Windows 7 after Debian 9 install

Help with issues regarding installation of Debian

Re: Cannot boot Windows 7 after Debian 9 install

Postby cmcheong » 2018-01-22 05:41

Hi everyone,

I was having the same problem a few days back. I am running Windows 7 and after installing Debian 9, Windows 7 won't boot. I rebuilt Windows 7's MBR and tried to install Debian 9 again, same problem. I rebuilt again the Windows 7's MBR and tried to install Debian 8 which gave the same result.

After some googling I managed to solve the problem and can boot into both systems. Below is a step by step guide to solve the problem. This guide will only work assuming that you have not change your computer's MBR after installing Debian.

1. First of all, you will need to copy the partition boot record to a file. Login to Debian and start a terminal. You will need super user right to do the next step. At the command prompt type "dd if=/dev/sda of=debianboot.img bs=512 count=1" and press enter. You will see the output as bellow.
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.00223555 s, 229 kB/s
Before you do this, please verify that your Windows and Debian are install on this drive(/dev/sda). If you have more than two hard disks, this may be different. Just replace sda with whatever drive your OSes are on.

2. Copy the file debianboot.img from your root directory to C:\Boot\ (assuming your systems are installed in C drive).

3. Logout of Debian and restart your computer into Windows recovery mode with either a Windows install disk or Windows startup disk. Stop startup repair and go into command prompt. Please be advised that the next step you do will prevent you from booting into Debian. But don't worry, we will solve that after you restart Windows.

4. At the command prompt type in the following:-
bootrec /fixmbr (press enter)
bootrec /fixboot (press enter)
bootrec /rebuildbcd (press enter)

5. Exit command prompt and restart Windows.

6. After Windows has restarted, go to https://www.boyans.net to download VisualBCD (free for personal use).

7. Install VisualBCD and startup the program. When VisualBCD is opened, Right click anywhere on the left panel and select New BootSector (Linux / OS X) Loader. Click OK on the popup.

8. On the left panel click on New Linux / OS X Loader.

9. On the right panel click on the 1st elements (ApplicationDevice) and click edit button at the bottom. Select the drive letter where your Windows is install (assuming c) and click OK.

10. Click on the 2nd element and click edit. Edit the path to \Boot\debianboot.img and click OK.

11. Click on the 3rd element and change the name to Debian and click OK.

Now close the program and restart your computer and you will see the Windows boot manager where you can select Windows or Debian. When you click on Debian you will see your familiar Grub boot manager and you can boot Debian from here. I don't know what will happen if you click on the Windows selection because I didn't try that. In fact, I have deleted the Windows entry from the Grub config file (grub.cfg) because it is not needed anymore.

Please read this guide carefully and make sure you understand every step before you start to proceed with the operation. I hope this guide can help more people to enjoy using Windows and Debian at the same time. Thank you for reading.

P/S: Do not use "dd for Windows" recommended on the VisualBCD website. It didn't work for me.
cmcheong
 
Posts: 1
Joined: 2018-01-22 01:58

Previous

Return to Installation

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable