How can I repair boot failure due to moved boot sector?

If you move the head end of the boot partition (which is the root partition, if the /boot directory is there), you must repair grub. You can do it according to the description in this link,

help.ubuntu.com/community/Grub2/Installing#Reinstalling_GRUB_2

Manual methods are described as well as the automatic method with Boot Repair. You have better control, when you use the manual methods with the command line tool grub-install.