鏡像磁碟故障後如何識別並刪除 Windows 2008 伺服器上未使用的啟動項

鏡像磁碟故障後如何識別並刪除 Windows 2008 伺服器上未使用的啟動項

我的 Server 2008 R2 伺服器上的一個軟體鏡像磁碟發生故障。它丟失了,重新啟動將其恢復,但它已經過時了,所以我必須恢復到鏡像並重建壞磁碟(此時不知道它是壞的)。然後它又掉下來了,所以我把它換了。

現在我的啟動選單中有 5 個項目:

Windows Server 2008 R2
Windows Server 2008 R2 - secondary plex
Windows Server 2008 R2 - secondary plex - secondary plex
Windows Server 2008 R2 - secondary plex
Windows Server 2008 R2 - secondary plex - secondary plex - secondary plex

預設條目 (Windows Server 2008 R2) 不會啟動。您必須手動選擇不同的條目才能啟動伺服器。

我的 bcdedit 清單如下所示:

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  unknown
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
default                 {default}
resumeobject            {3c1a07d1-3aaf-11e3-be1a-d6c22ece83ca}
displayorder            {default}
                        {current}
                        {3c1a07dc-3aaf-11e3-be1a-d6c22ece83ca}
toolsdisplayorder       {memdiag}
timeout                 30

Windows Boot Loader
-------------------
identifier              {default}
device                  partition=\Device\HarddiskVolume2
path                    \Windows\system32\winload.exe
description             Windows Server 2008 R2
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {3c1a07d3-3aaf-11e3-be1a-d6c22ece83ca}
recoveryenabled         Yes
osdevice                partition=\Device\HarddiskVolume2
systemroot              \Windows
resumeobject            {3c1a07d1-3aaf-11e3-be1a-d6c22ece83ca}
nx                      OptOut

Windows Boot Loader
-------------------
identifier              {current}
device                  unknown
path                    \Windows\system32\winload.exe
description             Windows Server 2008 R2 - secondary plex
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {3c1a07d3-3aaf-11e3-be1a-d6c22ece83ca}
recoveryenabled         Yes
osdevice                unknown
systemroot              \Windows
resumeobject            {3c1a07d1-3aaf-11e3-be1a-d6c22ece83ca}
nx                      OptOut

Windows Boot Loader
-------------------
identifier              {3c1a07dc-3aaf-11e3-be1a-d6c22ece83ca}
device                  partition=C:
path                    \Windows\system32\winload.exe
description             Windows Server 2008 R2 - secondary plex - secondary plex
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {3c1a07d3-3aaf-11e3-be1a-d6c22ece83ca}
recoveryenabled         Yes
osdevice                partition=C:
systemroot              \Windows
resumeobject            {3c1a07d1-3aaf-11e3-be1a-d6c22ece83ca}
nx                      OptOut

我不確定應該刪除哪些,以及應該將哪些設定為活動狀態。事實上,{current} 條目將設備顯示為“未知”,這讓我在嘗試和錯誤時有點害羞。這是遠端託管網站上的生產伺服器,因此我無法真正嘗試使其正確。

diskpart 顯示磁碟 1(0 和 1)是開機裝置。

有人有建議嗎?

答案1

您可以使用磁碟管理來檢視和映射磁碟和分割區(或使用 diskpart.exe)。

通常,第一個磁碟(磁碟 0)是引導候選磁碟,並檢查是否存在活動分割區。如果第一個磁碟上不存在活動分割區,則檢查第二個磁碟(磁碟 1)是否有活動分割區,依此類推。

奇怪的是,{bootmgr} 的裝置在目前系統 BCD 中也被列為「未知」!這可能會產生問題。

A.) 您能做的最好的事情就是使用 bootsect.exe 命令重寫所有磁碟和分割區上的 MBR 和 PBR:

bootsect /nt60 all /mbr

B.) 然後使用 bcdboot.exe 指令重寫(修復)BCD:

bcdboot Z:\windows 

其中 Z: 是安裝 Windows 的磁碟機。稍後您必須使用 ReAgentC.exe 修復復原載入程式。

C.) 您也可以使用下列指令在非系統磁碟上寫入另一個 BCD(如果它有活動分割區)

bcdboot z:\windows /s y:

其中 y:是非系統磁碟上的活動分割區。

這樣您就可以從任一磁碟啟動。

為了以圖形化和結構化的方式查看 BCD您可以使用 Visual BCD 編輯器。

執行 bcdboot 命令後,您應該檢查啟動管理器和載入程式的裝置是否正確列出。

修復 BCD 並重新啟動後,您可以刪除所有具有「未知」裝置的載入程式、指向非「啟動」分割區(Windows 安裝和啟動的分割區)的載入程式。

筆記:

備份您目前的 BCD(!) 使用 Visual BCD 編輯器或使用

bcdedit /export full_path_filename

(您可以隨時使用「bcdedit /匯入檔案名稱」來恢復BCD)

BCD 中的所有「連結」都是透過 GUID 進行的。例如,元素「顯示順序」是 GUID 列表,這些 GUID 是載入程式的 GUID。 BCD 中的每個物件都有一個唯一的 GUID。

希望這可以幫助。

相關內容