Uefi Multiboot

0 views
Skip to first unread message

Ortiz Ullery

unread,
Aug 3, 2024, 6:08:16 PM8/3/24
to dunksembsola

E2B includes 3 different multiboot menu systems based on grub4dos, grubfm and Ventoy. You can boot to almost anything from one USB flash or USB hard/SSD drive. Install Windows 98/XP/Windows 7/8/10/11 and Linux from ISOs, boot from Linux ISOs, boot Windows or Linux VHDs, run DOS programs, floppy images, etc.

These three menu systems should give you the maximum chance of successfully booting from any of the payload files that you copy onto your E2B USB drive. In addition there is free online help from me, Steve the developer. PDF eBooks are also available to buy for just $5 (my eBooks have an average 4.5/5 star rating) and contain original content based on 30 years of personal experience in OEM computer development.

Troubleshooting tip: If the cmd script does not work, run \_ISO\docs\Make_E2B_USB\Drive\DebugAll_MakeE2B_Admin.cmd as Administrator and after it fails, look at the log file (e2b.log). Disable your Anti-Virus software.
Developer versions of WIn10/11 do not include wmic.exe and so will not work. You must use a full retail or volume licensed version of Windows to make your E2B USB drive.

The menu folders are in capital letters just under the \_ISO folder on the first partition. For example, copy a Windows 10 install ISO into the \_ISO\WINDOWS\WIN10 folder or copy a Linux ISO to the \_ISO\MAINMENU or \_ISO\LINUX folder.
You can add your own new sub-menu folders by running a Windows batch file.

3.2 After copying over all your payload files, run the Windows batch file \MAKE_THIS_DRIVE_CONTIGUOUS.cmd file on the USB drive. This makes all the payload files contiguous. This should also be run again if you later add any new payload files. Contiguous files are needed for some types of operation (not required for Windows ISOs).

Easy2Boot v2 adds agFM which allows you to UEFI-boot directly from the agFM\Ventoy boot files on the second partition (FAT32) of the E2B USB drive and select an ISO, WIM file, VHD file, IMG file, etc.
You can also load the Ventoy menu system from the agFM menu system (use F5).
You can also switch a Ventoy partition image into Partition 2 and directly UEFI-boot to Ventoy. This converts the USB drive into a Ventoy USB drive.

E2B and agFM can replace a partition on the USB drive with a different partition.
You can have any number of partition image files.
The partition image files can contain any type of image (FAT/NTFS/exFAT/ext4/hfs/linux swap, etc.)
Once it is switched in, you can then reboot to the replacement partition.
.ISO/.IMG/.VHD/.ZIP. etc, files or disk volumes can be converted to partition image files.
Partition image files have a file extension beginning with .IMGPTN

.imgPTNREP3 image files must be located on Partition 3 of your E2B USB drive. The file should have a .imgPTNREP3 extension. When selected, it will replace the current Partition 3 with the contents inside the image file. This means you can switch-in any partition containing any filesystem or swap file or raw partition. For instance, you could UEFI64-boot to agFM and switch-in an hfs partition image for installing Mac OSX onto a system.

Easy2Boot can recognise special file extensions. For instance, if a .iso file boots OK using the default settings, you could just change the file extension to .isodef. However, the Ventoy menu system will not recognise the .isodef file extension, so instead we can use the special filename suffix of _.isodef.iso. For instance Ubuntu x64_.isodef.iso will immediately boot when selected with no user prompts. We could instead use Ubuntu x64_.isodef64.iso and the Ubuntu ISO would only be listed in the E2B menu if the computer you booted on has a 64-bit CPU. The AgFM menu system also supports a subset of these special suffixes too.

Most eBooks are over 100 pages long, contain original content and step-by-step exercises which are suitable for both the beginner or the more experienced user.
Customer reviews are located at bottom of each eBook product page and multi-buy discounts are available when you buy more than one eBook. Please also visit RMPrepUSB.com and the E2B Forum.
Subscribe to my blog for the latest news, tips, USB boot articles and free eBook updates.

Grub2 on a Multi-Boot EFI SystemWhen I bought my new laptop several years ago, I chose Ubuntu asits first distro even though I usually run Debian.For one thing, Ubuntu has an excellent installer.Second, they seem to do more testing on cutting-edge hardware, so Ithought the chances were better that hardware on a brand-new laptopwould be supported.Ubuntu has been working fine for a couple of years, but with 21.10("Impish Indri") it took a precipitous downturn.First, it has weird X rendering errors:I often see snow or garbled video obscuring popup menus, especiallyin Firefox or mupdf.In addition, Chromium doesn't work. Chromium on Ubuntu uses snaprather than being a native package -- that's been true for at leasta year, but that's only been a minor annoyance. Sometimes shutdownfreezes for 90 seconds because it's "waiting for stop job", whichusually turns out to be snap-related, and snap also causes delaysduring booting.But as of 21.10, snap doesn't work at all unless you use the fullGnome or KDE desktop. I filedbug 1951491,and a couple other people chimed in with "me too" reports,but it was closed as "Invalid" because they don't support anythingbesides the full desktop environments).Anyway, the irritants mounted up until I finally made time to installDebian. I used debootstrap from Ubuntu to install a minimal "testing"system (my article on debootstrapis old and probably outmoded, so readDebootstrapChrootandDebootstrapif you want to learn more).I hacked up a grub entry for the new system in /etc/grub.d/09_localand booted into it.Why not just let grub automatically detect the new OS and makean entry for it? Because autodetection doesn't work. It pairs root partitionswith kernels on the wrong partition, which fails badly when you tryto boot, and when I filedbug 1912677,it was initially marked as low importance, becauseRunning two *Ubuntu installs on the same system is not really supported, as there can only be one grub installed.Same for os-prober really, it doesn't really work correctly for anything other than Windows.After I expressed incredulity (how many decades have Linuxusers been multi-booting now?) the importance was changed to Medium,but there's been no further interest in the year since then.Anyway, that means that on a multiboot system, I need to make my ownentries for every OS, and not rely on the os-prober. I create a filein /boot/grub.d with a low number, like 09_local,menuentry " --------- AUTOGENERATED CRAP BELOW ----------" echo "(just a separator)"so I know not to try to boot anything that appears below the line.That done, I booted into my new Debian install,and spent a few hours installing packagesthat weren't in the minimal install, and configuring things thatweren't automatically configured (for instance, installing servicelike NetworkManager or pulseaudio doesn't actually enable them; youhave to futz with systemd to get those services running).I now had a system that worked pretty well, and it was time to make itthe default. So I copied that /etc/grub.d/09_local entry fromUbuntu to Debian, moved the Debian entry up to the top, and ranupdate-grub. Rebooted, and ...... the old Ubuntu install was still first. update-grubhadn't worked.How to Point Grub at a Different PartitionA bit about my system. I'm running off an internal solid-state disk.Ubuntu is installed on /dev/nvme0n1p3, while the new Debianis on /dev/nvme0n1p4.Searching the web, I quickly figured out that the command I neededwasn't update-grub but grub-install. But with what arguments?First, the disk. In /dev there are entries for both /dev/nvme0and /dev/nvme0n1. It turns out /dev/nvme0 is a characterdevice for talking directly to the SSD controller; /dev/nvme0n1is the block device for the full disk, equivalent to /dev/sda.(I don't know why it's n1; are thereSSDs that have n2, n3,etc.?)But if you just run something like grub-install /dev/nvme0n1,you'll get an error like# grub-install /dev/nvme0n1Installing for i386-pc platform.grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.grub-install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..grub-install: error: will not proceed with blocklists.That's because by default, Debian (and probably most other distros)installs grub-legacy, the old MBR version of grub, whichdoesn't handle disks set up for EFI.The first step is to replace that grub-legacy with a version ofgrub tailored to EFI, and apparently it also has to be tailored tothe current architecture:apt-get install grub-efi-amd64The EFI setup that the Ubuntu installer created on my diskcreated a 241 Mb partition at the beginning of the disk(vme0n1p1) which it mounted on /boot/efi.Inside that EFI position is a whole directory structure, includinga directory called /boot/efi/EFI/ubuntu/. Presumably my goalwas to get a directory called /boot/efi/EFI/debianand somehow point the boot there.(I should mention that I am not using SecureBoot. You can check thatwith mokutil --sb-state.)To make a long story slightly less long, once I'd installed theright version of grub, the right command turned out to be:grub-install --target=x86_64-efi --efi-directory=/boot/efi(Some people suggested adding --removable, which apparently isuseful for making EFI live installs on USB sticks, but it didn't dowhat I needed for this internal disk.)After running that command, sure enough, I had both debian andubuntu directories inside /boot/efi/EFI.I ran update-grub again, just to be on the safe side,but I don't know if it was actually needed.Check Boot Status from a Running SystemI was theoretically ready to reboot. But since I didn't know whetherthat grub-install had done the right thing, I wasn't sure ifmy system was even bootable. Is there any way to find out from arunning system which partition's grub menu is the active one?One useful command is efibootmgr:# efibootmgrBootCurrent: 0003Timeout: 2 secondsBootOrder: 0003,0000,0001,0019,001A,001B,001C,001D,001E,001F,0020,0021,0022,0023,0024,0002Boot0000* ubuntuBoot0001* Windows Boot ManagerBoot0002* Linux-Firmware-UpdaterBoot0003* debian... 25 more lines snippedNote that the BootOrder line starts with 0003;and Boot0003, a few lines down, is debian.So apparently I had indeed switched to Debian's grub.It made me curious, though. I actually have two ubuntupartitions, and each of them has a /boot/grub/grub.cfg.How does grub figure out on which filesystem it should lookfor grub.cfg?For Ubuntu, the answer seems to be fairly straightforward./boot/efi/EFI/ubuntu has several .efi files plus a grub.cfg:# ls /boot/efi/EFI/ubuntu/BOOTX64.CSV fw fwupdx64.efi grub.cfg grubx64.efi mmx64.efi shimx64.efiThe grub.cfg is a stub that contains:search.fs_uuid 368bb829-9fea-47da-9f07-ccb23a47506c root set prefix=($root)'/boot/grub'configfile $prefix/grub.cfgThat just happens to be the uuid of the filesystem of the Ubuntuwhere I most recently ran update-grub.So I guess that's how Ubuntu's grub picks the right partition.But there's only one file in /boot/efi/EFI/debian: grubx64.efi.So if I have two Debian partitions, how does grub know which partition's/boot/grub/grub.cfg to use?I spent a lot of time trying to answer that question.I have some theories, but no answers yet; hopefullyI'll find out and write about it in a future article.Oh, and remember how one of my reasons to install Debian was thatChromium doesn't work on Ubuntu? The joke's on me there: turns outDebianhas removed Chromium from its repositories, and has no plans ofputting it back because it's too much work to keep up with all thesecurity bugs. I guess if I want to test website layout on BlinkI'll have to use a python-qt5-webengine browser and hope that givesme a good enough idea of what Chrome users will see.Nevertheless, I'm going to stick with Debian at least for a while:it boots so much faster, and doesn't seem to have any of the Xrendering problems of Ubuntu Impish.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages