UEFI/MBR a1ive grub2 File Manager

New for 2020!
 
By adding a FAT32 partition and a1ive's version of grub2 and the grub2 File Manager, we can UEFI-boot directly from the payload files on the E2B USB drive.
 
UEFI-boot, find the file you want to boot to - and boot!
 
Supports Secure UEFI64, UEFI64, UEFI32 as well as MBR\Legacy booting:
 
.ISO - Linux, Windows Install, WinPE, Android (Windows Install ISO may require 2GB RAM or more)
.XML - unattend.xml files can be used with Windows Install ISOs
.IMG - disk image
.VHD - Virtual Hard Disk Image
.WIM - NT6 wim file (using wimboot or NTBOOT)
.EFI - EFI applications, boot loaders, etc.
.LUA - lua scripts
.CFG - syslinux and grub2 menus
.GRUBFM - grub2 menus written for the grubfm menu system - e.g. Ubuntu ISO + persistence
.LST - grub4dos menu (MBR mode only)
also .IPXE (ipxe boot file), .MOD (grub2 module), .PF2 (loads a font file - e.g. unicode-large.pf2), .JPG and  .PNG (display).
 
Including Windows Install ISOs with XML files.
 

Instructions

1. Prepare an E2B USB drive using the E2B download.
 
2. Delete the second PTN2 partition and create a new FAT32 Primary partition (min. recommended size 100MB or more). It may be necessary to shrink the E2B partition slightly first using EaseUS Partition Master or a similar tool. I also recommend you alway leave the last 1MB of a drive unused for best compatibility with all BIOSes - i.e. there should be 1MB of unused space after the last partition.
 
Partition 1: NTFS  (recommended max. size 128GiB for best compatibility)
Partition 2: FAT32 (recommended min. size 100MB)
[1MiB unused disk space]
 
If your E2B USB drive is larger than 128GiB, you may want to create a third NTFS partition which can be used to store applications or backup images, etc. Note that this may limit some E2B features however (e.g. Linux ISO+persistence).
 
3. Download the E2B UEFI File Manager zip file. There may be more than one version or more than one language.
 
The download file can be found in the Alternate Download Areas - a1live grub2 file manager folder (e.g. E2B UEFI File Manager v1.0.zip).
 
4. Extract the files directly to the FAT32 partition on the USB drive.
 
Note: If you are using a Win XP/7/8 system, you will not be able to access the 2nd FAT32 partition on the Removable USB drive. You can temporarily switch over partition 1 with partition 2 by running \_ISO\SWITCH_E2B.exe.
 
 
5. Move the file \grub_filemanager.mnu to the \_ISO\MAINMENU folder on the E2B partition. Edit this file to change the language\text if you wish. This will allow you to run the grub2 file manager from the E2B Main Menu.
 
6. Copy the file \_ISO\WINDOWS\WIN8\NO KEY (choose a version to install).xml to the folder \_ISO\WINDOWS\WIN7. You can use this XML file after you select a Windows 7 ISO so that all Editions wil be available to install.
 

Usage

You should now be able to load the grub2 File Manager from the E2B Main Menu, or directly UEFI-boot to the grub2 File Manager.
 
You can browse to the \_ISO folder on the E2B drive to boot .ISO, .WIM and .VHD files. Choose the Easy2Boot option if available.
 
Note: If booting to a Windows 7 or Windows 8.1 Install ISO, choose 'Install Windows' and then choose the NO KEY (choose a version to install).xml file to see all Editions in the Win7 ISO and to avoid having to enter a Product Key for Win 8.1.
 
You can select an XML file if one is present in the same folder as your Windows Install ISO. This means you can use SDI_CHOCO XML files with your Windows Install ISOs in the same way that it works with MBR\Legacy booting.
 
You can also make your own grub2 menus by using a file with the .cfg or .grubfm file extension. See here for an example of a Ubuntu-based ISO + persistence.
 

BIOS bugs!

Many BIOSes have some bugs:
1. In MBR\Legacy mode, files positioned beyond 128GiB on the disk cannot be accessed. This is why the first partition should be no larger than 128GiB.
2. Some UEFI-enabled BIOSes will ALWAYS boot to the grub2 UEFI boot files - you will not be able to boot to the E2B (Legacy) menu even if you enable CSM mode and disable Secure Boot. To fix this, you can temporarily rename the \EFI folder on the 2nd FAT32 partition to something else (e.g. EFIx). This will prevent it from UEFI-booting.
 

Add a grub2 menu

Some ISOs may not be directly UEFI64 bootable or you may want to boot an ISO with different parameters (cheat codes) or boot with persistence.
 
You can create a .cfg file in any folder which can contain your own grub2 menu. If you select the .cfg file in the 'open' menu and then select the 'File Info' menu entry you can see what pre-defined grub2 variables are available. For instance $grubfm_device will be name of the device+partition and $grubfm_dir will be the directory, so you can use (${grubfm_device})${grubfm_dir}fred.iso which will be equivalent to (hd0,msdos1)/_ISO/LINUX/fred.iso (for example). You will however need to 'hard-code' the name of the file (e.g. fred.iso) that you want to boot.
 

Example Windows 10 x64.cfg menu file:

(can be placed anywhere on same partition as ISO and XML file) - select the 'grub2 menu' entry after selecting the .cfg file.
 
menuentry "Install Windows 10 1909 x64 Pro Eng" --class=nt6 {
    set "XML=(${grubfm_device})/_ISO/WINDOWS/WIN10/Windows 10 Pro (no prompt to repair).xml"
    set "ISO=(${grubfm_device})/_ISO/WINDOWS/WIN10/Windows10_1909_x64_English_MS.iso"
    set "grubfm_file=${ISO}"
    source (memdisk)/boot/grub/rules/iso/win.sh
    win_isoboot "(loop)/sources/boot.wim"  "${XML}"
}
 
An alternative is to use a .grubfm file. These are automatically added as a 'User Menu' when you select a payload file (e.g. after you select Ubuntu.iso). The filename of the .grubfm file must match the filename of the payload file, e.g.
 
\_ISO\LINUX\Ubuntux64.iso
\_ISO\LINUX\Ubuntux64.grubfm
 
Available grub2 variables for .grubfm files are:
# available variables are:
# grubfm_file  - (dev)+fullpath+name.ext
# grubfm_path  - e.g. /test/ubunto.iso
# grubfm_dir   - e.g. /test/
# grubfm_device - e.g. hd0,msdos1
# grubfm_disk    - e.g. hd0
# grubfm_name    - e.g. ubuntu.iso
# grubfm_filename - e.g. ubuntu
# grubfm_fileext   - e.g. iso
# grub_platform=efi or pc  (UEFI or Legacy BIOS)
# grub_cpu=i386 or x86_64 (i386=Legacy mode or 32-bit UEFI, x86_64=UEFI64)
# grub_uefi_version  (e.g. 2.4)
# grub_secureboot
# CPU  (=32 or 64)
# grubfm_file        - e.g. (hd0,msdos1)/test/ubuntu.iso
# grubfm_path      - e.g. /test/ubunto.iso
# grubfm_dir         - e.g. /test/
# grubfm_device    - e.g. hd0,msdos1
# grubfm_disk       - e.g. hd0
# grubfm_name     - e.g. ubuntu.iso
# grubfm_filename - e.g. ubuntu
# grubfm_fileext     - e.g. iso
# grub_platform=efi or pc  (UEFI or Legacy BIOS)
# grub_cpu=i386 or x86_64 (i386=Legacy mode or 32-bit UEFI, x86_64=UEFI64)
# grub_uefi_version  (e.g. 2.4)
# grub_secureboot
# CPU  (32 or 64)
 
 

Here is a simplified .grubfm menu which uses some of these variables:

 
menuentry "Ubuntu 64-bit with persistence" --unrestricted --class ubuntu {
# WARNING: partnew will write a new partition entry
   if ! test -d (hd0,4) ; then partnew --type=0x00 --file="(${grubfm_device})/persist/${grubfm_filename}" (${grubfm_disk}) 4 ; fi
   loopback loop "${grubfm_file}" 
   set root=(loop)
    linux (loop)/casper/vmlinux boot=casper persistent iso-scan/filename=$grubfm_path quiet splash
    initrd (loop)/casper/$init
   boot
}
 
 

grubfm menu for Windows Install ISO:

.ISO and .XML must have same file name and be in same folder.
 
menuentry "Install Windows 10 1909 x64 Pro Eng" --class=nt6 {
    set "XML=Windows 10 Pro (no prompt to repair).xml"
    source (memdisk)/boot/grub/rules/iso/win.sh
    loopback loop "${grubfm_file}" 
    win_isoboot "(loop)/sources/boot.wim" "(${grubfm_device})${grubfm_dir}${XML}"
}
 
 

Using .imgPTN files

If the grub2 File Manager does not provide the functionality you need for a particular payload, then you can still use E2B .imgPTN files.
 
Since the grub2 File Manager can boot to any .WIM file, you can copy over a WinPE .WIM file (with WoW64 support) to your E2B USB drive and boot to WinPE from the WIM file and then run SWITCH_E2B.exe to switch-in a new .imgPTN image partition. If you use an extension of .imgPTN23 then the FAT32 File Manager partition will also be available.
 

Debugging

In any grub2 menu, you can enable the screen pager by typing:
e  (to edit a menu entry)
F2 (to get to grub2 console)
set pager=1  (to enable screen paging)
ESC (return back to menu)
 
If you are using your own .cfg or .grubfm menu file, you can add debug lines such as:
 
echo myvar=$myvar  (display variables)
ls /          (list files)
ls            (list devices)
sleep 3    (delay for 3 seconds)
read        (wait for user input)
 
or you can directly edit the grub2 menu and change\add lines by pressing e.
 

Available icons (used with --class=)

 

Languages

a1ive has made the File Manager available in a few different languages
 
These may also be available for E2B later, but some menu entries may still be in English.
 
  • German
  • Hebrew (Israel)
  • Russian
  • Turkish
  • Vietnamese
  • Taiwanese
  • Chinese