Koozali.org: home of the SME Server

grub.conf = 0 bytes ( ie; its broken )

Offline jdanvers

  • ***
  • 53
  • +0/-0
    • http://www.bikeguy.myip.org
grub.conf = 0 bytes ( ie; its broken )
« 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 -=-
-=- jd -=-

Offline pfloor

  • *****
  • 889
  • +1/-0
Re: grub.conf = 0 bytes ( ie; its broken )
« Reply #1 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.
In life, you must either "Push, Pull or Get out of the way!"

Offline slords

  • *****
  • 235
  • +3/-0
Re: grub.conf = 0 bytes ( ie; its broken )
« Reply #2 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.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs,
and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." -- Rich Cook

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: grub.conf = 0 bytes ( ie; its broken )
« Reply #3 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?
« Last Edit: November 11, 2007, 05:15:05 PM by cactus »
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline mmccarn

  • *
  • 2,656
  • +10/-0
Re: grub.conf = 0 bytes ( ie; its broken )
« Reply #4 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

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: grub.conf = 0 bytes ( ie; its broken )
« Reply #5 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.