-1

My PC running Windows 7 Home Premium 64-bit suddenly fails to boot normally. I'm able to boot into Safe Mode w/ Networking, but I can't boot normally even after using msconfig.exe to disable everything. I've tried booting from the last good configuration, but that failed in exactly the same way. I disabled System Restore a long time ago so there are no restore points. I've run Malwarebytes and it didn't find anything. I've had AVG installed since day 1 and haven't had any trouble with viruses since building it. chkdsk /f reports no errors.

When I attempt to run Startup Repair, it says that it can't repair the computer automatically. Problem details:

Problem Event Name: StartupRepairOffline
Problem Signature 01: 6.1.7600.16385
Problem Signature 02: 6.1.7600.16385
Problem Signature 03: unknown
Problem Signature 04: 21200512
Problem Signature 05: ManualRepair
Problem Signature 06: 2
Problem Signature 07: NoBootFailure
OS Version: 6.1.7601.2.1.0.256.1
Locale ID: 1033

I let Startup Repair run several times, and eventually I found this in the diagnostic and repair details:

Root cause found:
---------
Unspecified changes to system configuration might have caused the problem.

Repair action: System files integrity check and repair
Result: Failed. Error code = 0x490
Time taken = 124661 ms

(The net says that 0x490 signals a bad boot sector. I've already run bootrec /fixboot and bootrec /fixmbr, both of which complete "successfully," but the problem persists.)

I decide to run sfc to fix corrupt system files. However, it fails, saying that there is a system repair pending. This seems to be confirmed by the fact that C:\Windows\winsxs\pending.xml has a lot of content (it looks like a couple hundred lines). I have read elsewhere that interfering with the repair process (e.g. deleting pending.xml) can leave the OS damaged beyond repair, and I wish to avoid reinstalling.

How do I get rid of this pending system repair so that sfc can run?

4
  • boot into the recovery options (CMD.exe) and run this command: DISM /image:C:\ /cleanup-image /revertpendingactions Mar 6, 2016 at 9:38
  • @magicandre1981: I assume you mean "D:\", to refer to the disk with the OS?
    – Tom
    Mar 6, 2016 at 19:47
  • jep. have you tried it? Mar 7, 2016 at 5:10
  • @magicandre1981: I did, and I updated my post. It looked like it worked (pending.xml is gone), but sfc /scannow still says there's a repair pending.
    – Tom
    Mar 7, 2016 at 5:42

2 Answers 2

3

The "system repair pending" message can be caused by at least two very different things:

  1. There is actually a system repair in-progress, which must be completed or rolled back before running sfc.
  2. 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.

2
  • I should mention that only in hindsight did it become clear to me that I had to address problem #2 first. I wasn't aware the "pending repair" message I was seeing could be caused by targeting the wrong drive, and it doesn't seem to be widely known. By the time I learned that, I had already run the dism command (with the correct drive letter) to roll back the pending repair operation. Regardless, running through this process in the order I describe ought to work for anyone, no matter which of the two issues applies to them.
    – Tom
    Mar 12, 2016 at 19:53
  • 1
    precisely answered. I just catch the same situation on an old machine, this answer worked perfectly. That problem occurred because the drive letters are changed on the recovery ambient (but windows worgly was reporting as pending action, when there was none pending).
    – Prado
    Jun 11, 2023 at 18:20
1

To cancel the pending operation, you have to boot into the recovery options

enter image description here

select Command Prompt and run this command:

DISM /image:C:\ /cleanup-image /revertpendingactions

When you now reboot to the Windows, Windows will remove all pending operations.

8
  • As my original post indicates, I have already tried this. dism reported success, but sfc still fails. Thanks anyway. 8)
    – Tom
    Mar 12, 2016 at 17:45
  • don't mix all question into 1. you wanted to know how to stop it. I answered this. Mar 12, 2016 at 18:36
  • You're right -- I'm combining several questions into one. I will edit the OP down to focus on reverting the pending action. However, both your comment and answer omit critical information, so I can't mark this as the answer.
    – Tom
    Mar 12, 2016 at 18:50
  • what is missing? you said my command fixed the pending issue and I SHOULD post it as answer. Mar 12, 2016 at 18:55
  • @Tom -This is an answer to the proposed question. There is no critical information from this answer.
    – Ramhound
    Mar 12, 2016 at 19:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .