linux断电后,出现fsck失败的解决方法

来源:互联网 发布:淘宝客推广软件哪个好 编辑:程序博客网 时间:2024/06/10 09:08

 os启动的时候,会有个检查filesystem是否正确的操作,如果发现filesystem is inconsistent,就会自动执行fsck,导致filesystem inconsistent的最主要的原因是power off,就是我们说的硬关机。

    执行fsck的时候,如果发现无法对某个分区的filesystem进行check,fsck将会failed,然后系统进入repair filesystem模式,现象为:

Finding module dependencies;  modprobe:modprobe:can't locate module block-major-3 fsck.ext3Possibly non-existent or swap device? such device or address while trying to open /dev/hdb1 /boot: clena, 41/26104 files. 12679/104391 blocks[FAILED]

*** AN error occurred during the file system check *** Dropping you to a shell; the systm will reboot

*** when you leave the shell Give root password for maintenance

(or type Control-D to continue):

Login incorrect. (Repair filesystem) 1 #

此时,输入root密码,就会进入repair filesystem命令行,在这里可以通过暂时卸载错误的或不存在的挂载目录,来使的os正常启动,启动后可以重新对某个分区进行fsck或其他操作。这里有个问题是,在repair filesystem模式下,根分区是只读的,所以无法修改/etc/fstab来卸载某个挂载点,可以通过如下命令使其可写:

          (Repair filesystem) 1 # mount -o remount,rw /

然后就可以通过vim /etc/fstab来进行修改。

这里仅仅介绍了一些原理,具体不同的应用场景对应的操作方法参见《linux断电开机后进入repair system解决方法 

原创粉丝点击