It was previously possible to make partition images of Ventoy and then replace Partition 2 of the E2B USB drive with the Ventoy partition image, however in Ventoy v1.0.57 onwards, extra checks have been added into Ventoy and it now checks for Ventoy grub2 boot code in the MBR of the drive. This means that new versions will no longer work as partition images. :-(
However, I have modified the script and .cfg files so that it now also replaces the grub4dos boot code with the Ventoy grub2 boot code. The result is that we can now make Ventoy partition images again and boot to them and Ventoy still thinks the drive is an 'official' Ventoy USB stick.
Note that this exercise is only for someone who knows where their towel is and don't try it if you have not made a backup of your E2B drive just in case something goes wrong!
Instructions
1. Download the latest agFM which is now E2B UEFI File Manager agFM v1.74.zip
P.S. agFM v1.74 is now released.
I assume you have E2B v2.10 or later already installed.
2. Extract the contents to the root of Partition 2 of your E2B v2 USB drive (overwriting any older version of agFM).
3. In Partition 2, double-click on the
"\e2b\Update agFM\Make_Latest_Ventoy_Partition_Image.cmd" script.
This will automatically download the latest version of Ventoy from github and then make three new partition image files from it (and download the required grubfm iso file). See here for more details. You will need spare space on Ptn2 and also ImDisk should be pre-installed on your Windows system.
Note that if you have used your own agFM startup menu, you will be warned and given instructions by the script on how to modify your startup_menu.txt file so that the three image files are listed in your startup menu.
Usage
When you boot to agFM (either via the E2B legacy menu or direct UEFI-boot), you should see the three new partition images listed in the start up menu:
When you select one, it will be switched in and then the system will reboot to Ventoy.
On reboot, we now have legacy grub2 boot code and Ventoy grub2 UEFI files, so it should now boot to the latest version of Ventoy (legacy boot or UEFI boot).
Note: I have also added the Ventoy ARM64 and MIPS UEFI boot files into the Ventoy partition images, but I have not tested them because I have no suitable system.
Switch back to E2B
To switch back, we need to run a1ive's grubfm_multiarch.iso. You should find the iso is listed first in the Ventoy menu system. If not then find it in the root of Partition 1 using the Ventoy menu system (you can copy the iso file to any other folder if it is more convenient for you).
When you boot to the grubfm ISO file, you should now see a 'restore agFM Partition 2' menu entry:
Select this and type '1' when prompted, and the system will reboot with the restored agFM partition and grub4dos boot code.
Note: I suggest you test using a freshly made E2B USB drive for this because there is a risk that you might make your E2B drive unbootable or mess up the partitions! Do not attempt to switch in any other sort of .imgPTN file and Switch_E2B.exe will not work either.
If you see any form of error message, it may be safer to switch off the system rather then press ENTER or ESC to try and get it to proceed.
Hopefully this new script will allow us to always have available the latest version of Ventoy so that you can test out any new features or bugfixes before I make a 'Ventoy for Easy2Boot' recompiled version.
Good luck!
Theory
If you are interested, after the Ventoy image is switched in, sectors 0-2047 are used like this:
LBA0 - grub2 MBR boot code plus partition table
LBA1-999 - grub2 stage 1.5 boot code
LBA1000-1999 - backup of original sectors (LBA0-999)
LBA2048 Start of Ptn1
To restore the original grub4dos boot code and MBR, I simply copy 1000 sectors from LBA1000 to LBA0 and reboot.
Please let me know of any success or fails using this method. I can then fully release agFM v1.74.
It seems to be working well for me.
ReplyDeleteThanks for letting me know
ReplyDelete.imgPTN based on geub4dos bootloader only, or can be done by grub2 ??
ReplyDeleteAlso grubfm (a1ive grub2)
DeleteThis comment has been removed by the author.
ReplyDelete