I had a system with dual booting of Windows and Ubuntu. Windows was Installed First and Ubuntu Second. Now Windows is all virus- Virus and I want to format it. but once I format and reinstall windows the Bootloader won't show any options to boot into Ubuntu. The Bootloader will be of windows by default. How can I format Windows but keep the Bootloader of Ubuntu ?
This will only work if this was a GRUB dual boot. If you have used wubi to install it, then recovery is a bit harder.
First, create an Ubuntu Live CD or thumb drive.
Next, boot into the CD/Pen drive, and use the "try ubuntu" option.
Now, open the terminal and type
If you mean format Windows with the bootloader created (Assuming with Wubi) inside of it, then it is not possible (At least to my knowledge). This is because the boot loader is still inside the Windows environment and when you format that partition, well you pretty much are eliminating everything in it, including the boot part or at least a part of the boot part related to the system (In the case of a separated system partition for this).
You need and I highly recommend (Which is much better) to have the bootloader outside of the Windows environment, first for safety reasons, second for performance reasons. This is done with a LiveDVD or LiveUSB of Ubuntu. The reason behind this and also the reason (One of many as to why I do not recommend using Wubi) is because:
Right now you can download a LiveCD/LiveDVD/LiveUSB of Ubuntu and install/reinstall Ubuntu from it. This will make sure the boot part is outside the Windows environment. After testing to see you get the GRUB menu telling you which system to use (Either Ubuntu or Windows) before going to the Windows environment, then you are ready to simply format the Windows part and install it again.
This however will imply that you will need to redo the boot part since Windows is not kind when other Operating systems are in the same PC. What I would recommend then would be to: