Here is an ultimate solution for all boot errors and GRUB errors in Ubuntu Linux after reinstalling windows along with Linux. All that you have to do is insert a live CD or bootable USB and go into Ubuntu live session.
Open a terminal in the live session and enter the following commands:
Open a terminal in the live session and enter the following commands: