0

I have a server on OVH with Cpanel which has 2 x 2TB partitions and its lsblk command output looks like this. http://prntscr.com/nz4xd2 A few days back I ran some upgrades and after rebooting my server didn't boot properly and halted during the boot process and displayed a prompt like this:

https://prnt.sc/nz50jf

I did some research and I was able to boot the server by running following commands at the grub prompt:

set prefix=(hd0,gpt2)/boot/grub2
set root=(hd0,gpt2)
linux (hd0,gpt2)/boot/vmlinuz-4...…… root=/dev/md2 ro
boot

Then I searched for a permanent solution for this which took me to some URLs like this https://www.linux.com/LEARN/HOW-RESCUE-NON-BOOTING-GRUB-2-LINUX which suggest to reinstall grub using commands:

# update-grub
# grub2-install /dev/sda

I am on Centos which doesn't have the command update-grub but I was able to run other commands:

[root@server2 ~]# grub2-install /dev/sdb
Installing for i386-pc platform.
Installation finished. No error reported.

after this when rebooting I got the same grub prompt again. I am not sure what is wrong here. Can anyone please suggest something?

0

CentOS is a little different from what you saw in the repair instructions. See https://wiki.centos.org/HowTos/Grub2 which is specifically for CentOS 7.

Also see https://superuser.com/questions/781300/searching-for-grub-configuration-file-in-centos-7#781352.

The grub configuration is done with grub2-mkconfig, based on the files in /etc/default/grub and /etc/grub.d

Note that when booting from a RAID-1 (which you are doing), you need to install grub on both /dev/sda and /dev/sdb. That should have already been done by the install, and you obviously have it since you got to the grub prompt in the first place.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.