Wednesday 7 January 2015

E2B 1.62 Beta7 with Parted Magic LIVE SAVE support

The Parted Magic Parted_Magic_2014_09_21.iso (490MB) can be booted just by adding it to your E2B USB drive. Note: This Parted Magic release is not free but it is only $10.

See end of article for PMagic 2022-09-04.iso with Save feature

However the file must be contiguous or else it will copied using dd to the CONTIG.ISO each time you boot it (if it exists).

I have now modified isoboot.g4b so that it will boot directly from a non-contiguous Parted Magic iso file and it also will support LIVE boot so that you can save the settings on exit.

To run it using isoboot, select the ISO file in the E2B (v1.62+) menu and hold down the SHIFT key before pressing ENTER (or use a .mnu file).

Note: If you make an .imgPTN file from the PMagic iso using the MPI Tool Pack and MakePartImage, it can boot in MBR or UEFI mode and you can select LIVE or non-LIVE mode and choose from a range of supported languages. No modifications or menu editing is required but you will need to allow for at least 200MB of extra free space for storage of the session settings..

P.S. For non-E2B users (why not?!!!) - there is an article on RMPrepUSB.com here.



Method

1. Copy the Parted_Magic_isoboot_Persistent.mnu file from the \_ISO\docs\Sample mnu Files folder to the desired E2B menu folder (e.g. \_ISO\MAINMENU\MNU)

2. Copy the Parted_Magic_2014_09_21.iso to the same folder.

When you boot from the new menu item, you will be asked if you want to boot as a LIVE version.
If you answer 'Y' then the last saved Session settings will be used (e.g. Desktop settings, etc.).


When you Quit from Parted Magic, you can then 'Save the Session'.

Note that this relies on there being a xxx.SQFS file (of any size or content) in the \pmagic\pmodules folder on the E2B USB drive - that is how PMagic determines where to save the session file.

3. At the PMagic Desktop use the File Manager to find the mounted iso file and find the /pmagic/pmodules folder and make a note of the  SQFS filename - e.g. PMAGIC_2014_09_29.SQFS.

4. Now navigate to the E2B USB drive and create a new folder at /pmagic/pmodules on the E2B USB drive.

5. Now create a new empty SQFS file in the /pmagic/pmodules folder - e.g. PMAGIC_2014_09_29.SQFS -  (or just copy the whole .SQFS file if you have plenty of space to spare!)

You should now find that when you quit from pmagic, you can save the current Session settings. A new session file (e.g. \pmagic\pmodules\099-saved-session.sqfm) will then be written.

6. The next time you boot to PMagic, answer Y for a LIVE session and you should see the same Desktop as before, because it will load the previously saved session file.

If you save multiple sessions, the latest saved session will be loaded by PMagic as it boots.

isoboot.g4d has been written so that it will use the language that is used by E2B, so if you have set LANG=SPANISH in your \_ISO\MyE2B.cfg file, then Parted Magic will also be set to Spanish.

FYI, the isoboot.g4b code is:

:.pmagic

set try=/pmagic/bzImage
if exist %try% set kernel=%try%
set try=/pmagic/initrd.img
if exist %try% set initrd=%try%

echo
echo -e Live (persistent) mode (for 512MB-1G based systems).\nThe USB drive must remain attached to the system during this session.
echo -e You can then save settings on exit.
echo -e For Live Mode (persistence) - the file /pmagic/pmodules/PMAGIC_XXXX_XX_XX.SQFS\nmust exist on the E2B USB DRIVE.
echo -e You can copy the SQFS file from iso/pmagic/pmodules to the \nE2B drive's /pmagic/pmodules folder using Parted Magic File Manager.
echo -e The SQFS file can be of 0 bytes in size as long as the filename is identical to the one in the ISO.
set LIVE=
echo
set /p ask=Do you want LIVE boot (Y/[N]) : 
if /i "%ask%"=="Y" set LIVE=boot=live

set keymap=
if "%LANG%"=="GERMAN"       set keymap=keymap=de-latin1 de_DE
if "%LANG%"=="SPANISH"      set keymap=keymap=es es_ES
if "%LANG%"=="FRENCH"       set keymap=keymap=fr-latin1 fr_FR
if "%LANG%"=="ITALIAN"      set keymap=keymap=it it_IT
if "%LANG%"=="PORTU_BRAZIL" set keymap=keymap=br-abnt2 pt_BR
if "%LANG%"=="POLISH"       set keymap=keymap=pl pl_PL
if "%LANG%"=="SIMP_CHINESE" set keymap=keymap=us zh_CN
if "%LANG%"=="TRAD_CHINESE" set keymap=keymap=us zh_CN

echo -e kernel %kernel% iso_filename=%ISOSCAN% eject=no edd=on vga=normal vmalloc=512MiB %keymap% %LIVE% > (md)0x220+1
echo initrd %initrd% >> (md)0x220+1

set LIVE=
set keymap=
set ISOSCAN=

goto :ISOBOOT



Make your own menu

Of course, you can make your own .mnu file and change the parameters to suit you - you can use the Parted_Magic_Live_Persistent.mnu file as a template and edit it as you wish (for instance change the amount of memory used from 512MiB to 1Gib+ by removing the vmalloc parameter:

Parted_Magic_Live_Persistent.mnu

# Copy this file and iso to same folder (e.g. \_ISO\LINUX\MNU)
# if using Parted Magic and want LIVE Save Session (persistence) to work - make sure the \pmagic\pmodules folder on the E2B USB drive contains a xxxx.SQFS file.
# The file can be of 0 bytes in size as long as the filename is the same as is inside the ISO file you are using.
# Change first 4 lines to match ISO, language and live requirement

iftitle [if exist $HOME$/pmagic_2014_09_29.iso] Parted Magic (LIVE)\n Boot Parted Magic with Save Session option.
set ISO=$HOME$/pmagic_2014_09_29.iso
set LIVE=boot=live

# uncomment next line if LIVE is not required
# set LIVE=

map --read-only %ISO% (0xff) || map --mem %ISO% (0xff)
map --hook
root (0xff)
set keymap=
if "%LANG%"=="GERMAN"       set keymap=keymap=de-latin1 de_DE
if "%LANG%"=="SPANISH"      set keymap=keymap=es es_ES
if "%LANG%"=="FRENCH"       set keymap=keymap=fr-latin1 fr_FR
if "%LANG%"=="ITALIAN"      set keymap=keymap=it it_IT
if "%LANG%"=="PORTU_BRAZIL" set keymap=keymap=br-abnt2 pt_BR
if "%LANG%"=="POLISH"       set keymap=keymap=pl pl_PL
if "%LANG%"=="SIMP_CHINESE" set keymap=keymap=us zh_CN
if "%LANG%"=="TRAD_CHINESE" set keymap=keymap=us zh_CN


# For 1GiB+ 64-bit systems use:#kernel /pmagic/bzImage64 iso_filename=%ISO% eject=no edd=on vga=normal %keymap% %LIVE%#initrd /pmagic/initrd64.img


kernel /pmagic/bzImage iso_filename=%ISO% eject=no edd=on vga=normal vmalloc=512MiB %keymap% %LIVE%
initrd /pmagic/initrd.img
boot


Parted Magic 2016 for E2B

# Copy this file and iso to same folder (e.g. \_ISO\LINUX\MNU)
# if using Parted Magic and want LIVE Save Session (persistence) to work - make sure the \pmagic\pmodules folder on the E2B USB drive contains a pmagic_2016_07_12.SQFS file.
# The file can be of 0 bytes in size as long as the filename is the same as is inside the ISO file you are using.
# SAVE feature only works on USB drives (not under a VM)

iftitle [if exist $HOME$/pmagic_2016_07_12.iso] Parted Magic 2016 (LIVE)\n Boot Parted Magic with Save Session option.
set ISO=$HOME$/pmagic_2016_07_12.iso

#set keymap=keymap=us
#set keymap=keymap=uk
if "%LANG%"=="GERMAN"       set keymap=keymap=de-latin1 de_DE
if "%LANG%"=="SPANISH"      set keymap=keymap=es es_ES
if "%LANG%"=="FRENCH"       set keymap=keymap=fr-latin1 fr_FR
if "%LANG%"=="ITALIAN"      set keymap=keymap=it it_IT
if "%LANG%"=="PORTU_BRAZIL" set keymap=keymap=br-abnt2 pt_BR
if "%LANG%"=="POLISH"       set keymap=keymap=pl pl_PL
if "%LANG%"=="SIMP_CHINESE" set keymap=keymap=us zh_CN
if "%LANG%"=="TRAD_CHINESE" set keymap=keymap=us zh_CN

if not exist /pmagic/pmodules/PMAGIC_2016_07_12.SQFS pause --wait=5 WARNING: \pmagic\pmodules\PMAGIC_2016_07_12.SQFS does not exist - SAVE feature not enabled!

set default=edd=on vga=normal
set LIVE=boot=live eject=no
set linux_64=/pmagic/bzImage64
set linux_32=/pmagic/bzImage
set init_img=/pmagic/initrd.img /pmagic/fu.img /pmagic/m64.img
set init_32=/pmagic/initrd.img /pmagic/fu.img /pmagic/m32.img
map --read-only %ISO% (0xff) || map --mem %ISO% (0xff)
map --hook
root (0xff)

# For 1GiB+ 64-bit systems use:
checkrange 2,3 is64bit && pause --wait=3 Booting 64-bit version...
checkrange 2,3 is64bit && kernel %linux_64% %default% iso_filename=%ISO% %keymap% %LIVE%
checkrange 2,3 is64bit && initrd %init_img%
checkrange 2,3 is64bit && boot

#32-bit
pause --wait=3 Booting 32-bit version...
kernel %linux_32% %default% iso_filename=%ISO% %keymap% %LIVE%
initrd %init_32%
boot


Parted Magic 2022-09-04 (64-bit)

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

E2B v2.17a Beta contains a new .mnu file for this pmagic release:
"\_ISO\docs\Sample mnu files\Linux\Parted_Magic_2022_Live_Persistent.mnu"

There was also a bug in E2B's ISOBOOT function which is now fixed in v2.17aBeta and later so ISOBOOT should also work (does not require ISO to be contiguous).

agFM v1.96aBeta contains a "\e2b\Sample agFM menu files\LINUX\pmagic_2022_09_04.grubfm" file. This can be used to get the save feature to work when using the agFM menu. You will need to ensure the .grubfm filename matches the .iso filename exactly and you will need a \pmagic\pmodules\PMAGIC_2022_09_04.SQFS file on the E2B Ptn 1 as described above.

agFM secondary menu - select the 'User menu' entry to run the .grubfm menu file.

Files for pmagic+Save feature in agFM:
  • \pmagic\pmodules\PMAGIC_2022_09_04.SQFS
  • \_ISO\LINUX\pmagic_2022_09_04.iso
  • \_ISO\LINUX\pmagic_2022_09_04.grubfm
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.

The .grubfm menu show all options, use 2 or 2a for PMagic+Save.










2 comments:

  1. I have tested latest Parted Magic version (Parted_Magic_2022.09.04) with this guide, but I got this error "VFS: Cannot open root device "(null)" or unknown-block (0,0): error-6 / please append a correct root= boot option here are the available partitions / kernel panic - not syncing: VFS: Cannot open root device "(null)" or unknown-block (0,0)"

    Can you help me out?

    ReplyDelete
  2. This article is seven years old and pmagic has changed during that time. Which particular method are you using (at least 4 different methods are described in the article!). P.S. There is a bug in ISOBOOT method. Get latest E2B v2.17Beta for a fix. It also has a new pmagic LIVE 2022 .mnu file - see \_ISO\docs\Sample mnu Files\Linux folder in new Beta.

    ReplyDelete