当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] CHKDSK:如何在Windows 10中检查和修复硬盘错误?

作者:精品下载站 日期:2024-12-14 20:15:26 浏览:15 分类:玩电脑

CHKDSK:如何在Windows 10中检查和修复硬盘错误?


CHKDSK.exe(检查磁盘)是一个经典的内置 Windows 工具,用于检查硬盘驱动器是否有错误。 chkdsk 允许您检查磁盘和文件系统的物理和逻辑错误、查找坏扇区并修复发现的问题。在本文中,我们将了解在 Windows 10 中使用 chkdsk 工具的详细信息,以及使用 Repair-Volume PowerShell cmdlet 检查磁盘的方法。

Windows 10 中的 chkdsk 允许您检查和修复具有 NTFSFAT32 文件系统的硬盘驱动器。 Chkdsk 不适用于 ReFS 卷,因为它们使用不同的数据完整性技术。

如何在 Windows 10 上使用 CHKDSK 检查磁盘是否有错误?

要检查硬盘驱动器是否有错误,请运行提升的命令提示符(具有管理员权限)。然后,运行命令:

chkdsk E: /F /R

该命令将启动E:\驱动器检查,发现的错误将自动修复(/F),如果存在坏扇区,将尝试恢复数据(/R)。完整磁盘检查可能需要很长时间,具体取决于您的存储容量和文件数量。

chkdsk 工具执行四次连续传递来检查卷元数据:

  • 第一阶段——验证文件;

  • 第2阶段——验证索引;

  • 第 3 阶段 - 验证安全描述符;

  • 第 4 阶段 - 验证 Usn 日志和部门。

完成磁盘检查后,您将看到详细的磁盘统计信息、有关坏扇区和文件的信息以及恢复数据所采取的步骤。

如果 chkdsk 实用程序没有发现问题,将显示以下消息:

Windows has scanned the file system and found no problems.No further action is required.

[玩转系统] CHKDSK:如何在Windows 10中检查和修复硬盘错误?

您将无法执行在线扫描并修复系统驱动器 (C:\) 上的错误。当你运行

chkdsk C: / F / R

命令,您将看到磁盘已锁定,只能在下次 Windows 重新启动时检查:

Cannot lock current drive. Chkdsk cannot run because the volume is in use by another process.  Would you like to schedule this volume to be checked the next time the system restarts? (Y/N).

[玩转系统] CHKDSK:如何在Windows 10中检查和修复硬盘错误?

如果您想在下次启动时检查磁盘,请按

Y

->

Enter

。出现消息“下次系统重新启动时将检查此卷”。

现在,如果您重新启动 Windows,磁盘检查将开始。你需要等到它结束。

如果您想离线检查驱动器是否有错误(跳过在线检查),请使用 offlinescanandfix 选项:

chkdsk E: /f /offlinescanandfix

对系统驱动器使用离线扫描和修复选项时,系统将提示您安排在下次重新启动时进行驱动器扫描。

与以前的操作系统版本相比,Windows 10 中的离线磁盘检查速度已显着提高。

/X 是另一个有用的 chkdsk 选项。它允许您在检查卷之前通过强制关闭所有打开的文件描述符来卸载卷。

另请注意新的 chkdsk 选项 -

/spotfix

。此参数仅适用于 NTFS 卷。 spotfix 参数可以将脱机磁盘检查时间从几小时缩短到几秒。它不是完全驱动器扫描,而是仅搜索并修复先前记录在 $corrupt 文件中的错误(在正常磁盘检查期间填充)。在这种情况下,chkdsk 会立即修复错误,而不会浪费时间扫描整个驱动器。这在检查大量数据时特别有用。

不建议取消/中断 chkdsk 命令。但是,如果您手动终止 chkdsk.exe 进程,则不会损坏该卷(它不会比原来损坏更多)。无论如何,建议在一段时间后运行全盘扫描。

在 Windows 10 中,磁盘维护(检查和碎片整理)会按计划或在计算机空闲时自动执行。您可以在控制面板 -> 系统和安全 -> 安全和维护 -> 驱动器状态中找到有关自动磁盘检查状态的信息。屏幕截图显示了驱动器状态“

All drives are working properly

”。

[玩转系统] CHKDSK:如何在Windows 10中检查和修复硬盘错误?

您可以在任务计划程序 -> Microsoft -> Windows -> Chkdsk 中找到磁盘检查任务(名为 ProactiveScan),它作为 Windows 10 自动维护的一部分运行。

此外,在现代 Windows 10 版本中,还添加了存储诊断工具 StorDiag.exe(存储诊断工具)。该实用程序一次执行多个磁盘检查操作(

chkdsk

,

fsutil

fltmc

)。诊断日志可以保存为 ETW 跟踪。例如:

stordiag.exe -collectEtw -checkfsconsistency -out %userprofile%\desktop

使用 PowerShell 检查驱动器错误

PowerShell 4.0 引入了单独的 Repair-Volume 磁盘检查 cmdlet。此 cmdlet 是 chkdsk 命令的 PowerShell 替代品。

要通过 PowerShell 对硬盘驱动器执行错误在线检查,请运行以下命令:

Repair-Volume -driveletter C -scan

如果需要执行离线磁盘检查并自动修复错误,请使用 offlinescanandfix 参数:

Repair-Volume -driveletter E -offlinescanandfix

如果磁盘上没有发现错误,您将看到

NoErrorsFound

信息。

[玩转系统] CHKDSK:如何在Windows 10中检查和修复硬盘错误?

Repair-volume -driveletter E -spotfix

您可以一次检查多个本地驱动器:

Repair-Volume -DriveLetter EHI -SpotFix

Repair-Volume cmdlet 支持 CIM 会话,允许您扫描远程计算机上的驱动器:

Repair-Volume -driverletter c -scan -cimsession ny-fs01,ny-fs02,ny-dc01

您还可以使用 Storage PowerShell 模块中的 cmdlet 检查硬盘驱动器的 SMART 状态:

Get-PhysicalDisk | Sort Size | FT FriendlyName, Size, MediaType,SpindleSpeed, HealthStatus, OperationalStatus -AutoSize

[玩转系统] CHKDSK:如何在Windows 10中检查和修复硬盘错误?

在 Windows 10 中查看磁盘检查 (CHKDSK) 结果

当您执行在线磁盘检查时,您可以在 cli 控制台中看到完整的 chkdsk 统计信息。但是,如果您使用offlinescanandfix选项安排了磁盘检查,您将不会在Windows启动屏幕上看到chkdsk摘要报告。 Windows 10 启动屏幕仅显示磁盘检查完成的总体百分比。

在 Windows 7 和更早的 Windows 版本中,有关 chkdsk 操作的详细信息直接显示在启动屏幕上。

[玩转系统] CHKDSK:如何在Windows 10中检查和修复硬盘错误?

在 Windows 10 中,您只能在Windows 事件查看器中查看自动硬盘检查的结果。

通过在搜索栏中键入事件并选择事件查看器应用程序(或运行

Eventvwr.msc

命令)。

[玩转系统] CHKDSK:如何在Windows 10中检查和修复硬盘错误?

在下一个窗口中,转到Windows 日志 -> 应用程序

[玩转系统] CHKDSK:如何在Windows 10中检查和修复硬盘错误?

右键单击应用程序,然后选择查找菜单项。在搜索栏中,输入 chkdsk 并单击查找下一个

您可以通过事件源进行搜索。要在 Windows 启动时搜索磁盘检查事件,您需要启用按 Wininit 源中的事件进行过滤。对于用户启动的检查磁盘事件,请参阅 Chkdsk 源。

[玩转系统] CHKDSK:如何在Windows 10中检查和修复硬盘错误?

必须显示第一个找到的带有事件 ID 1001 和源 Wininit 的事件。在常规选项卡中,将显示包含最新磁盘检查结果的详细日志。

[玩转系统] CHKDSK:如何在Windows 10中检查和修复硬盘错误?

Checking file system on C:
The type of the file system is NTFS.
A disk check has been scheduled.
Windows will now check the disk.
Stage 1: Examining basic file system structure ...
122280 file records processed.                                                         File verification completed.
4817 large file records processed.                                     0 bad file records processed.
Stage 2: Examining file name linkage ...
184654 index entries processed.                                                       Index verification completed.
0 unindexed files scanned.                                           0 unindexed files recovered to lost and found.
Stage 3: Examining security descriptors ...
Cleaning up 788 unused index entries from index $SII of file 0x9.
Cleaning up 788 unused index entries from index $SDH of file 0x9.
Cleaning up 788 unused security descriptors.
Security descriptor verification completed.
27477 data files processed.                                           CHKDSK is verifying Usn Journal...
36724460 USN bytes processed.                                                          Usn Journal verification completed.
Stage 4: Looking for bad clusters in user file data ...
12280 files processed.                                                               File data verification completed.
Stage 5: Looking for bad, free clusters ...
6433211 free clusters processed.                                                       Free space verification is complete.
CHKDSK discovered free space marked as allocated in the volume bitmap.
Windows has made corrections to the file system.
No further action is required.
41423341 KB total disk space.
15155466 KB in 90632 files.
75328 KB in 27779 indexes.
0 KB in bad sectors.
223839 KB in use by the system.
55762 KB occupied by the log file.
25979887 KB available on disk.
4096 bytes in each allocation unit.
10354722 total allocation units on disk.
6493022 allocation units available on disk.
Internal Info:
00 f9 01 00 88 cd 01 00 a9 dd 03 00 00 00 00 00 ................
ad 00 00 00 66 00 00 00 00 00 00 00 00 00 00 00 ....f...........
Windows has finished checking your disk.
Please wait while your computer restarts.

您可以使用 PowerShell 从检查磁盘事件中获取信息。以下命令将从事件日志中导出最近 5 次磁盘检查结果,并将其作为文本文件 CHKDSK_SCANS.txt 保存到当前桌面。

Get-EventLog -LogName Application -Source chkdsk | Select-Object -Last 5 -Property TimeGenerated,Message | Format-Table -Wrap| out-file "$env:userprofile\Desktop\CHKDSK_SCANS.txt"

该文件可以在任何文本编辑器中打开。

[玩转系统] CHKDSK:如何在Windows 10中检查和修复硬盘错误?

因此,我们得到了 Windows 10 启动期间执行的磁盘检查日志。

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯