Unfortunately had to remove Linux from a dual boot machine today due to compatibility issues (shame on you hardware manufacturers). I wanted to reassign the Linux partition space back into the Windows partition. No problem, right? Maybe if you do this type of thing regularly and already have the tools at hand. This is the first time I have actually had to remove Linux, a sad day for sure, but a new set of tools for the future. Following is a brief walkthrough. (note: this was complicated by being a Eee PC meaning no CDs, USB memory devices only.)
In Brief:
- Parted Magic Live USB
- remove Linux partition
- wipe MBR from terminal
dd if=/dev/zero of=/dev/sda bs=446 count=1 - Windows/Dos Bootable USB
- xfdisk /MBR
Details of My Steps:
- Use Parted Magic to remove the Linux partition and reassign space to Windows.
- http://partedmagic.com/download.html (see 'partedMagic' from USB section)
- install toUSB instructions http://partedmagic.com/documentation/130-creating-the-liveusb.html
- This will make GRUB cranky (Grub error 22: partition deleted). Wipe the MBR with the exception of the partition table (hence 446 below).
- while still in Parted Magic launch a terminal and enter the command
dd if=/dev/zero of=/dev/sda bs=446 count=1 - as per http://www.linuxquestions.org/questions/linux-hardware-18/how-to-remove-grub-using-partedmagic-789555/#post3866148
- Now the machine just won't boot, so we need a boot disk to fix the MBR.
- using the following instructions, create a basic windows boot USB (this was the quickest and easiest method I saw)
http://forums.xbox-scene.com/index.php?showtopic=630799 - Ultimate Boot CD contains the xfdisk tool needed to fix the MBR. You can probably find xfdisk elsewhere, but since I already had UBCD... copy the xfdisk directory from UBCD to your new USB boot disk.
- Boot the PC using the new boot USB
- at the command prompt change to the xfdisk directory
- issue the command xfdisk.exe /MBR
- Remove the boot USB, reboot and all should be well.
Alternatively:
You should also be able to do roughly the same using the Windows Recovery Console to issue a fixmbr, fixboot, fdisk /MBR, fixboot c:, or bootcfg /rebuild. In my case I did the above steps while waiting for files to copy to USB so I could access the recovery console. Instructions for getting a USB bootable recovery console can be found at http://www.msfn.org/board/USB-Boot-Recovery-Console-t111986.html although I never completed the steps and cannot confirm their functionality.