Debian fails to boot: libm.so.6 is missing in initrd
After migrating my two identical server systems (radix, vicari) from 686 to amd64 (both Debian squeeze) I encountered the following problem at the next kernel update: radix worked fine whereas vicari failed to boot:
boot/bin/sh: error while loading shared libraries: libm.so.6: cannot open shared object file: No such file or directory
The problem was obviously the initrd. Fortunately I have a serial console on this server (including BIOS access) but Murphy was with me: It took me a few hours to boot a rescue grml successfully over NFS with PXE.
I compared the initrd of both systems:
scp root@radix:/boot/initrd.img-2.6.32-5-openvz-amd64 radix scp vicari@radix:/boot/initrd.img-2.6.32-5-openvz-amd64 vicari cd radix; gzip -dc initrd.img-2.6.32-5-openvz-amd64 | cpio -id; cd.. cd vicari; gzip -dc initrd.img-2.6.32-5-openvz-amd64 | cpio -id; cd.. diff -ur radix vicari >diffs
The difference was indeed that libm.so.6 was found in lib for the (working) radix case and in lib64 in the (broken) vicari case. The difference on both systems was /etc/ld.so.config: radix has /lib as first entry whereas vicari had /lib64 as first entry. I modified /etc/ld.so.config to read something like this:
/lib include /etc/ld.so.conf.d/*.conf /lib64 /usr/lib64 /usr/X11R6/lib64
and rebuilt the initrd with
dpkg-reconfigure linux-image-2.6.32-5-openvz-amd64
The next boot was fine ...