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: