CentOS 6.x误删libc.so.6,导致重启Kernel panic - not syncing: Attempted to kill init!报错问题

CentOS 6.x误删libc.so.6,导致重启Kernel panic - not syncing: Attempted to kill init!报错问题


CentOS 6.x x64 如果失误删除系统/lib64/libc.so.6软连接文件,会导致无法执行系统命令,无法新建ssh或者直接登录系统终端。

重启系统后会提示:

Kernel panic - not syncing: Attempted to kill init!

无法正常启动进入系统。


CentOS 6.x误删libc.so.6,导致重启Kernel panic - not syncing: Attempted to kill init!报错问题_第1张图片



解决办法:

情况一:

如果还连着的ssh终端,没有断开,直接执行如下命令即可恢复:

# LD_PRELOAD=/lib64/libc-2.12.so ln -s /lib64/libc-2.12.so /lib64/libc.so.6


情况二:

ssh已经断开,无法新建新的ssh连接,重启系统,报错无法进入系统。

出现报错:Kernel panic - not syncing: Attempted to kill init!


处理办法

插入系统光盘,进入rescue救援模式,将链接文件复制到被删除的文件系统。

操作步骤如下:

1、开机进入BIOS设置,修改BOOT启动顺序为光盘优先启动 CD-ROM Drive;

2、重启系统后由光盘引导,进入安装启动菜单,选择“Rescue install system”救援模式;


CentOS 6.x误删libc.so.6,导致重启Kernel panic - not syncing: Attempted to kill init!报错问题_第2张图片

3、选择语言,保持默认English


CentOS 6.x误删libc.so.6,导致重启Kernel panic - not syncing: Attempted to kill init!报错问题_第3张图片

4、选择键盘类型,保持默认us


CentOS 6.x误删libc.so.6,导致重启Kernel panic - not syncing: Attempted to kill init!报错问题_第4张图片

5、是否启动网络,需要根据你实际情况进行选择,如果需要通过联网拷贝数据,选择YES,在这里我们选择NO;


CentOS 6.x误删libc.so.6,导致重启Kernel panic - not syncing: Attempted to kill init!报错问题_第5张图片

6、进入到Rescue界面,选择Continue


CentOS 6.x误删libc.so.6,导致重启Kernel panic - not syncing: Attempted to kill init!报错问题_第6张图片

7、系统挂载在/mnt/sysimage下 ,选择OK

(如果要到root环境下,运行 chroot /mnt/sysimage 命令,此处不需要)


CentOS 6.x误删libc.so.6,导致重启Kernel panic - not syncing: Attempted to kill init!报错问题_第7张图片
CentOS 6.x误删libc.so.6,导致重启Kernel panic - not syncing: Attempted to kill init!报错问题_第8张图片

8、选择进入模式:shell 进入命令行模式,fakd是诊断模式,reboot重启电脑,这里选择shell

CentOS 6.x误删libc.so.6,导致重启Kernel panic - not syncing: Attempted to kill init!报错问题_第9张图片

9、进入shell命令行,提示符为

bash-4.1#


CentOS 6.x误删libc.so.6,导致重启Kernel panic - not syncing: Attempted to kill init!报错问题_第10张图片

10、不要执行chroot /mnt/sysimage,因为硬盘文件系统就在该目录下,从/lib64下复制软连接即可,操作如下:

bash-4.1# cd /lib64

bash-4.1# cp -d libc.so.6 /mnt/sysimage/lib64/libc.so.6

bash-4.1# reboot

之后即可恢复正常


CentOS 6.x误删libc.so.6,导致重启Kernel panic - not syncing: Attempted to kill init!报错问题_第11张图片

你可能感兴趣的:(CentOS 6.x误删libc.so.6,导致重启Kernel panic - not syncing: Attempted to kill init!报错问题)