How to make an E2B USB drive using linux

You can install E2B to an existing partition on a USB drive using the (FAT32) or (NTFS) linux bash shell script which is included in the Easy2Boot download (v1.83+). will format an existing partition as FAT32, copy the E2B files onto it and then run bootlace to install grub4dos to the MBR:
  1. Download and unzip the Easy2Boot zip file to a folder on your internal linux hard disk
  2. Open a Terminal session at the \_ISO\docs\linux_utils folder (contains utilities and scripts)
  3. Use chmod to make the files in linux_utils executable (sudo chmod 777 *)
  4. Type ./    (this requires the bash shell - if you are using the sh shell you will get errors - or try sudo bash ./
Read the ReadMe file in the \_ISO\docs\linux_utils folder for more details and see the article on #114 or my blog post here.
FAT32 is used because defragfs only works on FAT32 volumes.
To format a partition as NTFS, you can use and use udefrag to defrag the files (E2B v1.83+)
For best bootability, I strongly recommend you create a small (hidden) partition at the end of the USB drive as well (use gparted).
Note: If possible, use RMPrepUSB and Windows to prepare your USB drive - this will give better boot compatibility over a wider range of systems.
Making files contiguous under linux using defragfs only works on FAT32 partitions.
Use udefrag -om /dev/sdX1 for NTFS volumes (see ReadMe file in linux_utils folder).

Creating files containing ext2/3/4 filesystems for persistence

For persistence, you often need to create a file on the E2B USB drive which is formatted as an ext2/3/4 filesystem (instructions are always inside the .mnu file). To do this under linux AND have it contiguous (which is required for E2B) - see the thread here.
Use cd to get to the directory where you have mounted the USB drive - e.g. /media/USBDrive, then create a file as follows (example uses 1GB mint-rw, volume name is normally casper-rw)

dd if=/dev/zero of=mint-rw bs=1M count=1024 

mkfs -t ext2 mint-rw -L casper-rw
or for ext3
mkfs.ext3 -F mint-rw -L casper-rw
Making a sparse file using dd may be faster, try this...

dd if=/dev/zero of=casper-rw bs=1M count=0 seek=1024

Making files contiguous

Most ISOs and all persistence files need to be contiguous.

to defrag the file on a FAT32 volume use...

sudo perl ~/Downloads/Easy2Boot/_ISO/docs/linux_utils/defragfs /media/Multiboot -f 
If using an NTFS volume, then defrag the whole volume (udefrag is in the \_ISO\docs\linux_utils folder):
sudo umount /dev/sda1
sudo ./udefrag -om /dev/sda1

Testing using QEMU under linux

1. Run following command to find the E2B USB drive (use lowercase -L for list)
sudo fdisk -l

2. Boot using qemu-system-x86_64

sudo qemu-system-x86_64 -machine accel=kvm:tcg -m 512 -hda /dev/sdc

"/dev/sdc" is the usb device as listed by fdisk, 512 is the amount of memory to allocate.

UEFI support

Unfortunately, there is no linux equivalent of the MakePartImage.cmd Windows script which makes .imgPTN files. If you want to try UEFI-booting to linux ISOs without using a Windows system, try the grub2 menu system.

More Info