128 - Boot the Parted Magic ISO file (Live) using grub4dos from a USB drive
Add a Comment about this article
You can boot Parted Magic directly from an ISO using grub4dos and in LIVE mode (this enables you to save Settings on exit).
Introduction
pmagic_2014_09_29.iso is the latest version (at the time of writing) and is only $10 from the PartedMagic site.
The ISO is capable of 32-bit and 64-bit UEFI and MBR booting.
LIVE booting allows Parted Magic to load a previous sessions settings on boot. The user can also save the session settings on exit.
A good way to boot from the ISO from a USB drive, is to make a FAT32 USB drive that can boot to grub4dos and then extract the whole ISO to the root of the USB drive.
You can then UEFI-boot directly to the UEFI files or via MBR-booting to grub4dos (if you install grub4dos first) and then boot from a grub4dos menu entry (see menu below).
Another alternative is to add the ISO to your Easy2Boot USB drive, but it will not support UEFI-booting.
The most flexible alternative is to convert the ISO to a .imgPTN file and then add this to your E2B USB drive. This will allow you to UEFI-boot (both from 32-bit and 64-bit systems) and MBR boot - both with LIVE session support. Tip: Allow at least 200MB for saving the Live session data - so use the MakePartImage Desktop shortcut and choose FAT32 and a larger image size than is needed just for the ISO files.
However, in this tutorial, I will show you how to boot from the ISO with LIVE session and language support (MBR-booting only) from a FAT32 or NTFS USB drive containing the grub4dos bootloader.
Requirements
A USB drive (any size, Removable type or Fixed type, NTFS or FAT32)
The Parted Magic ISO file
RMPrepUSB and a Windows system
7Zip or some other utility to view the files inside the ISO file.
Method
1. If you don't already have a bootable, grub4dos USB drive, prepare one using RMPrepUSB and install grub4dos using the Install grub4dos button. I suggest doing this twice, use MBR=Y for the first time and PBR=N for the second time.
Ensure you have a late 0.4.5c 2014 version of grub4dos (\grldr) on the USB drive. You can obtain a recent version from here.
2. Copy the iso file to a suitable folder on your USB drive - e.g. \ISO
3. Create a folder in the root called \pmagic and then a subfolder at \pmagic\pmodules
4. Open up the ISO using 7Zip or any other tool and locate the SQFS file in the \pmagic\pmodules folder and note the exact filename and CASE (if the case is not correct, you may not be able to Save the session on exit).
5. Create a new empty file on your USB drive at \pmagic\pmodules with the exact same name as the .SQFS file that was in your ISO file - e.g. \pmagic\pmodules\PMAGIC_2014_09_29.SQFS
Note: If you have extracted the files from the ISO, do NOT change the .SQFS file that is already present!
6. Make a new entry in your \menu.lst file (if you don't have one, just press F4 in RMPrepUSB to make one using Notepad), and add the following text to the file:
iftitle [if exist /ISO/pmagic_2014_09_29.iso] Parted Magic (LIVE)\n Boot Parted Magic with Save Session option.
set ISO=/ISO/pmagic_2014_09_29.iso
set LIVE=boot=live
set LANG=FRENCH
# 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
Note: if you are booting from the extracted files and not the ISO file (a FAT32 USB drive will allow you to UEFI-boot as well!), use this menu instead:
iftitle [if exist /pmagic/bzImage] Parted Magic (LIVE)\n Boot Parted Magic with Save Session option.
set LIVE=boot=live
set LANG=FRENCH
# uncomment next line if LIVE is not required
# set 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
# For 1GiB+ 64-bit systems use:
#kernel /pmagic/bzImage64 eject=no edd=on vga=normal %keymap% %LIVE%
#initrd /pmagic/initrd64.img
kernel /pmagic/bzImage eject=no edd=on vga=normal vmalloc=512MiB %keymap% %LIVE%
initrd /pmagic/initrd.img
boot
7. Change the menu as required. You can find more languages and parameters by studying the \boot\syslinux\syslinux.cfg file inside the ISO file.
If you want English, then use set LANG= instead of set LANG=FRENCH
PMagic 2016 ISO
This menu is for use with Easy2Boot which will have the LANG variable preset
# 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. CASE-SENSITIVE - must be capital letters!
# 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.
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 LANG=
#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
How it works
1. The kernel command will accept parameters - iso_filename specifies what filename and folder the ISO file is in, so that linux can find the ISO file and mount it as a CD\DVD volume. It can then access the files inside the ISO for the second stage booting (loading the SQFS file), etc.
2. We can also specify the amount of RAM (system memory) to use using vmalloc - if vmalloc is not specified and we use the 64-bit kernel, then it will use over 1GiB of RAM.
3. The language can be specified using the keymap variable (e.g. keymap=fr-latin1 fr_FR)
4. Once Parted Magic is booting, if the boot=live parameter has been specified, it will look for a folder on any drive that has the \pmagic\pmodules\xxx.sqfm saved session file. Luckily, it seems to search all drives and so it should find the folder we created on the USB drive.
5. When you get to the Parted Magic Desktop, you can Save the Session when you Quit (Restart or Shutdown). A new .sqfm file will be saved into the \pmagic\pmodules folder of the USB drive. The SQFS file must also be present but can be 0 length (case sensitive - must be exact name or else it will refuse to save the session).
On boot, PMagic will look and load the \pmagic\pmodules\*.sqfm file (the .sqfs file does not need to be present for this, but the .sqfs file must be present when saving a session).
I have not found a way to set the timezone using the kernel parameters, but once you save the Session settings, you will not be prompted again.
# LOCALE: available languages can be listed with the 'locale -a' command
# HARDWARECLOCK: set to "UTC" or "localtime", any other value will result
# in the hardware clock being left untouched (useful for virtualization)
# TIMEZONE: timezones are found in /usr/share/zoneinfo
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/consoletrans
# USECOLOR: use ANSI color sequences in startup messages