chkdsk
Check Disk or chkdsk
command is used to detect FAT16, FAT32, NTFS file system related errors, and fix them. Chkdsk can not recover corrupted files which are a hard situation. Chkdsk can be run from the command line or from GUI but the command line use is the most practical way.
Check Disk或chkdsk
命令用于检测FAT16,FAT32,NTFS文件系统相关的错误,并进行修复。 Chkdsk无法恢复损坏文件,这是很困难的情况。 可以从命令行或GUI运行Chkdsk,但是使用命令行是最实用的方法。
什么是Chkdsk? (What Is Chkdsk?)
chkdsk is a system tool which is command line based. There is also a GUI to run chkdsk command. The chkdsk command is very similar to the Linux counter part fsck command. The chkdsk command is used to verify integrity of a volume and fix logical file system errors. The chkdsk command can be used in different Windows versions like Windows XP, Windows 7, Windows 8, Windows 10 and Windows Servers.
chkdsk是基于命令行的系统工具。 还有一个用于运行chkdsk命令的GUI。 chkdsk命令与Linux计数器部件fsck命令非常相似。 chkdsk命令用于验证卷的完整性并修复逻辑文件系统错误。 chkdsk命令可用于不同的Windows版本,例如Windows XP,Windows 7,Windows 8,Windows 10和Windows Server。
句法 (Syntax)
Syntax of chkdsk is very simple. There is two types of parameters like OPTIONS and VOLUME.
chkdsk的语法非常简单。 有两种类型的参数,例如OPTIONS和VOLUME。
chkdsk OPTIONS VOLUME
OPTIONS
is used to specify the behavior of the chkdsk command.OPTIONS
用于指定chkdsk命令的行为。VOLUME
is the drive, partition, or volume we want to operate with the chkdsk command.VOLUME
是我们要使用chkdsk命令操作的驱动器,分区或卷。
打印chkdsk帮助信息 (Print chkdsk Help Information)
We can use the /?
option in order to print detailed help information about the options and usage.
我们可以使用/?
选项以打印有关选项和用法的详细帮助信息。
> chkdsk /?
In general following options are provided by the chkdsk command.
通常,chkdsk命令提供以下选项。
Parameter | Description |
---|---|
<volume> | Specifies the drive letter (followed by a colon), mount point, or volume name. |
[ [<path>]<filename> | Use with file allocation table (FAT) and FAT32 only. Specifies the location and name of a file or set of files that you want chkdsk to check for fragmentation. You can use the ? and * wildcard characters to specify multiple files. |
/f | Fixes errors on the disk. The disk must be locked. If chkdsk cannot lock the drive, a message appears that asks you if you want to check the drive the next time you restart the computer. |
/v | Displays the name of each file in every directory as the disk is checked. |
/r | Locates bad sectors and recovers readable information. The disk must be locked. /r includes the functionality of /f, with the additional analysis of physical disk errors. |
/x | Forces the volume to dismount first, if necessary. All open handles to the drive are invalidated. /x also includes the functionality of /f. |
/i | Use with NTFS only. Performs a less vigorous check of index entries, which reduces the amount of time required to run chkdsk. |
/c | Use with NTFS only. Does not check cycles within the folder structure, which reduces the amount of time required to run chkdsk. |
/l[:<size> ] | Use with NTFS only. Changes the log file size to the size you type. If you omit the size parameter, /l displays the current size. |
/b | Use with NTFS only. Clears the list of bad clusters on the volume and rescans all allocated and free clusters for errors. /b includes the functionality of /r. Use this parameter after imaging a volume to a new hard disk drive. |
/scan | Use with NTFS only. Runs an online scan on the volume. |
/forceofflinefix | Use with NTFS only (must be used with /scan). Bypass all online repair; all defects found are queued for offline repair (for example, chkdsk /spotfix ). |
/perf | Use with NTFS only (must be used with /scan). Uses more system resources to complete a scan as fast as possible. This may have a negative performance impact on other tasks running on the system. |
/spotfix | Use with NTFS only. Runs spot fixing on the volume. |
/sdcleanup | Use with NTFS only. Garbage collect unneeded security descriptor data (implies /f). |
/offlinescanandfix | Runs an offline scan and fix on the volume. |
/freeorphanedchains | Use with FAT/FAT32/exFAT only. Frees any orphaned cluster chains instead of recovering their contents. |
/markclean | Use with FAT/FAT32/exFAT only. Marks the volume clean if no corruption was detected, even if /f was not specified. |
/? | Displays help at the command prompt. |
参数 | 描述 |
---|---|
<volume> | 指定驱动器号(后跟冒号),安装点或卷名。 |
[ [<path>]<filename> | 仅与文件分配表(FAT)和FAT32一起使用。 指定您希望chkdsk检查碎片的文件或文件集的位置和名称。 您可以使用? 和*通配符可指定多个文件。 |
/F | 修复磁盘上的错误。 磁盘必须被锁定。 如果chkdsk无法锁定驱动器,则会出现一条消息,询问您是否要在下次重新启动计算机时检查驱动器。 |
/ v | 在检查磁盘时显示每个目录中每个文件的名称。 |
/ r | 找到坏扇区并恢复可读信息。 磁盘必须被锁定。 / r包含/ f的功能,并附加了对物理磁盘错误的分析。 |
/X | 如有必要,强制先卸除该卷。 驱动器的所有打开的句柄均无效。 / x还包括/ f的功能。 |
/一世 | 仅与NTFS一起使用。 对索引条目执行不太严格的检查,这减少了运行chkdsk所需的时间。 |
/C | 仅与NTFS一起使用。 不检查文件夹结构内的循环,这减少了运行chkdsk所需的时间。 |
/ l [: <size> ] | 仅与NTFS一起使用。 将日志文件的大小更改为您键入的大小。 如果省略size参数,则/ l显示当前大小。 |
/ b | 仅与NTFS一起使用。 清除卷上的不良群集列表,然后重新扫描所有已分配和可用的群集以查找错误。 / b包含/ r的功能。 将卷映像到新的硬盘驱动器后,请使用此参数。 |
/扫描 | 仅与NTFS一起使用。 在卷上运行联机扫描。 |
/ forceofflinefix | 仅与NTFS一起使用(必须与/ scan一起使用)。 绕过所有在线维修; 找到的所有缺陷都将排队等待离线修复(例如chkdsk /spotfix )。 |
/性能 | 仅与NTFS一起使用(必须与/ scan一起使用)。 使用更多的系统资源来尽快完成扫描。 这可能会对系统上运行的其他任务产生负面的性能影响。 |
/ spotfix | 仅与NTFS一起使用。 在卷上运行点固定。 |
/ sdcleanup | 仅与NTFS一起使用。 垃圾收集不需要的安全描述符数据(隐含/ f )。 |
/ offlinescanandfix | 运行脱机扫描并修复该卷。 |
/ freeorphanedchains | 仅与FAT / FAT32 / exFAT一起使用。 释放任何孤立的群集链,而不是恢复其内容。 |
/ markclean | 仅与FAT / FAT32 / exFAT一起使用。 如果未检测到损坏,即使未指定/ f ,也将卷标记为干净。 |
/? | 在命令提示符下显示帮助。 |
在系统启动时安排检查磁盘 (Schedule Check Disk At System Start)
One of the most popular use cases for chkdsk
is scheduling a check at the system startup or restart. Because we can not check system volume which is generally C:
at run time. Before mounting the volume the check operation is done.
chkdsk
最受欢迎的用例之一是在系统启动或重新启动时安排检查。 因为我们无法在运行时检查通常为C:
系统卷。 在安装卷之前,请完成检查操作。
> chkdsk /F C:
修复磁盘上的错误(Fix Errors On Disk)
File systems used to store files and folders, user data in an appropriate way. file systems have very complex structures related to their features. Shutdown down a system in an unexpected way Halting system, disk-related issues may create errors in file systems. We can simply use /F
option with the volume name which is D:
in this example.
用于以适当方式存储文件和文件夹,用户数据的文件系统。 文件系统具有与其功能相关的非常复杂的结构。 以意外方式关闭系统停止系统,与磁盘相关的问题可能会在文件系统中造成错误。 在此示例中,我们可以简单地将/F
选项与卷名一起使用D:
:。
> chkdsk /F D:
找到坏部门(Locate Bad Sector)
Disk drives store data in sectors. Each sector holds some data according to its size configuration. Disk drives can lose some of their sectors in time. This is physical damage so it can not be fixed in a physical way. We can locate and label these sectors as bad sectors and prevent them to be used by the file system. We can do this with /R
option. In this example, we check bad sectors of volume D:
磁盘驱动器将数据存储在扇区中。 每个扇区根据其大小配置保存一些数据。 磁盘驱动器可能会及时丢失某些扇区。 这是物理损坏,因此无法以物理方式修复。 我们可以将这些扇区定位并标记为坏扇区,并防止它们被文件系统使用。 我们可以使用/R
选项来实现。 在此示例中,我们检查卷D:
坏扇区D:
> chkdsk /R D:
强制卸载卷,分区或磁盘(Force Unmount Of Volume, Partition or Disk)
While doing disk related operations we need to unmount the volume in order to prevent unexpected errors. Checking mounted volumes and file systems will create conflicts. We can unmount the filesystem and volume before the operation with /X
option.
在进行与磁盘相关的操作时,我们需要卸载卷以防止意外的错误。 检查已安装的卷和文件系统将产生冲突。 在使用/X
选项进行操作之前,我们可以卸载文件系统和卷。
> chkdsk /X D:
快速检查卷,分区或磁盘(Fast Check Of Volume, Partition or Disk)
Checking the file system and disk errors may take some time. By default, chkdsk uses very detailed check procedures. But some of them are not necessary in most cases. We can prevent to use detailed checks to make check faster. We will use /I /C
for checking in a fast way.
检查文件系统和磁盘错误可能需要一些时间。 默认情况下,chkdsk使用非常详细的检查过程。 但是其中大多数情况下并不需要。 我们可以防止使用详细检查来加快检查速度。 我们将使用/I /C
快速检查。
> chkdsk /I /C D:
以详细方式检查磁盘(Check Disk In Verbose Manner)
Verbose mode provides more detailed information about the current operation. We can get details with /V
option.
详细模式提供有关当前操作的更多详细信息。 我们可以使用/V
选项获取详细信息。
> chkdsk /V D:
chkdsk GUI(chkdsk GUI)
There is a GUI for the chkdsk command. Even we can access this GUI the most practical way is right clicking on the disk or partition we want to check like below. Then we will click to the Properties
.
chkdsk命令有一个GUI。 即使我们可以访问此GUI,最实际的方法是右键单击要检查的磁盘或分区,如下所示。 然后,我们将单击“ Properties
。
Properties screen provides the Tools
tab where we can access from the Error checking
part by clicking to the Check
button like below.
“属性”屏幕提供了“ Tools
选项卡,我们可以通过单击以下“ Check
按钮从“ Error checking
部分进行访问。
We will see the followin screen where we will click to the Scan drive
button. Alternatively we can cancel by clicking to the Cancel
button.
我们将看到跟随屏幕,在该屏幕上,我们将单击“ Scan drive
按钮。 或者,我们可以通过单击“ Cancel
按钮来Cancel
。
During the disk or partition error check we will see the following screen. This screen will provide information about the current status and remaining time.
在检查磁盘或分区错误时,我们将看到以下屏幕。 该屏幕将提供有关当前状态和剩余时间的信息。
When the scan or check is completed we will see the following screen which will provide short information about the like error count etc.
扫描或检查完成后,我们将看到以下屏幕,其中将提供有关错误计数等的简短信息。
翻译自: https://www.poftut.com/windows-chkdsk-utility-tutorial-examples-fix-file-system-errors/
chkdsk