2019-02-26 03:13:17 +00:00
|
|
|
|
# fsck
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
> 检查或修复文件系统的完整性,运行命令时应卸载文件系统。
|
|
|
|
|
> 它是一个包装器,包含 `fsck_hfs`, `fsck_apfs`, `fsck_msdos`, `fsck_exfat`, `fsck_udf` 作为可选。
|
2024-01-31 10:20:27 +00:00
|
|
|
|
> 更多信息:<https://keith.github.io/xcode-man-pages/fsck.8.html>.
|
2019-02-26 03:13:17 +00:00
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 检查文件系统 /dev/sda,报告损坏的块:
|
2019-02-26 03:13:17 +00:00
|
|
|
|
|
|
|
|
|
`fsck {{/dev/sda}}`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 仅当文件系统 /dev/sda 是干净的时才检查它,报告任何损坏的块并以交互方式让用户选择修复每个块:
|
2019-02-26 03:13:17 +00:00
|
|
|
|
|
|
|
|
|
`fsck -f {{/dev/sda}}`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 仅当文件系统 /dev/sda 干净时才检查它,报告任何损坏的块并自动修复它们:
|
2019-02-26 03:13:17 +00:00
|
|
|
|
|
|
|
|
|
`fsck -fy {{/dev/sda}}`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 检查文件系统 /dev/sda, 报告是否已完全卸载:
|
2019-02-26 03:13:17 +00:00
|
|
|
|
|
|
|
|
|
`fsck -q {{/dev/sda}}`
|