问题描述:在CentOS 6.4 上执行reboot命令之后,系统启动失败,不能连接。去服务器机房,插上显示器与键盘,屏幕给出报错信息如下:
“setting up logical volume management: /sbin/lvm : error while loading shared libraries:
ibreadline.so.6:cannot open shared object file :no such file or directory”
解决办法:
查看/lib/下的有可能有libreadline.so.6 ,可以做一个软链接下载ncurses-5.6.tat.gz,进去编译安装。然后下载readline-5.2.tar.gz,解压cd到其目录执行一定要按照下面第顺序,否则可能不成功。
$./configure --prefix=/usr --with-ncurses
$cd shlib
把Makefile里的SHLIB_LIBS = 改为 SHLIB_LIBS = -lncurses
$make
$sudo make install
$cd ..
$make
$sudo make install
解决之后 用ldd命令探测 ldd /sbin/lvm
linux-vdso.so.1 => (0x00007fff3e7ff000)
libudev.so.0 => /lib64/libudev.so.0 (0x00000039b5c00000)
libdl.so.2 => /lib64/libdl.so.2 (0x00000039ad400000)
libdevmapper-event.so.1.02 => /lib64/libdevmapper-event.so.1.02 (0x00000039ad000000)
libdevmapper.so.1.02 => /lib64/libdevmapper.so.1.02 (0x00000039b7800000)
libreadline.so.6 => /usr/lib/libreadline.so.6 (0x00007fa8d90a0000)
libc.so.6 => /lib64/libc.so.6 (0x00000039acc00000)
/lib64/ld-linux-x86-64.so.2 (0x00000039ac800000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00000039ae800000)
libsepol.so.1 => /lib64/libsepol.so.1 (0x00000039b6800000)
libncurses.so.5 => /lib64/libncurses.so.5 (0x00000039ae400000)
libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00000039af400000)
发现 lvm命令依赖的共享库 libreadline.so.6已经找到,问题解决,系统成功启动。去/usr/lib路径,发现libreadline.so的连接情况如下。
[root@ lib]# ll |grep libread
lrwxrwxrwx. 1 root root 16 2月 12 14:00 libreadline.so -> libreadline.so.6
lrwxrwxrwx. 1 root root 18 2月 12 14:00 libreadline.so.6 -> libreadline.so.6.3
-r-xr-xr-x. 1 root root 680132 2月 12 14:00 libreadline.so.6.3
参考文章: