内核破坏,linux无法启动_第1页
内核破坏,linux无法启动_第2页
内核破坏,linux无法启动_第3页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、出错提示:/bin/sh: ro:No such file ordirectory Kernel panic - not syncing;Attempted to killinit统启动流程:bios->grub->kernel->inittab->fstab->rc.sysinit->rc.local->login解决思路:2、估计的重新安装内核,因为找不到内核映射了。详细解决步骤如下: 1、重新启动机器,插入光盘,进入带网络环境的救援模式。2、把另外一个系统的 bin 目录的压缩包拷贝过来,然后解压。3、因为系统内核丢失了,所以我们需要先安装内核,

2、在安装内核时会自动生成initrda 、 cd /mnt/b 、 mkdir cdc 、mount -t iso9660 -o ro /dev/hda /mnt/cd/ (注意,使用 dmesg 命令详细查看光驱挂载的设备,我的是 /dev/hda)d 、 rpm -Uvh -force kernel-2.6.18-164.el5.i686.rpm4、安装 gruba 、 grup-install /dev/sda5、编辑 grub.conf# grub.conf generated by anaconda# Note that you do not have to rerun grub af

3、ter making changes to this file# NOTICE: You have a /boot partition. This means that#all kernel and initrd paths are relative to /boot/, eg.# root (hd0,0)# kernel /vmlinuz-version ro root=/dev/sda7# initrd /initrd-version.img #boot=/dev/sda default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz

4、hiddenmenutitle CentOS (2.6.18-164.el5)root (hd0,0)kernel /vmlinuz-2.6.18-164.el5 ro root=LABEL=/dev/VolGroup00/LogVol00 rhgb quietinitrd /initrd-2.6.18-164.el5.img注意,如果你是逻辑卷需要修改根目录的标签,我的是逻辑卷。6,重新启动系统 重新启动系统未成功,出现以下错误: mount: could not find filesystem '/dev/root' setuproot: moving /dev faile

5、d: 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 directory Kernel panic - not syncing: Attempted to kill init!经过搜索后,发现此类问题多集中在逻辑卷管理的情况,具体原因是我们在重新安装内核的 时候,没有加载一些逻

6、辑卷,解决方法如下:1) Boot with the rescue CD2) Type 'chroot /mnt/sysimage'3) 'cd /boot'4) 'mkdir newinit'5) 'cd newinit'6) 'gunzip -c ./initrd-2.6.18-164.el5.img | cpio -idmv'7) 'vi init'8) Find 'mount /sysroot'9) Delete or comment this out10) Replace

7、with 'mount -o defaults -ro -t ext3 /dev/VolGroup00/LogVol00 /sysroot' where /dev/VolGroup00/LogVol00 is the mount point for /11) ':wq' out of vi12) 'find . | cpio -quiet -c -o >./newinitrd'13) 'cd .' - you are now in /boot14) 'mv initrd-2.6.18-164.el5.img init

8、rd-2.6.18-164.el5.img.bak' - backup current initrd img file15) 'gzip -9 < newinitrd > initrd-2.6.18-164.el5.img'16) Reboot the computer without the CD再次重新启动系统,0K问题解决。7、尝试进行远程连接,因为远程服务器不允许root 直接连接,可以用普通用户进行登录,登录后执行 su - root 命令,输入密码总是提示密码错误,但是在终端直接用 root 是可以 登录的,奇怪,后来发现问题出在 su 命令上,是文件权限粘贴位的问题,因为拷贝过来的 su 命令权限如下:rootlocalhost # ll /bin/su-rwxr-xr-x 1 root root 23960 Oct 18 21:46 /bin/su正确如下:rootlocalhost # ll /bin/su-rwsr-xr-x 1 root root 23960 Oct 18 21:46 /bin/su这样就简单了,设置粘贴位如下:roo

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论