From 6532fcae7eca70c6a5cb18465a4a6dc73ac80878 Mon Sep 17 00:00:00 2001 From: Alan Baghumian Date: Wed, 27 Nov 2024 20:44:11 +0100 Subject: [PATCH] Predictable Windows Recovery Partition (#280) Make Windows Recovery partition creation more predictable. This ensures the recovery partition is always created before the OS partition and does not block expansion of the OS partition to the full extent. Has been Tested with: - Windows Server 2016 - Windows Server 2019 - Windows Server 2022 - Windows Server 2025 - Windows 11 --- windows/http/Autounattend.xml.ISO.template | 16 ++++++++++++++-- windows/windows.pkr.hcl | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/windows/http/Autounattend.xml.ISO.template b/windows/http/Autounattend.xml.ISO.template index 769d395..25946eb 100644 --- a/windows/http/Autounattend.xml.ISO.template +++ b/windows/http/Autounattend.xml.ISO.template @@ -17,9 +17,14 @@ MSR - true 3 Primary + 768 + + + 4 + true + Primary @@ -30,9 +35,16 @@ 1 + NTFS 2 + DE94BBA4-06D1-4D40-A16A-BFD50179D6AC 3 + + + NTFS + 3 + 4 @@ -43,7 +55,7 @@ - 3 + 4 0 false diff --git a/windows/windows.pkr.hcl b/windows/windows.pkr.hcl index ec8656f..0adeccd 100644 --- a/windows/windows.pkr.hcl +++ b/windows/windows.pkr.hcl @@ -105,7 +105,7 @@ build { "source scripts/setup-nbd", "TMP_DIR=$(mktemp -d /tmp/packer-maas-XXXX)", "echo 'Adding curtin-hooks to image...'", - "mount -t ntfs $${nbd}p3 $TMP_DIR", + "mount -t ntfs $${nbd}p4 $TMP_DIR", "mkdir -p $TMP_DIR/curtin", "cp ./curtin/* $TMP_DIR/curtin/", "sync -f $TMP_DIR/curtin",