1

I am running Ubuntu 12.04 LTS LAMP server, and it won't boot. This problem started when I was trying to clean up /root and accidentally deleted all of the kernels using apt-get remove. I was able to restore the latest kernel, but now I get "ELF Header Smaller Than Expected" when I try to boot from the hard drive. This system has a 2 TB drive, so it uses LVM. I restored the kernel by using the instructions on this page How to restore a system after accidentally removing all kernels? but I also had to use the instructions on this page in order to mount the file system using LVM2 and do a chroot: http://linuxwave.blogspot.com/2007/11/mounting-lvm-disk-using-ubuntu-livecd.html

After restoring the kernel and getting the grub error, I tried using https://help.ubuntu.com/community/Boot-Repair. I booted from the live CD, mounted the file system, chrooted to it, and installed and ran Boot-Repair. That didn't solve the problem.

I also tried doing this while chrooted to the file system:

rm -rf /boot/grub/*
apt-get install grub    
grub-install /dev/sda
update-initramfs -c -k all
update-grub

The problem persists. What do you need to see to help me solve the problem?

Update Here's the information from boot-repair:

http://paste.ubuntu.com/6451685/

1 Answers1

0

You did the worst possible approach trying to fix the system, you removed the kernels along with everything that allowed you to boot and to make things better that wouldn't have fixed your ELF problem. If you have internet in the chroot environment do the following:

sudo apt-get install debsums
debsums -s

This will produce a list of packages. Do the following with all of them:

sudo apt-get --reinstall install package1 package2 package3

Once you have done this, repair your GRUB:

sudo apt-get purge grub-common grub-gfxpayload-lists grub-pc grub-pc-bin grub2-common
sudo apt-get install grub-common grub-gfxpayload-lists grub-pc grub-pc-bin grub2-common

From there we could try to fix your ELF problem.

Braiam
  • 69,112