You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
# **fsck**
|
|
|
|
|
|
|
|
|
|
## 说明
|
|
|
|
|
|
|
|
|
|
**fsck命令** 被用于检查并且试图修复文件系统中的错误。当文件系统发生错误四化,可用fsck指令尝试加以修复
|
|
|
|
|
|
|
|
|
|
## 选项
|
|
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
|
-a:自动修复文件系统,不询问任何问题
|
|
|
|
|
-A:依照/etc/fstab配置文件的内容,检查文件内所列的全部文件系统
|
|
|
|
|
-N:不执行指令,仅列出实际执行会进行的动作
|
|
|
|
|
-P:当搭配"-A"参数使用时,则会同时检查所有的文件系统
|
|
|
|
|
-r:采用互动模式,在执行修复时询问问题,让用户得以确认并决定处理方式
|
|
|
|
|
-R:当搭配"-A"参数使用时,则会略过/目录的文件系统不予检查
|
|
|
|
|
-s:依序执行检查作业,而非同时执行
|
|
|
|
|
-t<文件系统类型>:指定要检查的文件系统类型
|
|
|
|
|
-T:执行fsck指令时,不显示标题信息
|
|
|
|
|
-V:显示指令执行过程
|
|
|
|
|
|
|
|
|
|
fsck返回的退出代码是以下条件的总和:
|
|
|
|
|
|
|
|
|
|
0 No errors
|
|
|
|
|
1 Filesystem errors corrected
|
|
|
|
|
2 System should be rebooted
|
|
|
|
|
4 Filesystem errors left uncorrected
|
|
|
|
|
8 Operational error
|
|
|
|
|
16 Usage or syntax error
|
|
|
|
|
32 Checking canceled by user request
|
|
|
|
|
128 Shared-library error
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## 实例
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
fsck -y /dev/hda2 # linux不正常关机可能会导致文件损坏,例如用fsck修复/dev/hda2
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|