Question

Error while loading shared libraries: Invalid ELF header

Posted March 7, 2014 50.3k views
All of a sudden without change any configuration, my server suddenly restart around 4AM SGT. When I access the droplet console I get this error message. Begin: Running /scripts/init-bottom ... done. /sbin/init: error while loading shared libraries: /lib/i386-linux-gnu/librt.so.1: invalid ELF header [ 2.295850] Kernel panic - not syncing: Attempted to kill init!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
6 answers
a complete stab in the dark, but are you booting a 32 bit kernel on a 64 bit userland? that won't work.
Its a 64bit kernel 512MB Ram 20GB SSD Disk San Francisco 1 LAMP on Ubuntu 12.04
boot using the rescue kernel
mount /dev/vda
and look at /lib/i386-linux-gnu/librt.so.1
Tried mount /dev/vda or /dev/sda for my case, but it has an error of can't read '/etc/fstab': No such file .. /etc only contains the following in the rescue kernel.
console-setup
ld.so.conf
ld.so.conf.d
udev
default
modprobe.d
ld.so.cache
mtab


I also dont have the /lib/i386-linux-gnu/ directory but have this one instead /lib/x86_64-linux-gnu .. this directory contains librt.so.1
you have to mount /dev/sda somewhere, like

mkdir /mnt
mount /dev/sda /mnt

but it would be a good idea to fsck it first
fsck -yf /dev/sda
Using disk recovery I just copied all the data and transferred it to a new droplet. https://www.digitalocean.com/community/articles/how-to-recover-from-file-system-corruption-using-fsck-and-a-recovery-iso
Submit an Answer