# OS Deployment Fails at CopyWindowsRE After Upgrading to 6.7.109

> Remove the legacy DiskPart.txt EFI workaround that makes step 19 CopyWindowsRE fail with a missing R:\Recovery\WindowsRE path.

Source: https://docs.capaone.com/capainstaller/troubleshooting/os-deployment-fails-at-copywindowsre-after-upgrading-to-6-7-109/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

## Problem

After upgrading to CapaInstaller 6.7.109, OS deployment shows an error dialog partway through the
deployment:

```
Failed to copy Windows RE Tools!

Could not find a part of the path 'R:\Recovery\WindowsRE'.
```

The client log shows the failure at step 19, `CopyWindowsRE`:

```
Inf RunInternal : ================ Step 19 - start: CopyWindowsRE ================
Inf CopyWindowsRE : Copy RE Tools
Inf Copy tools to the Windows RE Tools partition
Err deployprocess failed with task: CopyWindowsRE System.Reflection.TargetInvocationException:
Exception has been thrown by the target of an invocation.
---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'R:\Recovery\WindowsRE'.
   at Core.Deploy.CopyWindowsRE()
Err ShowMsgBoxOnFailure: Failed to copy Windows RE Tools!
```

Client logs are in `C:\Program Files\CapaInstaller\Client\Logs` on the endpoint. You can also open
them from the error dialog with **Open client log**.

The issue appears on every machine you deploy, not on one model, and it starts immediately after
the upgrade to 6.7.109.

:::caution[Clicking Ignore is not a fix]
Deployment continues past the dialog, so the endpoint finishes and looks healthy. Step 19 is the
step that copies the Windows Recovery Environment tools onto the Recovery partition, so every
endpoint deployed this way completes without those tools in place.

Service desks often miss this: they start the deployment and walk away, and the machine is
finished by the time anyone looks at it.
:::

## Cause

CapaInstaller 6.7.109 added the Microsoft-recommended partition layout for UEFI devices. CapaInstaller
now creates all four partitions itself — System/EFI, MSR, Windows, and Recovery — in the correct
order and sizes. See the [CapaInstaller changelog](/capainstaller/changelog/).

Before 6.7.109, a common workaround for a too-small EFI partition was a custom `DiskPart.txt` file
placed on the OSD point and called from the **Pre diskpart script**. That file takes over
partitioning, so the Recovery partition is never created. Step 19 then has no `R:` drive to copy
the Windows RE tools to, and fails.

The workaround is no longer needed. 6.7.109 already creates the EFI partition at the recommended
size.

## Solution

Remove the legacy `DiskPart.txt` and the call to it, then rebuild the boot image.

:::note[Before you start]
Make the changes on your **Dev** OS Deployment point first, then promote to Prod. You need access
to the CapaInstaller Console with OS Deployment permissions, and to the OSD point's file share.
:::

1. In the CapaInstaller Console, right-click your OS Deployment point and select
   **Open in Windows Explorer**.
2. Browse to the `CUSTOM` folder on the OSD point:

   ```
   <OSD POINT>\MediaMaster\Kit\uefi\amd64\extra\CUSTOM\DiskPart.txt
   ```

3. Delete `DiskPart.txt`. Check both your Dev and Prod OSD points — the file is often present on
   both.
4. Open the **Pre diskpart script** for the OSD point and remove or comment out the line that calls
   `DiskPart.txt`. See [Scripts](/capainstaller/the-capainstaller-console/os-deployment/what-is-os-deployment/scripts/)
   for where the script types live.
5. Rebuild the boot image: right-click the OSD point → **Boot Image → Create boot file…**. The
   `CUSTOM` folder is baked into `boot.wim` when the image is built, so deleting the file only
   takes effect after a rebuild.
6. When the build finishes, click **Update servers** to push the new `boot.wim` to all OSD and PXE
   servers. You can also do this later with **Boot Image → Update OSDClient Bootfiles on all
   Servers…**.
7. **Promote** the change from Dev to Prod.

Deploy a test machine. Step 19 now completes and no error dialog appears.

## Verify the Recovery partition

On a freshly deployed endpoint, confirm the Windows Recovery Environment is in place:

```
reagentc /info
```

**Windows RE status** should be `Enabled`, with a **Windows RE location** pointing at a recovery
partition. If the status is `Disabled` or the location is empty, the endpoint was deployed before
the fix and needs redeploying.

## Related

- [CapaInstaller 6.7.109 Known Issues and Fixes](/capainstaller/knowledge-base/capainstaller-6-7-109-known-issues-and-fixes/) — the other known issues in this release
- [OS Deployment and PXE Boot Issues](/capainstaller/troubleshooting/os-deployment-and-pxe-boot-issues/) — other real-world OSD and PXE boot problems
- [Disk configuration](/capainstaller/the-capainstaller-console/os-deployment/what-is-os-deployment/disk-configuration/) — the partition layouts an OSD point can use
- [Scripts](/capainstaller/the-capainstaller-console/os-deployment/what-is-os-deployment/scripts/) — the OSD script types, including Pre diskpart script
- [How to Add a NIC Driver to boot.wim for PXE Boot Failures](/capainstaller/knowledge-base/how-to-add-a-nic-driver-to-boot-wim-for-pxe-boot-failures/) — the boot image rebuild procedure in full
- [CapaInstaller changelog](/capainstaller/changelog/) — what changed in 6.7.109
