Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: jdanvers on November 11, 2007, 04:26:51 AM

Title: grub.conf = 0 bytes ( ie; its broken )
Post by: jdanvers on November 11, 2007, 04:26:51 AM
In a nutshell, I went to do the updates on my server a month or so ago to bring it up to 7.2 and (long story short) it will no restart correctly now after a restart.  The machine deposits me at a grub prompt and tells me that limited command line functionality (or something like that) is available.  In a nutshell...  I can get the machine up & running using a string of commands that I found via searching here in the forums (superfly or something like that is what the guy goes by?...  anyway.... )

Obviously this is not good as if the machine goes down, it will not come back up due to the user interaction required.  I need to get this resolved...  I've been sitting on it for a little while but as there has been another batch of patches/updates available for a week or three...  I need to update it.  I would like to get the boot issue resolved first though.

So....  A) I have searched these forums and haven't been able to find what I'm looking for.  B)  Assuming that grub gets is .conf file built via template like most everything in sme....  I'm figuring that is where the problem lies..  I don't think that I simply have to issue some voodoo like command to 're-install grub' do I as grub is clearly here - it is just brain dead as the config file is empty.  ;(

How can I get this fixed?

Thanks in advance guys....

-=- jd -=-
Title: Re: grub.conf = 0 bytes ( ie; its broken )
Post by: pfloor on November 11, 2007, 07:35:59 AM
You need to rebuild the grub.conf file.  You can do that by issuing:

expand-template /boot/grub/grub.conf


NOTE: grub.conf should have been expanded after your update when you ran:

signal-event post-upgrade
signal-event reboot

If you didn't (or don't remember if did) run those commands, you should issue the 2 commands above to expand all the templates to make sure the system is in the correct state.
Title: Re: grub.conf = 0 bytes ( ie; its broken )
Post by: slords on November 11, 2007, 05:02:27 PM
the grub.conf file isn't templated.  We do some magic on it to ensure we pick the booted kernel.  If that file got corrupt or deleted then you will need to find a way to get a good copy of that file in the right place.
Title: Re: grub.conf = 0 bytes ( ie; its broken )
Post by: cactus on November 11, 2007, 05:10:11 PM
the grub.conf file isn't templated.  We do some magic on it to ensure we pick the booted kernel.  If that file got corrupt or deleted then you will need to find a way to get a good copy of that file in the right place.
Shad would a signal-event post-install perhaps do this?
Title: Re: grub.conf = 0 bytes ( ie; its broken )
Post by: mmccarn on November 11, 2007, 05:12:17 PM
I find on my system that if I rename my existing /boot/grub/grub.conf then execute expand-template /boot/grub/grub.conf I end up with a 0 byte file.  This sounds like a bug to me...

I think you could fix your grub.conf using:
Code: [Select]
pico -w /boot/grub/grub.conf
Then copy and paste the following into it:
Code: [Select]
# 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/vg_primary/lv_root
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/smeserver.xpm.gz
foreground 000000
background 4E95D3
hiddenmenu
title SME Server (2.6.9-55.0.12.ELsmp)
        root (hd0,0)
        kernel /vmlinuz-2.6.9-55.0.12.ELsmp ro root=/dev/vg_primary/lv_root
        initrd /initrd-2.6.9-55.0.12.ELsmp.img
title SME Server (2.6.9-55.0.12.EL)
        root (hd0,0)
        kernel /vmlinuz-2.6.9-55.0.12.EL ro root=/dev/vg_primary/lv_root
        initrd /initrd-2.6.9-55.0.12.EL.img

Then run expand-template /boot/grub/grub.conf to hopefully set the correct kernel version for your system...

Also, my server has two CPUs, so I think the line 'default=0' tells my system to boot the 0th entry SME Server (2.6.9-55.0.12.ELsmp).  If you have a single CPU that does not have hyperthreading or multiple cores you may need to change 'default' to 1.

I've opened a bug on 'expand-template /boot/grub/grub.conf': http://bugs.contribs.org/show_bug.cgi?id=3545
Title: Re: grub.conf = 0 bytes ( ie; its broken )
Post by: CharlieBrady on November 11, 2007, 07:34:42 PM
If that file got corrupt or deleted then you will need to find a way to get a good copy of that file in the right place.

I don't know of it ever being corrupted. If you delete it, beat yourself around the head (so you learn never to do it again), and then upgrade by CDROM - I think that will create a new grub.conf for you.