
I have a machine with a bios redirected serial port and after updating grub it now won't boot. The server runs the backups so it's important but users will still be able to do their jobs tomorrow if it's not working, but I'd still like to try and fix it remotely if I can. The serial port shows : GRUB loading. Welcome to GRUB! error: ELF header smaller than expected. Entering rescue mode... grub rescue> But it's redrawing the screen constantly so I can't enter any keystrokes. One theory I have is that in crashing, grub is just restarting itself over and over, but maybe someone else has another theory about it that might help? Thanks James

James Harper <james.harper@bendigoit.com.au> wrote:
The serial port shows : GRUB loading. Welcome to GRUB! error: ELF header smaller than expected. Entering rescue mode... grub rescue>
But it's redrawing the screen constantly so I can't enter any keystrokes. One theory I have is that in crashing, grub is just restarting itself over and over, but maybe someone else has another theory about it that might help?
Your theory is plausible: the header it's complaining about is presumably that of one of its own modules (I checked mine and they're "ELF relocatable"). That shouldn't crash it, though. what happens if you type a command to boot the kernel anyway, despite the redrawing of the display? Alternatively, can you enter the BIOS configuration and boot from PXE or something else that would bypass Grub? In the longer term, this would be worth setting up if there's another machine that can be used for PXE (you also have to adjust the DHCP configuration, but I'm sure you know all about it already).

James Harper <james.harper@bendigoit.com.au> wrote:
The serial port shows : GRUB loading. Welcome to GRUB! error: ELF header smaller than expected. Entering rescue mode... grub rescue>
But it's redrawing the screen constantly so I can't enter any keystrokes. One theory I have is that in crashing, grub is just restarting itself over and over, but maybe someone else has another theory about it that might help?
Your theory is plausible: the header it's complaining about is presumably that of one of its own modules (I checked mine and they're "ELF relocatable"). That shouldn't crash it, though. what happens if you type a command to boot the kernel anyway, despite the redrawing of the display?
Nothing comes up.
Alternatively, can you enter the BIOS configuration and boot from PXE or something else that would bypass Grub? In the longer term, this would be worth setting up if there's another machine that can be used for PXE (you also have to adjust the DHCP configuration, but I'm sure you know all about it already).
Now that's thinking :) I've already got clonezilla working... maybe that has a recovery console, otherwise I can organise something else to boot up! Thanks James

On Thu, Mar 08, 2012 at 11:38:03AM +0000, James Harper wrote:
I've already got clonezilla working... maybe that has a recovery console, otherwise I can organise something else to boot up!
yes, it does. standard linux virtual consoles - Alt-F2, Alt-F3, and so on gives you a bash with all the utilities you'd need, and excellent support for just about every filesystem. clonezilla makes an excellent recovery system. you can also configure it with a password for the 'user' account so you can ssh in (and then sudo to root). you just need to add the following to the "append initrd ......" line in your pxelinux cfg file. usercrypted=XXXXXXXXXXXXX ocs_daemonon="ssh" where XXXXXXXXXXXXX is the crypted password, generate with something like: echo "secretpasswordhere" | mkpasswd -s then "ssh user@hostname" (ignore/bypass the ssh warnings about the host's key changing) and sudo to root. craig ps: when you mount the root fs (and boot fs if it's separate), remember to bind-mount the /proc, /sys, and /dev directories before you chroot to it. update-grub and grub-install need them, as do fdisk, blkid, and several other tools. cz can also be configured to run a custom script (which it fetches via http), and (amongst other things), mine adds the following aliases to /etc/profile for preparing the /mnt or /target directories for chroot: alias prepare-chroot-mnt='for i in proc dev sys ; do mount -o bind /$i /mnt/$i ; done' alias prepare-chroot-target='for i in proc dev sys ; do mount -o bind /$i /target/$i ; done' e.g. the initrd for my cz line also has this: ocs_prerun1="wget http://x.x.x.x/tftp/custom-ocs-2 -O /tmp/custom-ocs-2" ocs_prerun2="sync" ocs_prerun3="sleep 2" ocs_live_run="bash /tmp/custom-ocs-2" "custom-ocs-2" is a shell script. the name is completely arbitrary. it's run immediately before the main clonezilla menu. -- craig sanders <cas@taz.net.au> BOFH excuse #426: internet is needed to catch the etherbunny

On Fri, Mar 09, 2012 at 08:53:53AM +1100, Craig Sanders wrote:
e.g. the initrd for my cz line also has this:
i meant to say "the 'append initrd' line"
ocs_prerun1="wget http://x.x.x.x/tftp/custom-ocs-2 -O /tmp/custom-ocs-2" ocs_prerun2="sync" ocs_prerun3="sleep 2" ocs_live_run="bash /tmp/custom-ocs-2"
craig -- craig sanders <cas@taz.net.au> BOFH excuse #430: Mouse has out-of-cheese-error
participants (3)
-
Craig Sanders
-
James Harper
-
Jason White