Thursday, 27 October 2022

Boot pmagic_2022_09_04.iso from E2B\agFM\Ventoy with persistence

This version requires a 64-bit CPU and needs at least 2GB of RAM (and 4GB if not using save feature).

It is possible to boot Partition Magic 2022  from an ISO file and use the LIVE SAVE (persistence) feature which allows you to create a persistence file which is saved on exit and automatically loaded on boot.

My personalized purple Pmagic with persistence.


Pmagic will try to place the save file in the same folder as the \pmagic\pmodules\PMAGIC_2022_09_04.SQFS file. We must therefore create such folders and the file on our USB boot drive so that Pmagic can find it. Since the ISO also contains that directory and file, using the normal E2B\agFM\Ventoy boot methods will not work because PMagic will find the virtual ISO and try to save or load the persistence file from the virtual ISO.

So the ISO file cannot be booted with persistence using the normal 'partnew' or Ventoy menu system, but it will work if we use the "iso-filename=' parameter instead of mounting the ISO file as a virtual DVD device or as a partition.

This means we must make our own menu entry to make the LIVE SAVE persistence feature available.

Easy2Boot

Download the latest 2.17 version of E2B, extract the files to an empty folder and run the .\UPDATE_E2B_DRIVE.cmd script

Ensure the following files are present:

  • \_ISO\LINUX\pmagic_2022_09_04.iso
  • \_ISO\LINUX\Parted_Magic_2022_Live_Persistent.mnu - copy from "\_ISO\docs\Sample mnu files\Linux\Parted_Magic_2022_Live_Persistent.mnu"
  • \pmagic\pmodules\PMAGIC_2022_09_04.SQFS (any size or contents)
Instead of using the new .mnu file, you can use the ISOBOOT feature of the E2B menu system - select the pmagic_2022_09_04.iso in the E2B LINUX menu and then hold down the SHIFT key and press the ENTER key to run the ISO in 'isoboot' mode (the ISO file does not need to be contiguous when using 'isoboot' mode to boot Linux ISOs). This only works with E2B v2.17aBeta or later (there was a bug introduced into 'isoboot' that I just discovered today!).

The .SQFS file can be of zero size or larger and it's contents (if any) do not matter - it just has to be there!

agFM (v1.96 or later)

A .grubfm menu file needs to be added to support agFM.

Files for pmagic+Save feature in agFM:
  • \_ISO\LINUX\pmagic_2022_09_04.iso
  • \_ISO\LINUX\pmagic_2022_09_04.grubfm - copy from \e2b\Sample agFM menu files\LINUX\pmagic_2022_09_04.grubfm
  • \pmagic\pmodules\PMAGIC_2022_09_04.SQFS (any size or contents)
Then boot to the agFM menu (legacy or UEFI) and select the pmagic_2022_09_04.iso file - then select from the Secondary agFM menu the 'User menu' entry. This will load the .grubfm menu file.



Both legacy and UEFI64 should work,

The pmagic .grubfm file can be found in the latest agFM v1.96 download at \e2b\Sample agFM menu files\LINUX\pmagic_2022_09_04.grubfm on Partition 2.


Ventoy

Three files are required:

  • \_ISO\LINUX\pmagic_2022_09_04.iso
  • \ventoy\ventoy_grub.cfg
  • \pmagic\pmodules\PMAGIC_2022_09_04.SQFS - any size or contents

You will need to create a \ventoy_ventoy_grub.cfg text file (if you haven't already made one) and add the following lines of text to it using a text editor.

# Boot PMagic with LIVE SAVE option (Legacy and UEFI)

# Add this text to \ventoy\ventoy_grub.cfg on Partition 1 of your Ventoy drive
# To enable SAVE feature, create a file at \pmagic\pmodules\PMAGIC_2022_09_04.SQFS of any size (must match name inside ISO)
# case sensitive pathnames
if [ -f "(${vtoydev},1)/_ISO/LINUX/pmagic_2022_09_04.iso" ]; then
if [ "$grub_cpu" = "x86_64" ]; then
set ISO="/_ISO/LINUX/pmagic_2022_09_04.iso"
set isof="iso_filename=${ISO}"
# add keymap=uk for uk keyboard
set default_settings="max_loop=256 edd=on vga=normal mem=32G ${isof}"
set live_settings="boot=live eject=no"
set linux="/pmagic/bzImage"
set initrd_img="/pmagic/initrd.img /pmagic/fu.img /pmagic/m.img"
set message="Loading kernel and initramfs. Please wait..."
loopback loop (${vtoydev},1)/_ISO/LINUX/pmagic_2022_09_04.iso 
set root=(loop)
if ! [ -f "(${vtoydev},1)/pmagic/pmodules/PMAGIC_2022_09_04.SQFS" ]; then 
echo WARNING: (${vtoydev},1)/pmagic/pmodules/PMAGIC_2022_09_04.SQFS does not exist - no SAVE possible!
echo expected to find...
ls /pmagic/pmodules/PMAGIC*.SQFS
echo which should be on USB Partition 1
read
fi

menuentry "Live+SAVE with default settings (2GB+ RAM)"{
echo $message
search --set -f $linux
linux $linux $default_settings $live_settings
initrd $initrd_img
}
menuentry "Live+SAVE with default settings + language menu"{
echo $message
search --set -f $linux
linux $linux $default_settings $live_settings lang=yes
initrd $initrd_img
}

fi
fi

Now you can press F6 in the Ventoy menu system to get the PMagic user menu.


There is an example file with the above text in the Easy2Boot agFM v1.96 download (in \ventoy\Sample ventoy config files folder).

Note: I used a USB drive with an NTFS Partitition 1. I did not test using an exFAT formatted Ventoy drive. 

No comments:

Post a Comment