Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
How to remove Ubuntu and put Windows back on?

I had Ubuntu installed through the Windows 7 dual boot option. Not knowing exactly what I was doing, I just deleted the files from my computer. Now each time I boot up the computer, it still asks me which operating system to boot. How can I restore Windows?

share|improve this question
add comment

marked as duplicate by Eliah Kagan, Eric Carvalho, Stephen Myall, hhlp, LnxSlck Jan 14 '13 at 12:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 3 down vote accepted

1 - Live CD

First, you'll need to boot from a Ubuntu Live CD.

2 - Resize the Windows partition

Using the Gparted Partition Editor, you can resize your Windows partition so that it uses the whole disk again, if you wish to do so.

To resize a partition in Gparted, select the disk that contains the partition in the dropdown list in the top-right corner of the Gparted main window.

Click on the partition's graphical representation, then go in the Partition menu and click on Resize/Move.

You can now resize the Windows partition by dragging its graphical representation to your desired size. Alternatively, you can also type in the exact size you want.

  • The yellow portion represents used space on the partition.

When you're satisfied, click on the Resize/Move button.

And now, to apply the resize action, go in the Edit menu and select Apply All Operations.

3 - Restore the Windows bootloader

To restore the Windows bootloader, follow these steps.

Open a terminal from the Live CD, and run the following commands:

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair
boot-repair

After a few seconds, Boot Repair's main window will open.

Select Advanced options.

In the Main options tab select Restore MBR.

In the MBR options tab, select the drive and the partition that contains your Windows installation. By default, all the options should be correct, but double-check anyways.

Finally, click on Apply.

You're done!

Reboot to test everything out. :)

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.