Sunday, 22 June 2025

How to add a WinPE USB Recovery drive to E2B or Ventoy (e.g. Lenovo Recovery USB)

If you have a working USB flash drive that contains WinPE, such as that made by the Lenovo USB Recovery Key app., you may need to follow this procedure if you want to add an image of that drive to your E2B USB drive.

See also the .imgptnREP3 section at the bottom of this article if you want to have multiple images on one E2B USB drive without temporarily replacing the first partition of your E2B drive.

Using E2B .imgPTN23 partition images:

1. Ensure that there is only one (usually FAT32) partition on the WinPE/Recovery USB drive. If not these instructions will not work. Note down the Volume Label assigned to the partition (Windows Properties using right-click on the USB drive letter).
This USB FAT32 volume has a Volume label of 'SPECIAL'.

2. Use the Windows batch file MakePartImage.cmd to create a FAT32 .imgPTN23 file from the USB volume - e.g. if the USB drive has the letter of H: then use H:\ as the source. See www.easy2boot.xyz for instructions. Do not use the MPI_FAT32 shortcut to make the .imgPTN23 file, instead use the MakePartImage desktop shortcut (see below) because this will prompt you for the Volume Label - ensure you type in the same volume label that the USB volume has - e.g. RECOVERY or whatever it is - when prompted.

3. Copy the new .imgPTN23 file to your E2B drive - e.g. to \_ISO\WINPE folder
4. Make the file contiguous
5. Switch-in the .imgPTN23 file (e.g. by booting from the E2B drive and selecting the .imgPTN23 file or by using Switch_E2B.exe Windows app). The volume label of Partition 1 can now be checked using Windows (right-click on drive letter and choose Properties - beware: Windows Explorer can lie about the volume label - use Properties to check it!).
6. Now boot from the first partition of the E2B drive - either legacy\BIOS or UEFI64 - this should boot to your WinPE payload.
7. When finished, don't forget to restore the E2B partition contents (using the menu if you MBR/legacy boot or by UEFI-booting to Partition 2 if you UEFI-boot or by using the Windows app Switch_E2B.exe).

Troubleshooting

1. Ensure the original working USB WinPE drive had only a single FAT32 partition
2. After switching-in the .imgptn23 file - ensure the new partition has the same volume label as your original working USB Recovery/WinPE drive
3. Some WinPE implementations will check the volume label and also check that it is on a Removable USB key. In this case, your E2B USB drive must also be of the Removable (thumb drive) type. If your E2B USB drive reports itself as a Fixed Disk type then the WinPE application may not recognise the USB drive as a removable thumb drive and report an error.

For instance, the Lenovo USB Recovery Drive application needs to see a Removable USB drive and a Volume Label of 'RECOVERY' in order for it to work, otherwise you may see this message:


4. .img and .vhd files may not work because once WinPE has loaded, it will use it's own Windows drivers to detect the virtual USB drive that it was booted from  - but it will not exist (i.e. WinPE will see a USB drive labelled Easy2Boot with lots of iso and img files on it, not the recovery files it expects to see). Even if the .img or .vhd file was loaded as a virtual drive (as is done with Windows ISOs by E2B and Ventoy), the Recovery application may fail because it might detect the new virtual drive as a fixed disk or CD but not as a Removable thumb drive type of disk.

Lenovo USB Recovery .imgPTN23 files will only work on an E2B USB drive that reports as a Removable (thumb drive) type. If you are using a Fixed type of drive (e.g. some fast Corsair drives, SilverStone or other M.2 USB carrier or USB HDD/SSD) then try a removable thumb drive such as a SanDisk Extreme Pro 3.1 instead for your E2B USB drive. RMPrepUSB will tell you what type of USB drive you have.

E2B supports .imgPTN23 files in BIOS/legacy mode and in UEFI64 mode (using agFM). Ventoy does not support .imgPTN23 files.

Note: Modern IODD virtual drives (#ad link) will allow you to load a VHD as either a Removable or Fixed type. Use the settings menu to change the virtual drive type for the loaded VHD to Removable.

E2B and Ventoy using .img or .vhd files

If you do not want to use E2B .imgPTN23 files but want to use just .img or .vhd files with either E2B or Ventoy, then the easiest thing to do is make a partition just for your WinPE image files. This assumes that the original WinPE USB drive which you have made an image file from, used a FAT32 volume.

Ventoy drive preparation

1. Use a Removable type of USB Flash/thumb drive for Ventoy - not a SSD or HDD type of USB drive.
2. Install Ventoy but reserve enough space for a 3rd partition which will hold all the WinPE files - e.g. 16GB or 32GB
3. Create an MBR Ventoy drive  (not GPT) 
4. Create a 3rd partition on the Ventoy USB drive - format as FAT32
5. Copy the contents of the WinPE .img file or .vhd file onto the third partition of the Ventoy USB drive - .e.g. extract files using 7Zip. OR just copy the files directly from the original WinPE USB drive.
6. Copy the large bootable .img or .vhd file onto Partition 1 of the Ventoy drive (to any folder you like) - you will boot from this file under Ventoy.
Note: You may be able to delete some files from inside the .img or .vhd file to reduce it's size - for instance the recovery image files (.IMZ) in the \RECOVERY folder. e.g. using 7Zip.
7. Ensure the Volume Label of Partition 3 is the same as your original WinPE USB drive.
8. Now boot from the .img or .vhd file using the Ventoy menu - once it boots to WinPE, it should detect  a Removable USB thumb drive and a FAT32 partition with the label RECOVERY (or whatever the original label was) and the recovery application should be 'happy' and should see the recovery files in the FAT32 Partition 3. 

Note: Partition 3 may not need to be FAT32, it could be exFAT or NTFS if you also want to store files larger than 4GB on it and create some folders on it for your own purposes.

You can use the Drive>File button on RMPrepUSB.exe to make a .img file from your working WinPE USB flash drive (choose Start=0 and Length=P1 for end of partition 1) or Disk2Vhd to make a .vhd file.

Using .imgptnREP3 files with E2B
When a .imgptnREP3 image file is selected from Partition 3 of the E2B drive, E2B or agFM will replace the current NTFS Partition 3 of the USB drive with the contents of the image file. The .imgptnREP3 files should all be located on a large NTFS Partition 3 of the E2B drive.

If you have more than one WinPE image, then E2B can switch into Partition 3 any one of many files (.imgptnREP3 files). You can switch in .imgptnREP3 files using the Window app Switch_E2B.exe (found in E2B download) or from the agFM menu.

For instance, if UEFI-booting, you can have multiple .imgptnREP3 files all on a large NTFS Partition 3 - then UEFI-boot to agFM and select any of the .imgptnREP3 files to switch that image file into Partition 3 - then reboot to the new Partition 3 of your USB drive. Legacy booting to Partition 3 can be done using the agFM menu or by adding an Easy2Boot .mnu menu file if you want to use the E2B legacy menu system.

You can make a. .imgptnREP3 file in the same way as .imgptn23 files using MakePartImage - just change the extension name afterwards to .imgptnREP3. Alternatively, make the image file by taking a copy of Partition 1 of the original WinPE USB drive using RMPrepUSB  Drive>File where start and length = P1.

No comments:

Post a Comment