Grub prompt after 'yum update' (CentOS 6.9)

General support questions
salvazo
Posts: 5
Joined: 2017/10/28 15:09:16

Grub prompt after 'yum update' (CentOS 6.9)

Postby salvazo » 2017/10/28 15:39:08

Hi,

It seems the system can't boot correctly after running a yum update and grub prompt appears. I'm not sure but maybe memory was exhausted in the process. The thing is I don't know what is the real issue and how to solve it. When I try with these commands:

grub>boot
Error 8: Kernel must be loaded before booting

grub>root (hd0,0)
Filesystem type is ext2fs, partition type 0x83

I've checked some topics in the forum with no success.

Any help will be appreciated.

Many thanks

User avatar
TrevorH
Forum Moderator
Posts: 21171
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Grub prompt after 'yum update' (CentOS 6.9)

Postby TrevorH » 2017/10/28 15:46:10

Boot your system from the install media in rescue mode and get it to mount your system filesystems under /mnt/sysimage and check the content of /mnt/sysimage/boot/grub/grub.conf - also check if there any similarly named files there that might be useful as backup copies if the correct one is missing entirely (which it sounds like it is).
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

salvazo
Posts: 5
Joined: 2017/10/28 15:09:16

Re: Grub prompt after 'yum update' (CentOS 6.9)

Postby salvazo » 2017/10/28 16:16:27

Hi TrevorH,

I don't have a CD or similar for booting purposes. It's a server from vultr and this was the response from them: "the instance seems to be sitting at a grub prompt, you will need to access the host from the console and troubleshoot the issue from there".

Thanks for your help

User avatar
TrevorH
Forum Moderator
Posts: 21171
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Grub prompt after 'yum update' (CentOS 6.9)

Postby TrevorH » 2017/10/28 17:21:52

That's going to be tricky. From the grub command prompt you will need to enter what was on the grub menu. This is what one entry for me looks like but it'll need to be adjusted for your set up, the kernel and initramfs file names may be different, the other parameters on the kernel line will almost certainly be different too - things like the VG and LV names too. For filenames, grub wil help as it autocompletes filenames using the tab key and/or shows you possible matches

Code: Select all

title CentOS (2.6.32-696.13.2.el6.x86_64)
        root (hd0,1)
        kernel /vmlinuz-2.6.32-696.13.2.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS  KEYBOARDTYPE=pc KEYTABLE=uk LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=0@0 rd_LVM_LV=VolGroup/lv_root rd_NO_DM
        initrd /initramfs-2.6.32-696.13.2.el6.x86_64.img
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

salvazo
Posts: 5
Joined: 2017/10/28 15:09:16

Re: Grub prompt after 'yum update' (CentOS 6.9)

Postby salvazo » 2017/10/28 18:21:20

How can I see the kernel name??

If I use:

Code: Select all

Kernel / [+TAB]


I can see:

Code: Select all

possible files are: lost+found dev proc sys var tmp etc root selinux lib64 bin boot home lib media mnt opt sbin srv usr .autorelabel . autofsck scripts razon-agent.log backup quota.user private

User avatar
TrevorH
Forum Moderator
Posts: 21171
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Grub prompt after 'yum update' (CentOS 6.9)

Postby TrevorH » 2017/10/28 23:02:37

Start by getting it to look in /boot where is where kernels (filenames starting vmlinuz) and initramfs files are kept. You'll need to make sure that the initramfs file you pick has the exact same version number as the vmlinuz file you use.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

salvazo
Posts: 5
Joined: 2017/10/28 15:09:16

Re: Grub prompt after 'yum update' (CentOS 6.9)

Postby salvazo » 2017/10/29 01:42:40

With:

Code: Select all

/boot + TAB


Nothing happens

salvazo
Posts: 5
Joined: 2017/10/28 15:09:16

Re: Grub prompt after 'yum update' (CentOS 6.9)

Postby salvazo » 2017/10/29 02:17:18

With grub> setup (hd0)

Code: Select all

Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 27 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+27 p (hd0,0)/boot/grub/stage2
/boot/grub/grub.conf"... succeeded
Done.