LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Centos refuse to boot with elf header error! (https://www.linuxquestions.org/questions/linux-general-1/centos-refuse-to-boot-with-elf-header-error-4175456644/)

mr_aliagha 04-03-2013 02:19 AM

Centos refuse to boot with elf header error!
 
Recently, after a power supply crash problem, my linux machine (Centos 5.8 X64) did not boot neither gnome nor shell. On gnome startup it shows this error: /etc/X11/prefdm: line 16: :/etc/sysconfig/desktop: cannot execute binary file /usr/bin/rhgb-client: error while loading shared libraries: /usr/lib64/libpopt.so.0 invalid ELF header

I tried rescue disk, but it couldnt recognize my OS! I am pretty sure that the hard disk is healthy. could somebody please help me for booting this machine? i have some important services running on this machine which i need it fast.
Best Regards.

rnturn 04-03-2013 05:20 PM

Quote:

Originally Posted by mr_aliagha (Post 4924084)
/etc/X11/prefdm: line 16: :/etc/sysconfig/desktop: cannot execute binary file /usr/bin/rhgb-client: error while loading shared libraries: /usr/lib64/libpopt.so.0 invalid ELF header

Corrupted file, perhaps? I can easily see a power supply failure causing a file corruption. (I had such a failure manage to corrupt "init" some years ago. Fixing that was, um, interesting.) The hard disk may be physically fine. Corrupted files are definitely a possibility. Even if you are able to fix the corrupted library file, there could be others that got scribbled on when the PS failed.

BTW, the file referenced in the error message, is actually a symbolic link to the file libpopt.so.0.0.0. (I'll refer to that file from hereon as it's the file that you'll need to be looking at.)

Quote:

I tried rescue disk, but it couldnt recognize my OS! I am pretty sure that the hard disk is healthy.
What do you mean that you tried the rescue disk? What do you mean by "it couldnt recognize my OS"?

Surely you have a bootable CD that you can use to boot the system. The CD that was used to install Linux on the system nearly always has a "repair" option. If so, use/select the "rescue" option. NOTE: Stay far, far away from the "Installation" option. If it's a "live" CD that allowed you to preview Linux before installing, that should be fine, too. (I've never seen a Live CentOS CD but I would be surprised if one didn't exist.) If you have neither one, you may be sunk until you find one or the other.

Let's assume, though, that you are able to get a Linux booted from the CD. Once you get that system booted, perform an "fsck" on the affected filesystem. This is the one containing the /usr/lib64 directory where the "libpopt.so.0" is located. It'll likely be on "sda". In fact, I would run "fdisk -l /dev/sda" to list all the Linux partitions on the disk and then run "fsck" on each Linux filesystem (for example, "e2fsck /dev/sda1"). You should verify that you have uncorrupted filesystems before doing any further recovery. (If you have multiple disks, it would be a good idea to verify all the Linux filesystems on those disks as well.)

Hope this helps get you started on recovery. Please post your results and we can move on to figuring out what can be done about the probably-corrupted library file.

--
Rick


All times are GMT -5. The time now is 04:09 AM.