Grub 0.97 hang at boot

Hi,

I have a problem here with my freepbx server hang a grub and I can see this message:

The highlighted entry will be booted automatically in 5 seconds. But nothing occur. The server can stay at this screen for days.

If I press power button and reboot, same issue.

If I connect a keyboard, and press enter, everything boot normally and works correctly. If I try to reboot after that, everything is normal and server boot normally.

Here is the screen if I press “a”

And if I press “e”

This is not the first time it happen but it’s hard to replicate and I’m searching for ideas. What can cause this or what can I do to figure out what is this problem?

Let me know what you think

Thanks

So you are trying to run (under normal circumstances) without a keyboard attached? Check the PC BIOS in case there are any settings that affect keyboard operations. Some older BIOS’s I seem to remember had settings for keyboard checks and where to ignore the absence of a keyboard or not.

If the computer is getting to the grub loader then is has passed the BIOS keyboard check.

Something else is up. Is this a FreePBX distro? It doesn’t look like one. How was this system installed?

If it does perhaps /boot/grub/grub.conf got changed so as not to default?

you’re right, it’s not an issue with the keyboard.

Yes it’s a freepbx distro that I downloaded directly on this website.

Here is what the grub.conf look like. Last time it did the issue, I added, if I remember well, the noquiet option.

grub.conf generated by anaconda

Note that you do not have to rerun grub after making changes to this file

NOTICE: You have a /boot partition. This means that

all kernel and initrd paths are relative to /boot/, eg.

root (hd0,0)

kernel /vmlinuz-version ro root=/dev/sdb2

initrd /initrd-[generic-]version.img

#boot=/dev/sdb
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
#hiddenmenu
title Schmooze (2.6.32-431.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=UUID=c7433ba2-9d75-47a6-bfd0-3a3478d3f589 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM noquiet
initrd /initramfs-2.6.32-431.el6.x86_64.img

Are you getting the splash image?

Something might be corrupt in the file along the default=1 and timeout=5 lines, those tell grub to load the first entry in the Kernel table after 5 seconds.

I think you have a crashkernel active, often caused by bad memory, explore the content of /var/crash

I dont have any /var/crash folder…
No I dont see the splash screen.
BTW I’m running on a SSD.

I’m now able to reproduce the problem. This server is running with an external power supply. If I remove the power before the power supply to simulate a power lost, I can reproduce the issue. But if I remove the power at the computer directly, it’s ok…

I commented the line for the splashimage. Nothing changed. Boot still hang…

Oh boy…Why did you comment splash image? I mentioned it because it indicates how much of the config got read. Logic…simple logic

Now, Dicko is on the right track. I am not sure why you are powering down your server without shutting down the system. If I were you I would have a small UPS connected and setup to shut down your FreePBX distro before the battery discharges.

Ok about the splash image. I thought that this file maybe was corrupt and causing this.

About the UPS, yes of course it’s a good thing to do that. But it doesnt solve my problem. It’s only a patch… The issue will still be there… I want to understand why it hang there when it shouldn’t.

This is the expected behavior if the system is shut down wrong.

A UPS will solve the problem because FreePBX has a module to do automatic shutdown before the UPS expires.

You have to boot the system in single user mode and repair the volumes.

Yes it will solve the problem but the issue is still there. Why I need to connect a keyboard and press enter to make the freepbx boot. I mean, everything work correctly. I shouldnt need to plug a keyboard and press enter to boot this freepbx. The grub isn’t supposed to hang there!

Then don’t have crashkernel=auto in your grub configuration , it’s doing what it’s supposed to do to handle the power loss, which is apparently not want you want it to do.

(perhaps this thread explains the use of kdump better . .

http://forums.cpanel.net/f34/grub-conf-file-correct-way-remove-debug-kernel-booting-384421.html

)

I think default=1 would try to boot the 0+1 = second (apparently non existant) kernel

We use KVM switches at my work to switch between servers, so they provide keyboard emulation right out of the box.

If you don’t have a KVM switch, and don’t want to leave a keyboard connected, there are a number of USB or PS2 keyboard emulators available. Just google “usb keyboard emulator” or “ps2 keyboard emulator” to see. It’s probably easier than recompiling the kernel to take that feature out.

That would do no real good, he is trying to boot a non-existent kernel and needs to fix that.

Dicko, when you say: “Then don’t have crashkernel=auto in your grub configuration , it’s doing what it’s supposed to do to handle the power loss, which is apparently not want you want it to do.”

Can you help me to understand why you say that the crashkernel is doing what it’s supposed? So it’s normal that my server hang at the grub when there is a power lost?

No, kdump should dump your kernel into a known place and your normal default=1 would next boot into the 0’th kernel on a kernel panic or other “bad things happen” event like you had a UPS that broke, which would be a debug kernel which will NOT autostart because it is for debugging, you or someone else apparently contrived to remove the second kernel which would be the standard auto starting one, and signalled a broken UPS. Rearrange your grub to default=0 and make sure that that kernel is available.