Add E2B to your own grub4dos USB drive
I strongly recommend that you add your own grub4dos menus as .mnu files, into the E2B folder stucture, rather than try to use some of the E2B features and batch files without running from the E2B menu system.
- The USB drive should not contain more than 2 primary partitions.
- Partition 4 must be empty.
- Partition 3 is used by some functions (e.g. if you use linux+persistence) and so this also should be unused.
- For best 'bootability', I recommend that the USB drive contains two Primary partitions (even if the 2nd one is very small and hidden).
- Also, ensure grub4dos is installed to both the MBR and the PBR of the first partition.
- Ensure you are using the same version of grub4dos that E2B uses - copy the \grldr file in the E2B download to the root of your grub4dos-bootable USB drive and overwrite any older version.
- You must keep the \_ISO folder structure used by E2B.
If you already have a syslinux or grub4dos multiboot USB drive, you can add E2B to your USB drive as follows:
1. Download, extract and copy ALL the E2B files to your existing multiboot USB drive (including the files in the root).
If you already have a \menu.lst file then do not overwrite it with the E2B menu.lst.
Ensure the E2B folder \_ISO is in the root of the USB drive (do not move it to a different folder).
2a. If you have a grub4dos menu.lst file, add in a menu entry to run E2B as follows:
title Run Easy2Boot
2b. If don't already have a \menu.lst file and have a syslinux boot pen, add this to your syslinux menu (the E2B \menu.lst file will be required)
Using E2B features in your own grub4dos menus (not recommended)
If you just want to use the same method of autorunning any payload file but don't want the E2B menu system (not recommended), you can use QRUN.g4b in your menus, e.g.
title Run xxxx.iso
title Run Hirens
You can also force QRUN to run an iso as if it had a different extension, e.g. this will run the iso as if it had the .isowinvh file extension
title Run Hirens
/%grub%/qrun.g4b force.isowinvh ()/_ISO/MAINMENU/Hirens.iso
Note: The %grub% variable must be set by you to point to the folder that contains QRUN.g4b and all the other files and folders under grub, so at the top of your menu.lst put something like:
cat /%grub%/%LANG%/STRINGS.txt > (md)0x880+0x80
# next line assumes the USB drive will be hd0 - it usually is when booting from USB.
if not "%E2BDEV%"=="hd0" pause ERROR: E2BDEV = %E2BDEV% !!!
#initialise memory areas so they are not confused by grub4dos seeing them as compressed files!
echo fffffffffffffff > (md)0x800+1
echo fffffffffffffff > (md)0x220+1
echo fffffffffffffff > (md)0x3000+1
echo fffffffffffffff > (md)0x6000+1
echo fffffffffffffff > (md)0xA000+1
# set keyboard scan codes (uses USA if not set) - optional
# load font file for non-US language fonts - e.g. Ü.
You will need to load a language file into memory. If you don't do this you will get 'Missing $$STRxxxx' messages.
Note that you should check E2BDEV is hd0.
Many different files and folders are used by QRUN.g4b - ALL the files and folders under the grub folder must be present.
You MUST preserve the folder structure (i.e. \_ISO\e2b\grub and \_ISO\e2b\firadisk and \_ISO for CONTIG.ISO and MyE2B.cfg) and set the grub variable to _ISO/e2b/grub . You can use a different folder for %grub% as long as you only boot simple linux ISOs (not Windows or WinPE) - ALL the E2B files and folders under the grub folder must be present. I do not recommend this though and cannot support it or be held responsible for any damage to the USB drive or to system disks if you don't use the original E2B folder structure!
WARNING: I recommend you do not use .imgPTN files in non-E2B menus! You can potentially destroy partitions on the system hard disk if anything goes wrong or if E2BDEV is set to the wrong device.
To run WinPE/Windows Install ISOs, you should first clear the \AutoUnattend.xml and \Unattend.xml files using the code below.
Otherwise, if you run any WinPE payload using .iso or .vhd or .wim, then it may use the \AutoUnattend.xml file from the previous boot!
# don't abort if error
# fill (rd) with 0's , 0x82d0 is rd-base mem address, Fn24 is memset - fill memory
call Fn.24 0x60000 0x20 102400 > nul ;; map (md)0x300+0x800 (rd) > nul
if exist ()/AutoUnattend.xml dd if=(rd)+1 of=()/AutoUnattend.xml > nul
if exist ()/AutoUnattend.xml dd if=()/_ISO/e2b/firadisk/empty.xml of=()/AutoUnattend.xml > nul
if exist ()/Unattend.xml dd if=(rd)+1 of=()/Unattend.xml > nul
if exist ()/Unattend.xml dd if=()/_ISO/e2b/firadisk/empty.xml of=()/Unattend.xml > nul
I recommend you use the Easy2Boot menu system to run Windows-based payload files for these reasons.
Example for running a Win7 Install ISO using E2B (RunVista.g4b is for Server2K8R2,Win7 or Vista, RunWin8.g4b is for Server2012, Win10 and Win8)
title Install Windows 7 (32-bit) \n Install Win7 from ISO
# suppress return to Windows Install menu
title Install Windows Server 2008 R2 (64-bit) \n Install SVR2K8 from ISO
# suppress return to Windows Install menu
MFOLDER is the folder containing the ISO and any XML file.
You can also specify a specific XML file as the second parameter - see here
Transfer to a different E2B drive (DANGER!)
If you boot grub4dos from a different drive or partition, you can transfer to the E2B drive using this menu entry:
find --set-root /_ISO/e2b/grub/menu.lst
Note that this is not recommended because the boot drive will not be the E2B drive. Check the E2BDEV variable carefully! Be aware that Easy2Boot menus may destroy partition 4 of a drive (drive is defined by %E2BDEV%). Also, some .mnu files may expect to be running from hd0 and be hard-coded for hd0. It also assumes that hd0 is a USB drive for certain functions - it may accidentally erase/modify disk 0 of your system! So check carefully any menu you use!
Note: This may not work for exFAT E2B drives because grub4dos may just load your other \menu.lst file first!