
Add E2B to your own grub4dos USB drive
I strongly recommend that you add your own grub4dos menus as .mnu files into E2B, rather than trying to use some of the E2B features and batch files in your own menu system 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).
- 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 preserve 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 Easy2Boot\nLaunch Easy2Boot
errorcheck on
debug off
splashimage --animated=0
splashimage
set *
graphicsmode -1 640 > nul
map --unmap=0:0xff > nul
map --unhook
set grub=_ISO/e2b/grub
configfile /_ISO/e2b/grub/menu.lst
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)
LABEL Easy2Boot
MENU LABEL Easy2Boot
BOOT /grldr
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
/%grub%/qrun.g4b ()/_ISO/MAINMENU/xxxx.iso
boot
title Run Hirens
/%grub%/qrun.g4b ()/_ISO/MAINMENU/Hirens.isowinvh
boot
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
boot
Note: If the filename or path contains spaces, you must precede the space with a \ character, e.g. /_ISO/MAINMENU/Windows\ PE.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:
errorcheck off
set *
setmenu --u
set grub=_ISO/e2b/grub
set LANG=ENG
cat /%grub%/%LANG%/STRINGS.txt > (md)0x880+0x80
# next line assumes the USB drive will be hd0 - it usually is when booting from USB.
set E2BDEV=%?_BOOT:~1,3%
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
###set KBD=KBD_GERMAN.g4b
###call /%grub%/%KBD%
# load font file for non-US language fonts - e.g. Ü.
font ()/%grub%/unifont.hex.gz
You will need to load a language file into memory (3rd line). If you don't do this you will get 'Missing $$STRxxxx' messages.
Note that you should check E2BDEV is hd0.
\_ISO\e2b\firadisk and \_ISO\e2b\grub folders should be present and all root files from E2B in the root. I suggest you copy all E2B files and folders if possible.
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
errorcheck off
# 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
# don't abort if error
errorcheck off
# 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/2016, Win10 and Win8)
title Install Windows 7 (32-bit) \n Install Win7 from ISO
# suppress return to Windows Install menu
set NOWMENU=1
set ISO=Win732.iso
set MFOLDER=/_ISO/WINDOWS/WIN7
set HDG=My Menu Heading
/%grub%/RunVista.g4b %MFOLDER%
boot
title Install Windows Server 2008 R2 (64-bit) \n Install SVR2K8 from ISO
# suppress return to Windows Install menu
set NOWMENU=1
set ISO=Win2K8R2_x64.iso
set MFOLDER=/_ISO/WINDOWS/SVR2K8R2
set HDG=My Menu Heading
/%grub%/RunVista.g4b %MFOLDER%
boot
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.
You can also specify a specific XML file as the second parameter - see here.
Example \menu.lst file
This \menu.lst file assumes you also want to use the QAUTO.g4b E2B menu system and the standard E2B menu system with folders in the \ISO folder.
graphicsmode -1 800
set grub=_ISO/e2b/grub
/%grub%/hotkey -A
set LANG=ENG
cat /%grub%/%LANG%/STRINGS.txt > (md)0x880+0x80
set E2BDEV=%?_BOOT:~1,3%
if not "%E2BDEV%"=="hd0" pause ERROR: E2BDEV = %E2BDEV% !!!
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
font ()/%grub%/unifont.hex.gz
#clear GFX if not using GFX menu
set GFX=
default 0
timeout 30
# Colour pairs are Text/Background - i.e cyan/blue = cyan text on blue background
# Valid colours are: black, blue, green, cyan, red, magenta, brown, light-gray, dark-gray, light-blue, light-green, light-cyan, light-red, light-magenta, yellow and white.
color normal=light-cyan/black highlight=red/black helptext=yellow/black standard=light-cyan/black border=light-gray/black
# 00rrggbb00rrggbb = 00Bgnd00Fgnd
color highlight=0x0000000000FF0000
#dont show extensions in menu
#set EXTOFF=1
#center heading
set CENTREHD=1
# Footer variables
set FCOLOUR=0103
set HELPTEXT=\x20Help [F1] HDD0 [F7] Back [F8] Reboot [F9] Power [F10] (%^LANG%) www.easy2boot.com
set HBTM=3502
# Heading
set HCOLOUR=0103
set HEADPOS=0000
# menu
# wordspacing linespacing borderwidth tophelp numberofitemsinmenu topstart menuwidth rightstartposofmenu
# n = unchanged (if wdspace or lnspace is not n then screen is cleared)
# tophelp=topstart+noitems for menuhelp text just under menu box
set wdspace=n
set lnspace=n
set topstart=2
set rstart=3
set menuw=64
set bdwidth=1
set noitems=24
set tophelp=26
# md5 text below = easy2boot
set pwd=--md5 $1$1$okAQ3AJUdhqf3TVrwKvJP1
# == code for menu ===
set NEWGRUB=
# detect new setmenu command
cat --locate="setmenu --param" (md)0x200+0x100 > nul && set NEWGRUB=1
if not exist NEWGRUB && if exist RTL pause --wait=3 WARNING: This version of grub4dos does not fully support right-to-left languages (%LANG%) %redirp%
#will restore max menu grub4dos default (screws up though!)
#/%grub%/menusetting.gz u
# set menu position (clears the screen so use clear afterwards to fill the screen with background colour)
if %rstart%<=1 set rstart=2
if "%GFX%"=="" if not "%DONEMENU%"=="1" /%grub%/menusetting.gz %wdspace% %lnspace% %bdwidth% %tophelp% %noitems% %topstart% %menuw% %rstart%
# calculate padding for headings
if not exist HPAD call /%grub%/SetHPAD.g4b %rstart%
# HPAD now has correct number of spaces for padding the headings
# If want centering of headings, set CENTERHD to menu width
if "%CENTREHD%"=="1" set /a CENTREHD=%menuw%
if "%RTL%"=="1" set /a RTL=%menuw% > nul
# if AUTONUM not turned off adjust width
#if exist RTL if not exist AUTONUM set /a RTL=%menuw%-4 > nul
# use new right-align command if available
if exist NEWGRUB setmenu --left-align
if exist NEWGRUB if exist RTL setmenu --right-align
#remove cursor help text
if exist NEWGRUB setmenu --keyhelp=61=0xe && setmenu --ver-off
#autonumber all menu entries with a space (20) and a number (01)
if "%AUTONUM%"=="" set AUTONUM=0x2001
write --bytes=2 0x8274 %AUTONUM% > nul
#set menu help text position
if not exist hstart set /a hstart=%rstart%-1
if not exist hwidth set /a hwidth=%menuw%+2
if exist NEWGRUB setmenu --help=%hstart%=%hwidth%=%tophelp%
if exist NEWGRUB setmenu --box x=%rstart% y=%topstart% w=%menuw% h=%noitems% l=%bdwidth%
set hstart= && set hwidth=
#clear variables
set NEWGRUB=
set wdspace= && set lnspace= && set topstart= && set rstart= && set noitems= && set menuw= && set bdwidth= && set tophelp=
#===== MENU ITEMS HERE =====
iftitle [ls (bd)/iso/autoboot/ > (md)0x9F00+1 && checkrange 1:-1 read 0x13E0000 > nul] Load E2B AutoBoot Menu
set LBACKMENU=(bd)/menu.lst
(bd)/%grub%/QAUTO.g4b .automenu /iso/autoboot
debug 0
dd if=%LBACKMENU% of=(md)0xA000+0xA0 > nul
configfile (md)0x3000+0xA0
iftitle [ls (bd)/iso/LINUX/ > (md)0x9F00+1 && checkrange 1:-1 read 0x13E0000 > nul] Load E2B Linux Menu
set LBACKMENU=(bd)/menu.lst
set MFOLDER=(bd)/ISO/LINUX
set HDG=Steve's Linux Menu
dd if=%LBACKMENU% of=(md)0xA000+0xA0 > nul
debug 0
(bd)/%grub%/submenu.g4b
boot
GFXboot example
This can be used in your \menu.lst file if you have a message GFXBoot menu file
#######################################################################################
set grub=_ISO/e2b/grub
if "%LANG%"=="" set LANG=ENG
cat /%grub%/%LANG%/STRINGS.txt > (md)0x880+0x80
set E2BDEV=%?_BOOT:~1,3%
if not "%E2BDEV%"=="hd0" pause ERROR: E2BDEV = %E2BDEV% !!!
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 EXTOFF=
default 0
timeout 30
# GFX file must be in \_ISO
set GFX=message
gfxmenu = /_iso/message
#######################################################################################
iftitle [ls (bd)/iso/autoboot/ > (md)0x9F00+1 && checkrange 1:-1 read 0x13E0000 > nul] Load AutoBoot Menu\n Run any ISO
set LBACKMENU=(bd)/menu.lst
(bd)/%grub%/QAUTO.g4b .automenu /iso/autoboot
debug 0
dd if=%LBACKMENU% of=(md)0xA000+0xA0 > nul
configfile (md)0x3000+0xA0
iftitle [ls (bd)/iso/LINUX/ > (md)0x9F00+1 && checkrange 1:-1 read 0x13E0000 > nul] Load Linux Menu\n Load Linux Menu
set LBACKMENU=(bd)/menu.lst
set MFOLDER=(bd)/ISO/LINUX
dd if=%LBACKMENU% of=(md)0xA000+0xA0 > nul
debug 0
(bd)/%grub%/submenu.g4b
boot
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
chainloader /grldr
boot
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!
Recommended for Easy2Boot (fastest flash drive!)
SanDisk Extreme SDCZ880-128G-G46
- Home
- Start & Intro
- Quick Setup Guide >>>
- DOWNLOADS >>>
- YouTube videos
- Tutorials and How To's
-
Make a USB Drive >>>
- Make a multi-partition E2B USB drive using RMPrepUSB
- Use an existing USB HDD for E2B
- Use LINUX to make an E2B drive + defrag
- How to Update E2B
- How to make a WINHELPER USB Flash Drive (fix 'Required DVD drive driver is missing')
- Multiple partitions on a USB Flash drive
- Using other partitions or drives
- Backup/Restore/Copy (clone) any E2B USB drive
- Make and burn an E2B DVD
- Using E2B with a Zalman/IODD
- Add E2B to your own grub4dos USB drive
- How to remove E2B
- E2B Menu System
- UEFI booting from E2B
-
How to add Payload Files and Use E2B >>>
- Make files CONTIGUOUS
- File Extensions recognised by E2B
- UEFI+MBR and how to make .imgPTN files
- MakePartImage and how to change the CSM Menu
- UEFI-Multiboot and rEFInd
- Using SWITCH_E2B with .imgPTN files
- Using the \_ISO\AUTO folder
-
WINDOWS payloads >>
- E2B USB HDD - Installing Windows with a 'WinHelper' drive
- Windows XP Install ISOs
- Install XP 32-bit + disk drivers (DPMS)
- Windows XP 64-bit
- Install XP using WinPE (one step process)
- Add XP Install ISOs using WinSetupFromUSB
- Windows Vista/7 Install ISOs
- UEFI boot from Windows 7 Install ISOs
- Windows 8/10 Install ISOs
- Unattended Installs
- XMLtoE2B.exe (Unattend.XML files)
- Adding >4GB Windows Install ISOs using .imgPTN files
- Automating Windows Installs from .imgPTN files
- Split_WinISO
- Add Windows ISOs to partition 2
- Windows AIO ISOs
- WindowsToGo
- WinNTSetup
- WinLite10 XML files
- SDI_CHOCO (install drivers, apps and updates) >>
- .VHD and .WIM files
- PassPass (bypass the Windows Password)
- Hack Windows Account Passwords (UtilMan.exe)
- Windows 2000
- Windows 98
- Multipoint Server
- Add the latest XP drivers (DPMS)
- Add a Windows Install menu entry
- LINUX payloads >>
- MSDart ERD ISOs
- WinBuilder, Medicat, Gandalf and WinPE ISOs
- Hirens/Strelec/DLC/F4 ISOs
- DOS (MS-DOS and FreeDOS)
- HAIKU
- MAC OS X
- FreeBSD
- MOVE_IMGPTN
- List of tested ISOs\payloads (with instructions)
-
Configure E2B >>>
- Menu settings (quick reference)
- E2B Menu Demo
- E2B_Editor
- E2B files and folders explained
- MyE2B.cfg - E2B configuration file >>
- Change the payload menu entries and help text using a .txt file
- Change the order of the menu entries
- Change the background wallpaper
- Different background wallpaper for each menu
- Default Menu and Timeout
- Change the Language, Headings, Menu and text
- Changing the default E2B menu entry order
- 'Change File Extension' prompt (Auto-Suggest)
- Change the Keyboard Layout
- About .mnu files
- Sample .mnu files
- PimpMyDrive.cmd
- Reduce the E2B messages
- Add a new Sub-Menu folder
- Stamps, Animation and Tunes
- Draw lines and boxes on the screen
- Write text/time/date to the menu screen
- Global Hotkeys
- Themes (Skins)
- Fonts
- Speeding up E2B (inc. FASTLOAD)
- One Single Menu
- The E2B F1 Help menu
- Add your own Help Menu
- Add Help text files (.help)
- Add Windows Install ISOs to the Main Menu
- Change the Windows Install Menu
- Passwords and Security
- Hide Payloads and Menu Entries
- Guest Mode
- GFX Boot Menus
- Dual Booting
- Change the CSM .imgPTN Menu
- Configure Clover
- Right-to-Left Languages
- Create new language files
- How to modify LOADISO.CMD (Repair message)
- Count number of boots
- UEFI - useful things know!
-
FAQ, Info, TroubleShooting, QEMU and Virtual Machines >>>
- 'File Not Contiguous' and 'Too Many Fragments' Errors
- 137GB 'BAD BIOS' bug
- TroubleShooting E2B
- E2B Error Messages
- Grub4dos Error Numbers
- Common problems with payload files
- Repair a corrupt E2B drive
- Known Issues and Bugs
- Slow and buggy BIOSes
- How E2B Works
- QEMU and Virtual Machines >>
- Using VBOX with a WinHelper USB drive
- Debugging E2B
- CONTIG.ISO
- ISOBOOT
- WIMBOOT (iPXE)
- grub4dos
- Useful resources
- Removable v. Fixed
- Gallery
- Guestbook
- Forum
- Blog
- a1ive grub2 File Manager (MBR+UEFI)
- Add Ventoy
- Site Map
- eBooks
- Contact Me >>>
- Donate
- Licensing
- Privacy policy (GDPR)
- Bespoke design service
- Grub2 Menu System (UEFI_GRUB2_PTN2)