简体   繁体   中英

Install Windows PE as a partition on HDD

I'm trying to install a windows PE on a partition on same HDD with windows.
I copied winPE files ADK with Deployment Tools and Imaging Environment :
copype amd64 C:\\WinPE_amd64
I used this code to make partitions:

diskpart
list disk
select <disk number>
clean
rem === Create the Windows PE partition. ===
create partition primary size=2000
format quick fs=fat32 label="Windows PE"
assign letter=P
active
rem === Create a data partition. ===
create partition primary
format fs=ntfs quick label="Other files"
assign letter=O
list vol
exit

I applied image on partition P: with command:
dism /Apply-Image /ImageFile:"C:\\WinPE_amd64\\media\\sources\\boot.wim" /Index:1 /ApplyDir:P:\\
I set up boot files with command BCDboot P:\\Windows /s P: /f ALL , but after reboot i can't see WinPE in boot menu or in bcdedit.

I set up a lot of multi-boot machines - usually with some flavor of windows and winPE. I make a system volume and register the bootable OSes onto that. I think the recommendation is to do that - even if you're not interested in dual boot.

The script will be different depending on whether your firmware is UEFI or good ol' BIOS - Some of the tools seem to like a GPT better. BCDBoot, as I remember it, was fairly persnickety.

The system volume has to be FAT32, but your winPE should probably be NTFS. Here's a script similar to what I run when forced to stick with BIOS/MBR:

select disk {0}
clean
create partition primary size={1}
format quick fs=ntfs label="System Reserved"
assign letter="{2}"
active
create partition primary size={3}
format quick fs=ntfs label="{4}"
assign letter="{5}"
create partition primary
format quick fs=ntfs label="WinPE"
assign letter="{6}"
exit

Note that in the foregoing, the system volume is the active volume.

If you're on a UEFI machine and/or a system that supports GPT, you'd do it more like this:

select disk {0}
clean
convert gpt
create partition efi size={1}
format quick fs=fat32 label="System"
assign letter="{2}"
create partition msr size={3}
create partition primary size={4}
format quick fs=ntfs label="{5}"
assign letter="{6}"
create partition primary
format quick fs=ntfs label="WinPE"
assign letter="{7}"
exit

There's no "active" command on an EFI-booted drive - the EFI volume is always the active volume.

You'd make the choice of which to run based on the firmware you want to run under - found in your BIOS configuration menu (F12 at startup - but I guess that is hardware vendor-specific).

In either case, You'd still register the OSes in the bcd with bcdboot. You don't typically have to specify the /s switch with EFI. Also, you don't have to specify all firmware types - it will default based on the active firmware - no point in having more stuff in the bcd than you really need - it's arcane and worth keeping simple/small.

I tend to use the /addlast switch when registering winPE using BCDBoot- as we only boot to it in special circumstances (in my world). I also remove it from the displayOrder - so users don't inadvertently boot to it when it isn't appropriate.

If this is a secondary drive you're putting this on - you have to set the boot order in BIOS to make your secondary drive show up.

Alternatively, you might be able to register a bootable partition in the primary disk's BCD...in which case, you'd either need to sniff out the primary drive's active partition, temporarily assign it a drive letter, and register to that (or don't use the /s switch at all). I've never had the occasion to put a bootable partition from a secondary disk into the primary's BCD - but I suppose it could work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM