1、Linux系统无法启动
原因:
(1)文件系统被破坏,由于系统突然掉电导致
(2)文件系统配置不当,比如/etc/fstab文件配置错误或丢失,一般为人员修改导致
(3)Linux内核文件丢失或崩溃,导致文件系统无法启动,一般由于内核升级错误导致
(4)系统引导程序出现问题,例如:grub丢失或损坏,人为修改导致
(5)硬盘故障
文件系统故障导致无法启动
Linux在启动时,会自动去分析和检查系统分区,如果发现文件系统有简单的错误,会自动修复,如果文件系统破坏比较严重,系统无法完成修复时,系统就会自动进入单用户模式下或者出现一个交互界面,提示用户介入手动修复,现象类似下面所示:
checking root filesystem/dev/sdb5 contains a file system with errors, check forced/dev/sdb5:
Unattached inode68338812
/dev/sdb5: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY
(i.e., without-a or -p options)
FAILED/contains a file system with errors check forced
an eror occurred during the file system check****dropping you to a shell;the system will reboot****when you leave the shell
Press enterformaintenance
(or type Control-D to continue):
give root passwordfor maintenance
从这个错误可以看出,系统根分区文件系统出现了问题,系统在启动时无法自动修复,然后进入到了一个交互界面,提示用户进行系统修复。
这个问题发生的几率很高,引起这个问题的主要原因就是系统突然掉电,引起文件系统结构不一致。一般情况下解决此问题的办法是采用fsck命令,进行强制修复
根据上面的错误提示,当按下“Control-D”组合键后系统自动重启
当输入root密码后进入系统修复模式,在修复模式下,可以执行fsck命令,具体操作过程如下:
[root@localhost /]#umount /dev/sdb5
[root@localhost/]#fsck .ext3 -y /dev/sdb5
e2fsck1.39 (29-May-2006)/contains a file system with errors, check forced.
Pass1: Checking inodes, blocks, and sizes
Pass2: Checking directory structure
Pass3: Checking directory connectivity
Pass4: Checking reference counts
Inode6833812 ref count is 2, should be 1. Fix?yes
Unattached inode6833812Connect to/lost+found?yes
Inode6833812 ref count is 2, should be 1. Fix?yes
Pass5: Checking group summary information
Block bitmap differences:-(519--529) -9273Fix?yes
…… ……/: ***** FILE SYSTEM WAS MODIFIED *****
/: 19/128520 files (15.8% non-contiguous), 46034/514048 blocks
需要注意的是,在执行fsck的时候,一定要先卸载要修复的分区,然后再执行修复操作,切记!
修复的过程会看到iNode有问题,无法修复的数据在文件系统的lost+found目录中。