How do I remove a Linux partition and expand the Windows partition to consume the Linux partition space?

Posted on

Problem :

I partitioned my hard drive to dual boot Linux Mint 9 and Windows 7. Now I’d like to remove the Linux Mint partition (and increase the size of the Windows 7 partition).

I’ve Googled for some instructions, but they all seem to differ in what I should use to solve the problem I might encounter after the removal.

So, I am seeking advice from this community as I trust it the most.

This seems to be the best set of instructions I’ve found online: http://www.linuxforums.org/forum/ubuntu-help/114705-want-remove-linux-mint.html. Before I venture on, are there updated, perhaps simpler ways of removing the Linux partition?

Solution :

Removing linux is fairly simple.

  1. Use a tool like GPartEd to remove the linux partition. Do not expand the Windows partition yet – expanding NTFS partitions can cause issues, and it’s best to only have one thing broken at a time.
  2. Since your computer was configured to boot using GRUB, and you’ve just deleted the partition that GRUB resided in, your computer will be nonbootable after you remove the partition – GRUB will fail with a nondescript error. Don’t worry about this, and carry on to the next step
  3. Get your Windows 7 install disk. You need a retail disk, upgrade disk, or media from your manufacturer that is actually Windows 7 media – you do not want a disc with proprietary recovery software, which unfortunately some manufacturers now ship. If the disc is labeled as “Windows 7”, it should be the right kind, even if it’s not in the normal Microsoft styling (OEMs press their own install discs, so it may be a standard install disc but have a different label from your OEM). To check for sure, before you change anything on your computer, boot from the disc. You should get a Windows 7-style screen asking you what language you want to proceed in.
  4. Boot from the disc (keep in mind that you have to hit a key when it says “press any key to boot from disc…”, I usually miss this and have to try again), click Next on the language screen (it defaults to English), and on the next screen look in the lower right – there will be a link. I believe it says “Startup Recovery”, but it may also be “Repair”. Click that. If you are asked how to proceed, select “Startup Recovery.” You’ll stare at a progress bar for a while while the Windows installer automatically restores the standard Windows bootloader.
  5. When your computer reboots, it should start Windows 7. If it doesn’t repeat step 4 again, it may take a couple of Startup Recovery cycles.

You could use Gparted to delete the partition and to resize the Windows partition. Then use EasyBCD to set Windows 7 as the default boot OS, or the Windows 7 disk to “repair” its boot.

I’m posting an alternate solution, because grub didn’t boot (it went to grub rescue prompt) windows and my win7 disc was saying the version installed was not compatible (I think because the disc was in english and the installed version in hebrew)

Solution using mint 11 live cd

1 – boot to mint using the live cd
2 – open gparted
3 – select the swap partition and swapoff
4 – delete the partitions related to linux
5 – download and install ms-sys
5.1 – go to http://ms-sys.sourceforge.net/
since I couldn’t find the password for the root user, and it may vary depending on the release you can just change it with:
sudo passwd root
5.2 just follow his instructions:
Step 1, unpack the archive:

tar -xzvf ms-sys*.tgz

Step 2, compile:

cd ms-sys
make

Step 3, become root and install

su (and give password)
make install
6 – run ms-sys from the terminal
ms-sys -7 /dev/sda

note that this depends on your system, in my case it is windows 7 so I used ‘-7’ and my device is on /dev/sda, while this is probabiliy your case you can check with ‘sudo fdisk -l’ to find your device path

Leave a Reply

Your email address will not be published. Required fields are marked *