如何安排表面扫描(chkdsk)以便下次重启,而不是现在?

如何安排表面扫描(chkdsk)以便下次重启,而不是现在?

问题

我刚刚进入

chkdsk d: /f /r

磁盘检查立即开始。我希望它在下次重启时运行,原因如下:

  • 我可以根据需要收拾行李离开
  • 发货后立即运行
  • 运行进程加剧现有错误的可能性较小
  • 没有竞争磁盘活动(在任何分区上),HDD 不会崩溃

现在,在我写完这个问题后,我面临着一两个小时的时间盯着屏幕,当预计到达时间 (ETA) 开始上升时,每五分钟摇动一次鼠标,因为某个计划的任务正在尝试启动。

错误答案

fsutil dirty set d:

与 chkdsk 尝试检查正在使用的卷不同,它无法设置重新启动时要执行的检查类型。

答案1

为了安排chkdsk下次重启,必须锁定要检查的驱动器,例如,将命令提示符的当前驱动器设置为同一驱动器。 打开驱动器上的文件是不够的。 此外,/x交换机必须不是被给予。

C:\Windows\system32>d:

D:\>chkdsk d: /f /r
The type of the file system is NTFS.
Cannot lock current drive.

Chkdsk cannot run because the volume is in use by another
process.  Chkdsk may run if this volume is dismounted first.
ALL OPENED HANDLES TO THIS VOLUME WOULD THEN BE INVALID.
Would you like to force a dismount on this volume? (Y/N) n

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) y

This volume will be checked the next time the system restarts.

D:\>

如果计划同时检查系统驱动器和其他驱动器,则最后请求检查系统驱动器,以便仅对其他驱动器进行一次检查。

感谢@Iain 和@peter-hahndorf。

答案2

如果您添加/x开关,它应该会执行您想要的操作,因为它将在下次重启时运行。

C:\WINDOWS\system32>chkdsk /x /f /r c:
The type of the file system is NTFS.
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) 

相关内容