红联Linux门户
Linux帮助

Linux启动时出an error occurred during the file system check

发布时间:2017-03-14 14:48:03来源:blog.csdn.net/hongchangfirst作者:hongchangfirst
启动Linux时,出现:
an error occurred during the file system check.
dropping you to a shell; the system will reboot
when you leave the shell
warning security enforcement for system recovery
run'setenforce 1'to reenable
give root password for maintenance
(or type Control-D to continue):
 
这时候可以简单的输入root密码,然后执行fsck进行文件系统修复,最后重启即可。
 
但有时候你没有root密码怎么办?可以进入Single User mode来获得root权限,但前提是你必须在物理电脑面前。
 
下述讲述的是GRUB引导方式怎么获取Single User Mode,RHEL5 and Ubuntu use GRUB.
Press 'ESC' at the boot prompt.
In a RHEL5 guest OS on Ubuntu, you'll have to select the Linux Client and press 'e' to edit.
Press 'e' to edit the currently selected boot entry.
Use the arrow keys to select the 'kernel' line, then press 'e' to edit the line.
Add space to the end of the line and then append ' init=/bin/sh' to the line. (without quotes)
Press 'enter' to leave the editing screen, then 'b' to boot.
This doesn't run init, so you won't have anything mounted aside from the root partition, and that will be read-only. You must correct these things manually.
 
然后你就进入了sh,是root权限:
/sbin/fdisk -l
 
然后就可以执行fsck了:
/sbin/fsck  /dev/sda1
/sbin/fsck  /dev/sdb1
 
reboot
If 'reboot' command gives error : "/dev/initctl no such file or directory", 
then do "mkfifo /dev/initctl; reboot -f"
 
ok了。
 
本文永久更新地址:http://www.linuxdiyf.com/linux/29172.html