The "system repair pending" message can be caused by at least two very different things:
- There is actually a system repair in-progress, which must be completed or rolled back before running
sfc
. sfc
is attempting to fix system files on the wrong drive.
In my case, both problems applied.
I had to address problem #2 first. The correct command is:
sfc /scannow /offbootdir=X:\ /offwindir=Y:\Windows
Where:
X
is the system volume (often named "System Reserved") Y
is the volume where Windows is installed
You need to use diskpart
to figure out what the correct letters are. Even if Windows is normally installed on C:\
(which it often is), drive letters can be assigned differently in the Windows Recovery Environment (WRE).
From the command prompt in the WRE:
> diskpart DISKPART > list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ----------- ------- --------- ------- Volume 0 C Old Games NTFS Partition 465 GB Healthy Volume 1 D NTFS Partition 59 GB Healthy Volume 2 FAT32 Partition 100 MB Healthy Hidden Volume 3 E Storage NTFS Partition 931 GB Healthy Volume 4 F Games NTFS Partition 476 GB Healthy Volume 5 G Traffic NTFS Partition 297 GB Healthy
Based on their sizes, I recognize Volume 1 as the primary volume where Windows is installed (aka my usual C:
drive, a 60 GB SSD), and Volume 2 as the system boot volume (which is often labeled "System Reserved," and is apparently always 100 MB). Importantly, Volume 2 doesn't have a drive letter, which means we can't refer to it in the sfc
command. We can assign a drive letter like so:
DISKPART > select volume 2 DISKPART > assign letter=b: # now that we're done, exit back to DOS DISKPART > exit
Now we're ready to run sfc
with the correct values:
sfc /scannow /offbootdir=B:\ /offwindir=D:\windows\
At this point, I still receive the "system repair pending" error, so we need to use dism
to resolve it. The command is:
dism /image:X:\ /cleanup-image /revertpendingactions
Where X
is the volume where Windows is installed. We already know that's D:
, so we can run:
dism /image:D:\ /cleanup-image /revertpendingactions
For dism
to finish the job, you have to reboot.
While this didn't fix my boot issues, it did allow sfc
to run.
NOTE: Again, drive letters being different in the WRE can interfere with sfc
logging, which attempts to log to C:\Windows\Logs\CBS\CBS.log
. If, like me, your Windows volume isn't assigned to C:
in the WRE, you can temporarily override the log path with this command:
> set WINDOWS_TRACING_LOGFILE=D:\Windows\Logs\CBS\CBS.log
(Again using a drive letter chosen by consulting diskpart
.)
The effect of this command only lasts until you exit the command prompt. Also, sfc
will not create any directories for you, so if you decide to store the logs somewhere else, e.g. C:\i_just_made_this_folder_up\mylog.txt
, you need to manually create the i_just_made_this_folder_up
folder before running sfc
.