linux tips windows

Repair Windows 7 after removing a Linux partition (Dual Boot)

I have seen the appear alot in the forums of people are running a dual boot scenario on their computers, dual-booting Windows with Linux, and no longer want the Linux system. Simply removing the paritions causes Windows to longer boot. In this article I explain how you can fix this problem.

In this article, I will show you how to repair Windows 7 after removing Ubuntu 11.10. Although, this will work regardless of the distribution of Linux you are using.

When you remove the Linux partition(s) you essentially remove the boot loader and screw up the master boot record. This need to be repaired for Windows to work again.

Contents

  1. Removing the Linux Partitions
  2. Repairing Windows Boot Loader

Removing the Linux Partitions

Boot to Windows 7 and open Computer Management. Do this by either right-clicking My Computer and selecting Manage, or simple search for Computer Management from the Start Menu. Once open, select Disk Management.

Here you will see the layout of the Hard Drive. Right-click and delete the Linux partitions. In the above screenshot, the Linux partitions are the two on the right. Windows 7 partitions are the System Reserved and C: Drive.

Once you have deleted these partitions, the space will become a logical partition, indicated by the green, remove this also.

With the now Unallocated space, you can resize the Windows 7 C: Drive partition to occupy this space. Right-click on the C: partition and select Extend Partition.
This will start the wizard that will guide you through extending the partition. At the main screen it will ask you by megabye (MB) how much you want to extend the partition by. For me, I extended it for the entire of the available space. Once you have done this, Windows is now the only OS on the Hard Drive.
Repairing the Boot Loader
Once you have successfully removed the Linux partitions, we now have to repair the Windows Boot Loader. Insert and boot from you Windows 7 DVD.
At the above screen select Repair you computer. This will take to the System Recovery Options screen.
From this screen, select Command Prompt. In this scenario, the Startup Repair function does not work. Although it detects there is a problem with the system, it does not repair the Master Boot Record or the Boot Loader.
Once at the Command Prompt, type the following:
  • Bootrec /fixmbr
  • Bootrec /fixboot
These commands repair the Master Boot Record which contain information regarding the Hard drives partitions and then repairs the Windows Boot Loader.
Once these commands have completed, reboot the computer and Windows will now boot.
If this article helped you, please leave a comment below. Also consider making a donation to keep this blog going.

30 thoughts on “Repair Windows 7 after removing a Linux partition (Dual Boot)

  1. I it will not work if We have windows instalation on extended partition or not primary partition.

  2. I have done the same procedure. But it is not working.. Can you please help me?
    When I switch on my system an Error message is display as "Welcome to Grub!
    error: no such partition
    Entering rescue mode….
    grub rescue> "
    Please help me..

  3. Thanks for the comment. It really is inspiring in that way that this blog still gets it's comments and is still helping people. Thanks again.

  4. Saved my life! I had installed Centos 6.4 in my Windows laptop with dual-boot and it was running flawlessly, then I decide to assign more space so I tried to resize my Windows partition and then Hell opened. After trying to reinstall Linux (since I drop that partition) the only thing that was starting was Linux grub (command line) and nothing more since today.

    Thanks a lot.

  5. Glad I could help. CentOS is a good OS and I often recommend it for server-based systems, but still good as a desktop. All the best.

  6. Thanks a lot buddy,it reali helped me…IF u knw the number of hours me and my buddies spent on this issue,your the bomb

  7. Thank you very much!!!
    Pooched my Win7 after updating Kubuntu – in VirtualBox… I set VB to run the existing Kubuntu partition (because dual-booting is a PITA and soooo-1999), but the VDMK refers to the whole disk instead of just the partition (yes. not good, but it didn't work otherwise.
    So Win7 booted up fine – but I expected Kubuntu to be screwed up, but no, it came up fine too!

    So Double-Thanks to you.

    Jim Giordano

  8. Thank you sir! It worked!!
    wanted to get rid of ubuntu 12.04 ,
    created a recovery disk
    deleted partition
    used the recovery cmd but the blog i was refering never mentioned about bootrec /fixboot hence got stuck on
    no such partition
    grub rescue>
    Thanks to your post i got my windows back!

  9. I haven't had a computer shipped with a disc in awhile. I have no disc. So far, my only solution has been to reinstall Linux on about five gigs of the HD so Windows can boot again. Which is annoying. I'll try going into the built in Windows repair this time.

  10. Thanks – this helped me also – I figured all the first stuff out – it was the fixing win7 boot that caused me the problems… Those command lines fixed the problem.

Leave a Reply

Discover more from Daniel Bs Tech Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading