7

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
  • 181
  • 1
  • 1
  • 7

2 Answers2

11

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
  • 181
  • 1
  • 1
  • 7
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
  • 114,104
  • 20
  • 206
  • 289
  • C: is the system drive which is always in use during the session. I specified drive D: and it did not give me the prompt, even when I gave /x. – regregex Aug 24 '16 at 22:06
  • What about opening some file handles on `D:`, just open files in `notepad` or `Word` and try again. – Peter Hahndorf Aug 24 '16 at 22:10
  • Just open a file on D: then or possibly open your command window and change disks to it `D:`. C'mon start thinking for yourself. – user9517 Aug 24 '16 at 22:11
  • @peter-hahndorf Only typing D: at the command prompt locks the drive. Thanks both of you. – regregex Aug 24 '16 at 22:22