Windows will overwrite the boot sector whenever you install it, upgrade it to a new version, or use tools like bootrec /fixmbr, bootrec /fixboot, or the older fdisk /mbr. In general, install Windows first, then Linux. The boot sector will stay put until you do one of the things above. (And perhaps there are also other ways to write onto the MBR.) But, if you lose GRUB, it is easily restored:
- Boot from a live CD (CD/DVD or flash drive).
- Become root or use sudo with commands below.
- List the available partitions if needed: fdisk -l
- Windows will almost certainly exist on /dev/sda1: mount /dev/sda1 /mnt
- Reinstall GRUB in the MBR: grub-install --root-directory=/mnt/ /dev/sda
- Reboot: shutdown -r now
- Restore the GRUB menu: update-grub
You could also install 100% Unix, Linux, or BSD and simply run Windows in a virtual machine if the computer is strong enough for that.
Also: your computer's BIOS may have an option to protect the boot sector.
open gparted , right click the partition that has Grub in it, go to manage flags and mark boot.