转载 http://bbs.chinaunix.net/forum.php?mod=viewthread&tid=4216398&extra=page%3D1%26filter%3Dauthor%26orderby%3Ddateline%26orderby%3Ddateline
前几天服务器挂了,重启后不能进入系统并提示不能挂载Root,于是想通过系统盘进入救援模式重新安装Kenerl是否可行:错误提示:
[color=rgb(51, 102, 153) !important]复制代码
操作有风险,请先进行备份
前几天服务器挂了,重启后不能进入系统并提示不能挂载Root,于是想通过系统盘进入救援模式重新安装Kenerl是否可行:错误提示:
- Unable to access resume device (LABLE=SWAP-sda2)
- Mount: could not find filesystem '/dev/root'
- setuproot: removing /dev failed : no such file or directory
- setuproot: error Mounting /proc : no such file or directory
- setuproot: error Mounting /sys: no such file or directory
- switchroot: Mount failed: no such file or direct
- Kernel panic - not syncing: Attempte to kill init!
[color=rgb(51, 102, 153) !important]复制代码
- 1.插入centos光盘从光驱启动
- 2.输入linux rescue进入救援模式
- http://cupic.img168.net/bbsfile/forum/201512/21/123526nw1d3n35nwniigqz.png
- 3.直接按Enter进入下一步
- http://cupic.img168.net/bbsfile/forum/201512/21/1203149u9f2ueqzlvdegwv.png
- 4.直接按Enter进入下一步
- http://cupic.img168.net/bbsfile/forum/201512/21/1203148rxup008bvol22pl.png
- 5.选择No,进入下一步
- http://cupic.img168.net/bbsfile/forum/201512/21/120315crr0psda0doa5xbc.png
- 6.救援模式默认把系统根目录挂载到/mnt/sysimage目录下,选择Continue按Enter进入下一步
- http://cupic.img168.net/bbsfile/forum/201512/21/120315gdtto7pu7g7wpi3x.png
- 7.按Enter进入下一步
- http://cupic.img168.net/bbsfile/forum/201512/21/120315i4y2a09af7j4z425.png
- 8.把工作目录切换到根目录下,备份boot/下的initrd*
- chroot /mnt/sysimage
[color=rgb(51, 102, 153) !important]复制代码
- chroot /mnt/sysimage
- http://cupic.img168.net/bbsfile/forum/201512/21/1203168zjggkr8rmirj2m6.png
- 9.然后输入exit退出根目录并建立文件夹1,把光驱挂载到1上,(hdc是我的光驱)
- mkdir /1 && mount /dev/hdc /1
[color=rgb(51, 102, 153) !important]复制代码
- mkdir /1 && mount /dev/hdc /1
- http://cupic.img168.net/bbsfile/forum/201512/21/120316rmbebs9elebhdl7x.png
- 10.安装kernel
- cd /1/Centos
- rpm -ivh kernel-2.6.18-238.el5.i686.rpm --root=/mnt/sysimage/ --force --nodeps
[color=rgb(51, 102, 153) !important]复制代码
- cd /1/Centos
- http://cupic.img168.net/bbsfile/forum/201512/21/123526m573u6oj5u6ml8s2.png
- 11.修复完成,重启就ok了
编辑回复