Error 0x80070002 – 0x20009 During Windows 10/11 Setup

When you install Windows 10 or 11, the setup may fail with the error 0x80070002-0x20009.

0x80070002 – 0x20009
The installation failed in SAFE_OS phase with an error during PREPARE_ROLLBACK operation.

0x80070002 - 0x20009 error

When you run the SetupDiag tool, the SetupDiagResults.log may show the following:

Error: SetupDiag reports rollback failure found.
Last Phase = Safe OS
Last Operation = Set SafeOS boot entry as the default boot entry
Error = 0x80070002-0x20009
LogEntry: Error SP Operation failed: Set SafeOS boot entry as the default boot entry. Error: 0x80070002[gle=0x000000b7]

Setupact.log may contain the following entries:

Info SP DISKSPACEQUERY: Final disk space needed estimate: 0
Info SP Executing operation: Set SafeOS boot entry as the default boot entry
Info SP MEMORYTRACK: Total : 4217761792
Info SP MEMORYTRACK: Load : 20
Info SP MEMORYTRACK: Available for op : 3380043776
Info SP DISKSPACETRACK: Available : 30762819584
Info SP DISKSPACETRACK: Needed total : 0
Info SP DISKSPACETRACK: Needed for op : 0
Error SP CSetDefaultBootEntry: Failed to set the default boot entry. Error: 0x00000002
Info SP SetupPlatform: Global progress: 1, Phase progress: 5
Error SP Operation failed: Set SafeOS boot entry as the default boot entry. Error: 0x80070002[gle=0x000000b7]
Error SP Operation execution failed: 9. hr = 0x80070002
Error SP ExecuteOperations: Failed execution phase Safe OS. Error: 0x80070002
Error SP CSetupPlatformPrivate::Execute: Execution of operations queue failed, abandoning. Error: 0x80070002
Info Persisting diagnostics data to G:\$WINDOWS.~BT\Sources\Diagnostics\diagnostics.dat
Info Diagnostics data saved successfully
Info SP Execution phase [Safe OS] exiting with HRESULT [0x80070002]

Cause

These errors occur during partition analysis and validation, and can be caused by the presence of multiple system partitions. For example, if you installed a new system drive but left the previous system drive connected, this can cause a conflict.

The system has a SATA drive and one SSD connected. As the system performance was poor, the user added an SSD (250 GB) and installed Windows on it.

diskpart list disk

When the setup tried to update the BCD, it encountered error 0x80070002 (“ERROR_FILE_NOT_FOUND”). The setup process was unable to locate the correct EFI boot partition. The additional EFI partition (one on Disk 0 and another EFI partition on Disk 1) has confused the setup process.



diskpart list volume

As you can see from the above screenshot, there are two EFI partitions (FAT32) — i.e., Volume 4 and Volume 8 on disk 0 and disk 1, respectively.

Resolution

To resolve the errors, disconnect or temporarily disable drives that contain the unused system partition. You can reconnect the drive after the upgrade has been completed. Alternatively, you can delete the unused EFI system partition using diskpart or a third-party partition manager.

Another workaround is to enter the UEFI settings, disable the secondary hard drive, and rerun the setup. You can reenable it in the UEFI settings after finishing the setup.


One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded Winhelponline.com in 2005.

Leave a Reply