意外停電一次,CentOS啓動時報如下錯誤:
unexpected inconsistency;RUN fsck MANUALLY
An error occurred during the filesystem check
Propping you to shell the system will reboot
when you leave the shell
Give root password for mantennance
1、按提示,輸入root用戶的密碼,進入命令行界面
# mount |grep "on /"
3、修復文件系統
# fsck -y /dev/sda2
這裏的/dev/sda2就是步驟2中讀取到的
-y 選項指定檢測每個文件是自動輸入yes4、修復boot分區
(其實可以直接reboot,如果重啓後仍然報錯則執行此步驟)
# fsck -y /dev/sda1
5、修改auditd日誌文件的權限
(這一步和步驟4一樣,如果重啓報錯才需執行此步驟)
# chown root.root /var/log/audit/audit.log
# chmod 600 /var/log/audit/audit.log
6、重啓
# reboot
注:fsck掃描文件系統時一定要在單用戶模式、修復模式或把設備umount後進行