centos / cPanel server grub2 recovery steps :
1. Boot your server from a live CD
2. type fdisk -l command to find out your primary disk partition where you want to recover your grub.
3. mkdir /media/sda1
4. mount /dev/sda1 /media/sda1
5. mount --bind /dev /media/sda1/dev
6. mount --bind /proc /media/sda1/proc
7. chroot /media/sda1
8. grub-install /dev/sda
9. If you get an error, then we need to execute this command -> grub-install --recheck /dev/sda
10 After the grub installation we will exist from chroot => exit
11 umount /media/sda1/proc
12 umount /media/sda1/dev
13 umount /media/sda1
14 reboot the server
2. type fdisk -l command to find out your primary disk partition where you want to recover your grub.
3. mkdir /media/sda1
4. mount /dev/sda1 /media/sda1
5. mount --bind /dev /media/sda1/dev
6. mount --bind /proc /media/sda1/proc
7. chroot /media/sda1
8. grub-install /dev/sda
9. If you get an error, then we need to execute this command -> grub-install --recheck /dev/sda
10 After the grub installation we will exist from chroot => exit
11 umount /media/sda1/proc
12 umount /media/sda1/dev
13 umount /media/sda1
14 reboot the server