Mount the partition your Ubuntu Installation is on. If you are not sure which it is, launch GParted(included in the Live CD) and find out. It is usually a EXT4 Partition. Replace the XY with the drive letter, and partition number, for example: sudo mount /dev/sda1 /mnt.
sudo mount /dev/sdXY /mnt
Now bind the directories that grub needs access to to detect other operating systems, like so.
Now we jump into that using chroot.
Now install, check, and update grub.
This time you only need to add the drive letter (usually a) to replace X, for example: grub-install/dev/sda, grub-install –recheck /dev/sda.
in grub.cfg
****
terminal_output gfxterm
if [ “${recordfail}” = 1 ]; then
set timeout=-1
****
-1 should be 0 .
It works.
Now the only problem is that in case of kernel update, it will execute update-grub I think, which will overwrite this change. It is not that big problem.