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

启动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://blog.csdn.net/hongchangfirst/article/details/52044797

作者:hongchangfirst

hongchangfirst的主页:http://blog.csdn.net/hongchangfirst




  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值