Fsck

fsck
运行在Linux上的fsck
运行在Linux上的fsck
操作系统Unix和类Unix系统
类型命令

fsckfile system consistency check)是Unix和类Unix系统上用于检查文件系统完整性的工具[1]。它类似于Windows和MS-DOS上的CHKDSK。

读音

fsck没有标准读音,可以读作"F-S-C-K", "F-S-check", "fizz-check", "F-sack", "fisk", "fizik", "F-sick", "F-sock", "F-sek", "feshk","fsk", "fix", "farsk" 或 "fusk"[2].

用法

fsck通常在作業系統启动时自动运行或由系统管理员手动运行。该命令直接作用于磁盘上的数据结构,因此fsck命令通常需要指定文件系统类型。fsck的具体行为与其实现相关,但通常有着相同的命令顺序并提供命令行界面。

大多数fsck会提供没有提示信息的自动修复模式、用户决定处理方式的互动修复模式和只检查不修复的模式。文件名无法被重建的文件会被保存在分区根目录的"lost+found"目录中。

系统管理员在认为文件系统出现问题时可以手动运行fsck。运行fsck时分区一般处于卸载或只读方式挂载状态下。

FreeBSD使用的UFS2文件系统会在后台运行fsck[3],在访问磁盘前不需要等待fsck结束。以ZFS和Btrfs为首的寫入時複製文件系统旨在避免大部分文件系统损坏的原因,因此没有传统的"fsck"工具。Btrfs和ZFS使用scrub英语Data_scrubbing来检查和修复错误。

示例

检查挂载到/usr上的分区

fsck /usr

检查使用JFS文件系统的Madam英语Madam软件RAID设备

fsck -t jfs /dev/md0

fsck.jfs /dev/md0

参见

参考资料

  1. ^ fsck(8) - Linux man page. die.net. [2013-05-07]. (原始内容存档于2013-02-11). 
  2. ^ running "fuck" twice almost gave me a heartattack · Issue #1 · nvbn/thefuck. GitHub. [2019-08-14]. (原始内容存档于2020-09-15). 
  3. ^ Running "fsck" in the Background. usenix.org. [2019-08-14]. (原始内容存档于2016-04-18). 

外部链接

文件系統
  • cat
  • cd
  • chmod
  • chown
  • chgrp
  • cksum
  • cmp
  • cp
  • dd
  • du
  • df
  • file
  • fsck
  • fuser
  • ln
  • ls
  • mkdir
  • mount
  • mv
  • pax英语pax (Unix)
  • pwd
  • rm
  • rmdir
  • size
  • split
  • stat
  • tee
  • touch
  • type英语type (Unix)
  • umask英语umask
程序
  • at
  • bg
  • chroot
  • cron
  • fg
  • kill
  • killall英语killall
  • nice
  • pgrep
  • pkill英语pkill
  • ps
  • pstree英语pstree
  • time
  • top
用户环境
  • clear
  • env
  • exit
  • history英语history (Unix)
  • id
  • logname
  • mesg英语mesg
  • passwd
  • su
  • sudo
  • uptime
  • talk英语talk (software)
  • tput英语tput
  • uname
  • w
  • wall英语wall (Unix)
  • who
  • whoami
  • write英语write (Unix)
文本编辑
  • awk
  • banner英语banner (Unix)
  • basename
  • comm英语comm
  • csplit英语csplit
  • cut
  • diff
  • dirname
  • ed
  • ex
  • fmt英语fmt
  • fold英语fold (Unix)
  • head英语head (Unix)
  • iconv
  • join英语join (Unix)
  • less
  • more
  • nl英语nl (Unix)
  • paste英语paste (Unix)
  • sed
  • sort英语sort (Unix)
  • spell英语spell (Unix)
  • strings英语strings (Unix)
  • tail
  • tr
  • uniq英语uniq
  • vi
  • wc
  • xargs
壳层内建
网络
查找
文档
  • apropos英语apropos (Unix)
  • help英语help (command)
  • man
软件开发
杂项
  • bc
  • cal
  • dc
  • expr
  • lp英语lp (Unix)
  • lpr
  • sleep
  • true和false
  • yes