KB5028997: 手動調整磁碟分割區大小以安裝 WinRE 更新的指示

套用到
Windows 10 Windows 10, version 1607, all editions Windows Server 2016, all editions Win 10 Ent LTSC 2019 Win 10 IoT Ent LTSC 2019 Windows 10 IoT Core LTSC Windows Server 2019 Windows 10 Enterprise and Education, version 21H2 Windows 10 IoT Enterprise, version 21H2 Windows 10 Enterprise Multi-Session, version 21H2 Windows 10, version 22H2, all editions Windows 11 version 21H2, all editions Windows 11 version 22H2, all editions Windows 11 version 23H2, all editions

摘要

Microsoft 已變更更新執行 Windows 修復環境 (WinRE) 之電腦的方式。 WinRE 將會使用每月累積更新進行更新。 此變更僅適用於從 WINDOWS UPDATE (WU) 和 Windows Server Update Services (WSUS) 取得更新的電腦。 此變更從 2023 年 6 月 27 日開始,適用於 Windows 11 版本 22H2 累積更新。

某些電腦的修復磁碟分割不夠大,無法完成此更新。 因此,WinRE 的更新可能會失敗。 如果你在 C:\Windows\System32\winevt\logs\system.evtx 中看到 ID 為 4502 的系統事件被觸發,這很可能是因為包含 WinRE 的復原分割區空間不足所導致的錯誤。 此系統事件的詳細說明應顯示為「Windows 復原環境服務失敗。」且錯誤階段為 2。 如果是這樣,請依照以下步驟手動調整你的復原分割區大小。 這需要您的裝置在作業系統磁碟分割之後擁有修復磁碟分割。 請使用以下步驟來確認這一點。

手動將磁碟分割大小調整為 250 MB

  1. 打開命令提示字元視窗 (cmd) 為管理員。

  2. 要檢查 WinRE 狀態,請執行 reagentc /info。 如果已安裝 WinRE,應該會有一個具有 WinRE 目錄路徑的「Windows RE 位置」。 例如,「Windows RE 位置:[file://%3f/GLOBALROOT/device/harddisk0/partition4/Recovery/WindowsRE]\\?\GLOBALROOT\device\harddisk0\partition4\Recovery\WindowsRE」。 這裡的 “harddisk” 和 “partition” 後面的數字是磁碟和磁碟分割 WinRE 為開啟的索引。

  3. 要停用 WinRE,請執行 reagentc /disable

  4. 縮小作業系統磁碟分割,並為新的修復磁碟分割準備磁碟。

    1. 要縮小作業系統,請執行 diskpart
    2. 跑 list disk
    3. 要選擇作業系統磁碟,執行 sel disk<OS disk index> 這應該是和 WinRE 相同的磁碟索引。
    4. 要檢查作業系統磁碟下方的分割區並找到該分割區,請執行 list part
    5. 要選擇作業系統分割區,請執行 sel part<OS partition index>
    6. 跑 shrink desired=250 minimum=250
    7. 要選擇 WinRE 分割區,執行 sel part<WinRE partition index>
    8. 要刪除 WinRE 分割區,請執行 delete partition override
  5. 建立新的修復磁碟分割。

    1. 首先,檢查磁碟分割樣式是 GUID 磁碟分割表格 (GPT) 或主開機記錄 (MBR)。  要做到這點,就跑。list disk 檢查 “Gpt” 欄位中是否有星號字元 (*)。  如果有星號字元 (*),則磁碟機為 GPT。 否則,磁碟機為 MBR。

      1. 如果你的磁碟是 GPT,執行 create partition primary id=de94bba4-06d1-4d40-a16a-bfd50179d6ac 後接著指令 gpt attributes =0x8000000000000001
      2. 如果你的硬碟是 MBR,請執行 create partition primary id=27
    2. 要格式化分割區,執行 format quick fs=ntfs label=”Windows RE tools”

    3. 如果你的硬碟是 MBR,請執行 set id=27

  6. 要確認 WinRE 分割區已建立,執行 list vol

  7. 要退出 diskpart,執行 exit

  8. 要重新啟用 WinRE,請執行 reagentc /enable

  9. 要確認 WinRE 安裝在哪裡,執行 reagentc /info

備註 若建立失敗或您不想擴充 WinRE 分割區,請執行 reagentc /enable 以重新啟用 WinRE。