linux跳过文件系统检查,centos 文件系统检测错误

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重新启动即可进入系统

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值