Linux启动时出现 An error occurred during the file system check错误
报错信息:
An error occurred during the file system check.
dropping you to a shell; the system will reboot
when you leave the shell
Give root password for maintenance
(or type Control-D to continue):
这时候可以简单的输入root密码,然后执行fsck进行文件系统修复,最后重启即可。
但有时候你没有root密码怎么办?可以进入Single User mode来获得root权限,但前提是你必须在物理电脑面前。
编辑grub 第二行 "kernel ..." 后面加上 空格+1 进入单用户,还是会出现文件系统上面的错误。
这时得想办法跳过文件系统检测,可编辑grub 第二行 "kernel ..." 后面 加上 “空格 + init=/bin/bash”
下述讲述的是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.
然后文件系统修复
# fsck -y
或者
# fdisk -l 查看所有的/dev
之后依次 :
# fsck -y /dev/sda1
# fsck -y /dev/sda2
# fsck -y /dev/sda3
....
全部检查完后 ctrl+D重新启动即可进入系统