What if mistakenly you delete all the files from /boot partition or files got corrupted due to some reason !
Step 6 : Next we will install 3 mandatory packages from the CentOS 7 iso:
Mount iso to a folder,
# mount /dev/cdrom /mnt
# cd /mnt/Packages
# rpm -ivh --force kernel-3.10.0-957.el7.x86_64.rpm
# rpm -ivh --force grub2-2.02-0.76.el7.centos.x86_64.rpm
# rpm -ivh --force centos-logos-70.0.6-3.el7.centos.noarch.rpm
Note: In case if you are trying to recover /boot on RHEL 7 then you will find "redhat-logos*.rpm" in-place of "centos-logos-70.0.6-3.el7.centos.noarch.rpm" package.
Step 7 : Install grub2 on the boot disk:
# grub2-install /dev/sda
In case you have multiple disks and you don't know on which disk you have /boot partition then use:
# cfdisk /dev/sda
Check all the disks one by one if /dev/sda is not the one you are looking for.
Step 8 : Once grub2 is installed on the disk then, then the last pending thing is to generate "grub.cfg":
# grub2-mkconfig -o /boot/grub2/grub.cfg
Once done, exit from the chroot and again exit to reboot the server.