Saturday 30 September 2017

Adding MDT ISOs to Easy2Boot (UEFI+MBR)

Boot from a .imgPTN23 file

You can 'switch-in' a partition image which holds the MDT boot files and Deployment folder.

For MBR-booting, the simplest way to add an ISO made by the Microsoft Deployment Toolkit, is to convert the MDT ISO file to a .imgPTN file using the E2B MPI Tool Kit. Just Drag-and-Drop the MDT ISO file (or MDT USB drive letter) onto the MPI_FAT32 Windows Desktop shortcut.

Rename the file to have a .imgPTN23 file extension.

MDT Setup

This should work fine, as long as all the files inside the ISO are less than 4GB in size, and then you can MBR and UEFI-boot from the .imgPTN file. Later versions of MDT support the creation of split wims, so this will work even for MDT with large files.

If UEFI-booting and you have a large WIM file, you could try using the MPI_NTFS shortcut to create an NTFS .imgPTN23 file. Then you can UEFI boot to agFM on the 2nd FAT32 partition (E2B v2 only) and from agFM boot from the WIM file on the first partition or the \EFI\BOOT\BOOTX64.EFI file on the first partition.

Tip: Instead of using E2B, you could just copy all your ISOs to an IODD Mini #ad. You can still put E2B on it as well! The IODD Mini just looks like a USB DVD once the ISO is selected, so even Secure UEFI boot works.

Alternate method for MBR-booting

If you have files inside the ISO that are larger than 4GB, then use the MPI_NTFS shortcut instead. However, you will only be able to MBR-boot unless you first  UEFI64-boot to agFM (see above).

Below are instructions for direct booting from an MDT ISO (MBR-booting only) and another set of instructions for MBR+UEFI-booting by using two image files...



Direct MBR-booting from the ISO

It is possible to direct boot from the ISO and run MDT (but the .imgPTN method mentioned above is better/easier and requires no extra user interaction):

Note: You must use an E2B Removable Flash drive OR an E2B HDD + WinHelper flash drive. or use E2B v2.

1. Rename the ISO to have a .isoPE01 file extension - e.g. \_ISO\WINPE\MDT10.isoPE01

2. Make a new text file of the same name with a file extension of .cmd containing the text:

set POSTCMD=%~p0LiteTouch.cmd

3. Make a new text file called LiteTouch.cmd containing the text:

wscript.exe x:\Deploy\Scripts\LiteTouch.wsf

This is the usual script that is deployed by MDT when it boots. If yours is different, check the \Unattend.XML file that is inside the ISO and inside the \Deploy\Boot\LiteTouchPE_x64.wim file (use 7Zip to explore the ISO and wim file contents).

So now you should have these files on your E2B USB drive:
\_ISO\WINPE\MDT10.isoPE01
\_ISO\WINPE\MDT10.cmd
\_ISO\WINPE\LiteTouch.cmd

If you have more MDT ISOs, just create more .cmd files - e.g

\_ISO\WINPE\MDT10.isoPE01
\_ISO\WINPE\MDT10.cmd
\_ISO\WINPE\MDT81.isoPE01
\_ISO\WINPE\MDT81.cmd
\_ISO\WINPE\LiteTouch.cmd

If using an E2B HDD, ensure the WinHelper flash drive is also connected before you boot from the E2B HDD. Later versions of Win10 or E2B v2 may not require a Helper Flash drive.

How to Install Windows using MDT ISO

On the first boot to the MDT10.isoPE01 file, you should see the LOADISOPE.cmd script run (blue console) which will load the ISO file as a virtual DVD and then start the MDT .wsf script (if it just reboots then you have not made the .cmd files correctly!).

Depending on certain timing factors, you should not be prompted to enter the Deploy path. However, if you are asked for the path to the Deployment folder, you may need to type it in manually (e.g. Y:\Deploy). You can use F8 - Notepad to find what letter the ISO file has been mounted on.

After the first installation stage has completed, the MDT will reboot from the hard disk, but it may look for the \Deploy folder again at the very end of installation. If this happens, right-click on the MDT ISO file located on the E2B drive and mount (open) it as a drive using Windows Explorer. MDT should then complete successfully. If the OS does not natively support the mounting .ISO files, you will need to install ImDisk from the E2B drive (\_ISO\e2b\firadisk\imdisk) and then use ImDisk to mount the ISO as a DVD drive.

UEFI Booting

The standard way to convert a WinPE ISO is to drag-and-drop the ISO file onto the MPI_FAT32 Windows Desktop shortcut to make a .imgPTN23 file.

If the ISO contains EFI boot files, then you will be able to both UEFI-boot and MBR-boot from the .imgPTN file. If supported, you can even Secure UEFI-boot.

Recommended for UEFI+MBR

However, most MDT ISOs contain very large .wim files. Later versions of MDT support split WIM files, so ensure you use that option when creating the ISO. Also see this conversation and this tip as apparently some versions of MDT have bugs! Ensure the .swm files are present and that \Deploy\Control\OperatingSystems.xml contains a reference to .swm and not .wim.

If your MDT supports creating FAT32 USB media with split .swm files, then you can use a spare USB drive with MDT to make a new drive. Once made and tested, drag-and-drop the MDT USB drive letter\icon onto the MPI_FAT32 Desktop shortcut to create a new .imgPTN23 file for use with E2B.


Make a Dual-Partition FAT32+NTFS setup

Use this method only if the .wim file is >4GB and you cannot make a split wim MDT ISO...

Tip: The Easy2Boot MPI ToolKit contains Split WinISO.exe which you can use to make an new ISO containing split WIM (swm) files.

This method does work well, but you may have difficulty getting the two image files into the correct order on your E2B USB drive! So, if possible, use the split-wim approach above which uses a single FAT32 .imgPTN file.

This is Method 4 as detailed on this page, it creates two partitions which work in a similar way to a UEFI NTFS+FAT32 USB drive made by Rufus (it uses the same UEFI NTFS driver files used by Rufus).

Note: Secure UEFI-booting is not supported.


Instructions

This is only necessary if you don't have E2B v2 with agFM, therefore these instructions are outdated.

Prerequisites

  1. Install the MPI Tool Kit
  2. Ensure the MDT ISO is on an internal hard drive (not on the E2B drive)
  3. Use Defraggler to consolidate free space on the E2B drive - Defraggler - Action - Advanced - Defrag free space
  4. Run \MAKE_THIS_DRIVE_CONTIGUOUS (run as admin).cmd
  5. Check with Defraggler that there are very few 'gaps' of unused clusters. 

Let's begin

Make sure you follow this exact order when copying files to the E2B drive...

1. Drag-and-drop the MDT.iso file onto the MPI_NTFS Windows Desktop shortcut to make MDT.imgPTN

2. Copy the large MDT.imgPTN file to the E2B drive \_ISO\WINPE folder (or any other menu folder)

3. Download the EFI_TOGO_V2 file, extract it to the Windows Desktop.

4. Drag-and-Drop the EFI_TOGO_V2.1 folder onto the Windows Desktop MPI_FAT32 shortcut to make a MDT. file (no file extension).

5. Copy the 38MB MDT file to the \_ISO\WINPE folder.

6. Run \_ISO\SWITCH_E2B.exe. If prompted to re-order the two files, you must say 'Yes'. if the two files are not in the correct order, some UEFI-systems will not list the FAT32 partition as a 'boot drive' and you will not be able to UEFI-boot.

You can try it without re-ordering if you like, but your system may not recognise the two partitions as UEFI-bootable!

Tip: use the latest version of SWITCH_E2B.exe in E2B v1.96b+ if you are having problems re-ordering the two image files. You may need to copy 300+ files before it will be successful, but eventually it will work - see below!

You should now have this arrangement on the E2B drive after switching partitions:
PTN 1 : Large NTFS
PTN 3 : 32MB FAT32 volume with Rufus EFI boot files

7. You can now boot from the E2B USB drive via UEFI or MBR\Legacy mode.

If you get a "The task sequence has been suspended. LiteTouch is trying to install applications. This cannot be performed in Windows PE." error, use F8 to run Diskpart and clean the target hard disk (SEL DISK 0 - CLEAN). You may also need to use CONVERT GPT. Then try again.

8. When finished, restore the E2B partitions by MBR-booting to the CSM Menu and choose menu #0 - or - run \e2b\SWITCH_E2B.exe - Restore E2B partition(s).


Troubleshooting 'moving files'

The small 38MB MDT. file needs to be located on the E2B USB drive partition after the MDT.imgPTN file. If not, then many UEFI BIOSes will not detect the FAT partition and will not provide a UEFI boot option

Unfortunately, it is difficult to place a small file after a large contiguous file, because the large contiguous file is usually located towards the end of the drive, but there are lots of gaps before that file in which the smaller MDT 38MB file will fit!

Defraggler will analyse the E2B USB drive for you and can show you the two file locations.


SWITCH_E2B.exe re-copies the small file and fills the drive until the NTFS filesystem has no spare gaps left and so the filesystem must put the file in the free space that follows the MDT.imgPTN file.

One way you can help the process is to fill the drive with lots of smallish files (i.e. files of 100MB or so in size) by creating a \junk folder and copy lots of files into it. Then check with Defraggler that there are now very few spaces before the large MDT.imgPTN file and run SWITCH_E2B.exe again.

If you have large unused areas before your MDT.imgPTN file, fill it with some large files (such as Windows Install ISOs?).

Tip: Try SWITCH_E2B.exe v1.0.17 or later for improved 're-order' functionality (in latest E2B v1.96b Beta).

If you are still having problems re-ordering the two files, change over the two file's extensions:
MDT10.imgPTN large NTFS Windows ptn
MDT10.               38MB FAT32 ptn

Use the 'Boot Windows from 3rd partition' menu entry for CSM booting, or UEFI-boot.

Later versions of E2B allow you to place the second file (MDT10) on the 2nd FAT32 partition of the E2B drive and name the first file MDT10.imgPTN23. This solves the file position problem.

Partition 1: /_ISO/WINPE/MDT10.imgPTN
Partition 2: /MDT10  (or /_ISO/WINPE/MDT10)

No comments:

Post a Comment