10

The problem

I just entered

chkdsk d: /f /r

and the disk check started right away. I want it to run at the next restart for a number of reasons:

  • I can pack up and go as needed
  • It will run immediately after shipping
  • Less chance for running processes to compound existing errors
  • No competing disk activity (on any partition), HDD will not thrash

Right now, after I'm done writing this question, I face an hour or two of watching the screen, jiggling the mouse every five minutes when the ETA starts to climb, because some scheduled task is trying to start.

The wrong answer

fsutil dirty set d:

Unlike chkdsk when it tries to check a volume in use, this cannot set the type of check to be performed at restart.

regregex
  • 351

2 Answers2

15

To schedule chkdsk for the next restart, the drive to be checked must be locked by, for instance, setting a command prompt's current drive to the same drive. Opening files on the drive is not sufficient. Also, the /x switch must not be given.

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:\>

If scheduling a check on the system drive and other drive(s) simultaneously, request the check on the system drive last, so that the check(s) on the other drive(s) are carried out only once.

Thanks to @Iain and @peter-hahndorf.

regregex
  • 351
1

If you add the /x switch it should do what you want as it will offer to run at next restart.

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) 
user9517
  • 117,122