Windows 7實戰(zhàn)之使用 PXE 部署映像
本文介紹如何使用 Windows(R) PE 2.0 設(shè)置第三方預(yù)啟動執(zhí)行環(huán)境 (PXE) 服務(wù)器。該過程包括將 Windows PE 2.0 源文件復(fù)制到 PXE 服務(wù)器,然后配置 PXE 服務(wù)器啟動配置以使用 Windows PE。
步驟 1:將源文件復(fù)制到 PXE 服務(wù)器上
在此步驟中,會將 Windows PE 源文件復(fù)制到 PXE 服務(wù)器。
1、在技術(shù)人員計算機上,單擊"開始",依次指向"程序"、Windows OPK 或 Windows AIK,然后單擊"Windows PE 工具命令提示符"。
菜單快捷方式將打開"命令提示符"窗口,并將環(huán)境變量自動設(shè)置為指向所有必需的工具。默認(rèn)情況下,所有工具都安裝在 C:\Program Files\<version>\Tools 中,其中 <version> 可以是 Windows OPK 或 Windows AIK。
2、運行 Copype.cmd 腳本。該腳本需要使用兩個參數(shù):硬件體系結(jié)構(gòu)和目標(biāo)位置。
copype.cmd <arch> <destination>其中 <arch> 可以是 x86、amd64 或 ia64,<destination> 是本地目錄的路徑。例如,
copype.cmd x86 c:\winpe_x86此腳本會創(chuàng)建以下目錄結(jié)構(gòu)并復(fù)制該體系結(jié)構(gòu)的所有必要文件。例如,
C:\winpe_x86
C:\winpe_x86\ISO
C:\winpe_x86\mount
3、使用 ImageX 工具將基本 Windows PE 映像裝載到 \Mount 目錄。例如,
imagex /mountrw C:\winre_x86\winpe.wim 1 C:\winpe_x86\mount
4、將網(wǎng)絡(luò)連接映射到 PXE/TFTP 服務(wù)器上的 TFTP 根目錄,并創(chuàng)建 \Boot 文件夾。例如,
net use y: \<PXEServer>\TFTPRoot
y:
md Boot
5、將 PXE 引導(dǎo)文件從裝載目錄復(fù)制到 \Boot 文件夾。例如,
cd \temp\Windows\Boot\PXE
copy c:\winpe_x86\mount\Windows\Boot\PXE\*.* y:\Boot
6、將 Boot.sdi 文件復(fù)制到 PXE/TFTP 服務(wù)器。
copy c:\Program Files\<version>\Tools\PETools\x86\boot\boot.sdi y:\Boot其中,<version> 可以是 Windows OPK 或 Windows AIK。
7、卸載當(dāng)前的 Windows PE 映像,并將可啟動的 Windows PE 映像復(fù)制到 \Boot 文件夾。
Imagex /unmount C:\winpe_x86\mount
copy c:\winpe_x86\winpe.wim y:\Boot\boot.wim必須將基本的 Windows PE 映像 (Winpe.wim) 重命名為 Boot.wim。
內(nèi)容導(dǎo)航
步驟 2:配置啟動配置
在此步驟中,將使用 BCDEdit 工具創(chuàng)建 BCD 存儲。BCDEdit 工具只能在 Windows? 7 計算機或 Windows PE 環(huán)境中運行。BCDEdit 工具位于 \Windows\System32 目錄中。
1、在 Windows 7 計算機或 Windows PE 環(huán)境中,使用 BCDEdit 工具創(chuàng)建一個 BCD 存儲。例如,
Bcdedit -createstore c:\BCD
2、創(chuàng)建 RAMDISK 設(shè)置。例如,
Bcdedit -store c:\BCD -create {ramdiskoptions} /d "Ramdisk options"
Bcdedit -store c:\BCD -set {ramdiskoptions} ramdisksdidevice boot
Bcdedit -store c:\BCD -set {ramdiskoptions} ramdisksdipath \boot\boot.sdi
3、(可選)創(chuàng)建內(nèi)核調(diào)試程序設(shè)置。例如,
Bcdedit -store c:\BCD -create {dbgsettings} /d "Debugger settings"
Bcdedit -store c:\BCD -set {dbgsettings} debugtype serial
Bcdedit -store c:\BCD -set {dbgsettings} baudrate 115200
Bcdedit -store c:\BCD -set {dbgsettings} debugport 1
4、為 Windows PE 映射創(chuàng)建 OSLoader 設(shè)置。例如,
Bcdedit -store c:\BCD -create /d "MyWinPE Boot Image" /application osloader如果 s 命令成功,則計算機將返回 GUID 值。下列示例將此值指代為 guid1。
Bcdedit -store c:\BCD -set {guid1} systemroot \Windows
Bcdedit -store c:\BCD -set {guid1} detecthal Yes
Bcdedit -store c:\BCD -set {guid1} winpe Yes
Bcdedit -store c:\BCD -set {guid1} osdevice ramdisk=[boot]\Boot\boot.wim,{ramdiskoptions}
Bcdedit -store c:\BCD -set {guid1} device ramdisk=[boot]\Boot\boot.wim,{ramdiskoptions}
5、創(chuàng)建 BOOTMGR 設(shè)置。例如,
Bcdedit -store c:\BCD -create {bootmgr} /d "Windows BootManager" /inherit {dbgsettings}
Bcdedit -store c:\BCD -set {bootmgr} timeout 30
Bcdedit -store c:\BCD -displayorder {guid1} {guid2}其中,guid1、guid2 等等是每個 .wim 文件條目對應(yīng)的 GUIDS。
6、將 BCD 文件復(fù)制到服務(wù)器。例如,
copy c:\BCD \server\TFTPRoot\Boot
7、將 PXE/TFTP 服務(wù)器配置為指向要下載 WDSNBP.COM 的 PXE 客戶端。
現(xiàn)在已配置了 PXE/TFTP 服務(wù)器。
部署過程
下面概括了下載過程。
1、指導(dǎo)客戶(使用 DHCP 選項或 PXE 服務(wù)器響應(yīng))下載 Wdsnbp.com
2、Wdsnbp.com 將驗證 DHCP/PXE 響應(yīng)數(shù)據(jù)包并繼續(xù)下載 PXEBoot.com。
3、PXEBoot.com 將下載 Bootmgr.exe 和 BCD 存儲。BCD 存儲必須位于 TFTP 根文件夾的 \Boot 目錄中。此外,必須將 BCD 存儲稱為 BCD。
4、Bootmgr.exe 將讀取 BCD 操作系統(tǒng)條目,并下載 Boot.sdi 和 Windows PE 映像。
5、Bootmgr.exe 通過運行 Windows PE 映像中的 Winload.exe 來開始啟動 Windows PE。
【編輯推薦】