How do I add a second winpe boot entry to a UEFI usb drive


  1. Posts : 15,480
    Windows10
       #1

    How do I add a second winpe boot entry to a UEFI usb drive


    As you may well know, you can now access multiple partitions on a standard removeable flash drive with version 1703.

    So I decided to try and create a UEFI based usb flash drive with multiple winpe partitions.

    I successfully managed to create an EFI partition and a Winpe partition with Windows 10 15063 installation files - details below. This was a challenge as original source was for hard disks and some of the diskpart commands do not work for removeable drives and there were mistakes in original text.

    I tested the commands I modified below and it booted perfectly.

    Then, I added a second winpe partition but the bit I cannot work out is how to add a boot entry for the second winpe partition. I tried the command file in @Khyi's tutorial but it added the boot entry to the C drive EFI partition, not the one on the usb drive.

    I (rather blindly) tried to repeat some of the bcdedit commands from below but that did not work (due to my lack of knowledge).

    So does anybody have any idea how I could add a second boot entry?

    cheers

    C.


    ----------------------------------------------------------------------------
    This is a modified version of guide in Walkthrough: Boot Windows PE from a UEFI-based Hard Disk starting from step 2.Step 1: Prepare USBInsert usb flash drive whilst running Windows 10 version 1703 and open an admin command prompt and runWarning: contents of flash drive are removed.diskpartlist diskselect disk n (n=usb drive number - be careful you select right drive)cleanconvert GPTrem === 1. Create the EFI system partition ===create partition EFI size=200create partition primary size=5000 (adjust as approprite)Install minitool partition wizard free if not already installed. You need this as as you cannot assign drive letters for removeable drives in disk part but you can with MPW.Using MPW, format EFI partition as FAT32 and give it a drive letter SFormat Windows Partition as FAT32 and give it a drive letter TNote I use drive S for EFI and T for Windows partition - change as appropriateStep 2: Mount Windows PE Iso as a drive in Windows e.g. a Windows 10 15063 installation iso downloaded using Media Creation ToolThis guide assumes the iso is mounted as drive D - change as appropriate Step 3: Copy Windows PE files to the hard diskIn this step, you copy Windows PE resource files to the hard drive from your bootable media. This example assumes the hard drive is blank.At a command prompt, copy the \EFI folder from your bootable media to the EFI folder of the EFI system partition on your hard drive, as in the following example:xcopy d:\EFI\* s:\EFI\* /cherkyfswhere d is the letter of your bootable Windows PE media that contains a Windows PE image.Copy the \Sources folder from your bootable media to the sources folder of the Windows PE partition on your hard drive, as in the following example:xcopy d:\sources\* t:\sources\* /cherkyfsCopy the \Boot\boot.sdi file from your bootable media to the \Sources folder of the Windows PE partition on your hard drive, as in the following example:copy d:\boot\boot.sdi t:\sources\Copy all of the files with an .efi extension from iso to the \EFI\Microsoft\Boot folder. If any ask for permission to overwrite, just select no.copy d:\efi\microsoft\boot*.efi s:\EFI\Microsoft\Boot\*copy d:\efi\boot*.efi s:\EFI\Microsoft\Boot\* copy d:\*.efi s:\EFI\Microsoft\Boot\*Delete the boot configuration data (BCD) file that you copied from your bootable media. Note that you will create a new one in the next step, as in the following example,del s:\EFI\Microsoft\Boot\BCD /fStep 4: Configure the System StoreIn this step, you will create and configure a new system store by using the BCDEdit tool. The system store is a file named BCD that holds information required to load Windows or other boot applications. BCD replaces Boot.ini.BCDEdit is a command-line tool that is designed to manage system stores/Create a new system store, as in the following example:bcdedit -createstore S:\EFI\Microsoft\Boot\BCDCreate new entries in the system store for bootmgr, globalsettings, dbgsettings, ramdiskoptions, and Windows PE.bcdedit -store S:\EFI\Microsoft\Boot\BCD -create {bootmgr} /d "Boot Manager"bcdedit -store S:\EFI\Microsoft\Boot\BCD -create {globalsettings} /d "globalsettings"bcdedit -store S:\EFI\Microsoft\Boot\BCD -create {dbgsettings} /d "debugsettings"bcdedit -store S:\EFI\Microsoft\Boot\BCD -create {ramdiskoptions} /d "ramdiskoptions"bcdedit -store S:\EFI\Microsoft\Boot\BCD -create /d "Windows PE" -application osloaderYou can put all above in a batch file if you like. Note: The last command returns a GUID value for Windows PE store. Cut and paste to a text file.Set the default entry that the boot manager selects when the timeout expires. Substitute <GUID> with the GUID value for the Windows PE store in the following example:bcdedit -store S:\EFI\Microsoft\Boot\BCD /default <GUID from Windows PE store>Do not put above in a batch file as you need to use GUID from above.Run the following commands to configure bootmgr:You can put all of following in a second batch file if you like.bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {bootmgr} device partition=s:bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {bootmgr} path \EFI\Microsoft\Boot\bootmgr.efibcdedit -store S:\EFI\Microsoft\Boot\BCD -set {bootmgr} locale en-usbcdedit -store S:\EFI\Microsoft\Boot\BCD -set {bootmgr} timeout 10Run the following commands to configure the boot loader:bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {Default} device ramdisk=[t:]\sources\boot.wim,{ramdiskoptions}bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {Default} path \windows\system32\winload.efibcdedit -store S:\EFI\Microsoft\Boot\BCD -set {Default} osdevice ramdisk=[t:]\sources\boot.wim,{ramdiskoptions} bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {Default} systemroot \windowsbcdedit -store S:\EFI\Microsoft\Boot\BCD -set {Default} winpe yesbcdedit -store S:\EFI\Microsoft\Boot\BCD -set {Default} nx optinbcdedit -store S:\EFI\Microsoft\Boot\BCD -set {Default} detecthal yesbcdedit -store S:\EFI\Microsoft\Boot\BCD -displayorder {Default} -addfirstRun the following commands to configure dbgsettings:bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {dbgsettings} debugtype Serialbcdedit -store S:\EFI\Microsoft\Boot\BCD -set {dbgsettings} debugport 1bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {dbgsettings} baudrate 115200Run the following commands to configure ramdiskoptions:bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {ramdiskoptions} ramdisksdidevice partition=t: bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {ramdiskoptions} ramdisksdipath \sources\boot.sdiNow check drive boots ok with initial winpe drive added. Set bios to boot from usb drive mode and ensure pc is in UEFI mode.
      My Computer


  2. Posts : 18,432
    Windows 11 Pro
       #2

    Dang it, now you have challenged me... I think I am going to work with EasyBCD, though....
      My Computer


  3. Posts : 15,480
    Windows10
    Thread Starter
       #3

    NavyLCDR said:
    Dang it, now you have challenged me... I think I am going to work with EasyBCD, though....
    I think I know how to do it now after much web searching. Easybcd looks like a way to do it. The trick I think I was missing is you open file menu and select bcd on usb drive.

    I also came across some bcdedit solutions which were less complicated. So a couple of things to try today - I will report back.

    I do know an easy way to do it by installing full windows using to wintousb, booting to that Windows, creating winpe partitions and making boot entries using Kyhi's cmd file (post #845 in his tutorial).

    Then you can delete window volume and boot entry.

    I just wanted to see if it was possible without installing full windows first as this means you need a 32GB usb drive realistically (16 GB might be ok).
      My Computer


  4. Posts : 15,480
    Windows10
    Thread Starter
       #4

    Well I solved the problem after many hours of faffing around. The answer was so simple.

    All I had to do was modify Kyhi's uefi winpse.cmd in his sticky thread (post #845) by adding "-store s:\efi\microsoft\boot\bcd" after each bcdedit command.

    So I booted and got a menu with two installs so I decided to try it creating a dual boot option.

    All started fine, then during the install got an error about the EFI being NTFS.

    I looked at the disk partitions for my ssd and bizarrely it had added a second EFI partition and that was FAT32.

    So booting in UEFI mode has obviously confused the installer somehow.

    I do not think there is anyway round that.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 04:24.
Find Us




Windows 10 Forums