How do I reinstall Windows 10 while keeping my dual boot configuration? [duplicate]

Solution 1:

The problem in this situation is that, if you install Windows 10, it will overwrite the MBR. Windows thinks it's the only OS in the world.

  • Install Windows using (non-pirated) Windows installation media.
  • Boot using an Ubuntu Live CD. Choose the "Try Ubuntu" option.
  • Open a terminal and type sudo grub-install /dev/sdX where sdX is your hard drive. The first hard drive is called sda, so if you only have one hard drive, replace sdX with sda.
  • Press . After the command is executed run sudo update-grub
  • After the command is executed, reboot your system and remove the live CD or USB when asked to in order to prevent booting into it.
  • Voila! You will have grub restored with both OSes.