Include any ISO in the FOG Bootmenu

From FOG Project
Revision as of 21:12, 1 February 2016 by Flowlive (talk | contribs)
Jump to: navigation, search

View the contents of the boot menu

When troubleshooting issues with iPXE booting regarding anything at all ( including booting ISOs over a network ), it helps to know exactly what the boot menu has inside it. Where x.x.x.x is the FOG server's IP address, put this into a browser's address bar:



Newer (January 2016)

These steps are intended for 1.2.0, but can be adapted to 1.3.0 very easily. These steps assume you have a fully functional FOG 1.2.0 server.

Note: When following the below steps, please remember that everything in Linux is case sensitive.

We will place the ISO into a directory called "/iso" in this example. You may place it somewhere else if you need, but you'll need to append some of the commands to do so.

If you don't have a /iso directory already, you can make it using:

mkdir /iso

Place your Parted magic ISO into the directory /iso

Now, you must mount your ISO to a directory called /images/pmagic To do this perminantly, edit the fstab file, and add these entries. Be sure to change your ISO name in these commands.

Edit /etc/fstab with:

vi /etc/fstab

Instructions on using Vi: Vi

Add this line to the bottom of the file:

/iso/YourIsoNameGoesHere.iso /images/pmagic/ iso9660 loop,ro,auto 0 0

You will need to create a /images/pmagic directory:

mkdir /images/pmagic

You can now tell the OS to mount by issuing:

mount -a

You'll need to create a pmagic web directory:

mkdir /var/www/html/fog/service/ipxe/pmagic

Copy the below list of files from the mounted ISO into this web directory: /var/www/html/fog/service/ipxe/pmagic/

If you've followed the above steps and all went well, you'll be able to find these files inside of /images/pmagic

  • bzimage
  • initrd.img
  • files.cgz
  • fu.img
  • m32.img

After copying the above files to the above specified directory, you'll need to set ownership and permissions so that they are accessible via HTTP (for Red Hat, Cent OS 7, Fedora 19+):

chown -R apache:apache /var/www/html/fog/service/ipxe/pmagic
chmod -R 744 /var/www/html/fog/service/ipxe/pmagic

If you've done the above steps correctly, you should be able to view these 5 files by opening a web browser and navigating to x.x.x.x/fog/service/ipxe/pmagic Where x.x.x.x is your FOG server's IP address.

Browse to /tftpboot/pxelinux.cfg/ and edit the 'default' file in there.

These are your iPXE menu additions:

(Note: do not change the ${fog-ip} part, this is an environment variable)

LABEL PartedMagic
set nfs_path /images/pmagic
kernel http://${fog-ip}/fog/service/ipxe/pmagic/bzImage
initrd http://${fog-ip}/fog/service/ipxe/pmagic/initrd.img
initrd http://${fog-ip}/fog/service/ipxe/pmagic/files.cgz
initrd http://${fog-ip}/fog/service/ipxe/pmagic/fu.img
initrd http://${fog-ip}/fog/service/ipxe/pmagic/m32.img
imgargs bzImage root=/dev/nfs boot=live netboot=nfs nfsroot=${fog-ip}:${nfs_path} ip=dhcp edd=on noapic load_ramdisk=1 prompt_ramdisk=0 rw vga=normal sleep=0 loglevel=0 keymap=us splash quiet - || read void
boot || read void
goto start

Alternate method

This has been tested running 1.3.0 on Debian 8.2:

Extract the files from the pmagic.iso to a local directory (this will be temporary)

Open a terminal as root, cd to /extractediso/boot/pxelinux/ and copy the files needed to boot pmagic to a new directory in /var/www/html/, if 64bit you will need bzimage64, initrd.img, fu.img and m64.img.;

mkdir /var/www/html/pmagic/

Run the following command to create files.cgz


This will create a /pm2pxe/ directory wherever you ran the command from with files.cgz in it. Now you can copy that file in /var/www/html/pmagic/

cp /extractediso/boot/pxelinux/pm2pxe/files.cgz /var/www/html/pmagic/

Now for the boot entry;

kernel http://${fog-ip}/pmagic/bzImage64
initrd http://${fog-ip}/pmagic/initrd.img
initrd http://${fog-ip}/pmagic/files.cgz
initrd http://${fog-ip}/pmagic/fu.img
initrd http://${fog-ip}/pmagic/m64.img
imgargs bzImage64 boot=live ip=dhcp edd=on noapic load_ramdisk=1 prompt_ramdisk=0 rw vga=normal sleep=0 loglevel=0 keymap=us splash quiet - || read void
boot || read void
  • Here's an interesting twist, if you have a version of Parted Magic that prompts you everytime to choose a time zone and you would like to get rid of this or if there's any configuration you make in the live environment that you'd like to see stick. You can boot from a usb stick (YUMI is a great tool if you want to add partedmagic.iso to an easy bootable usb) choose the timezone setting that works for you and when get to the logout prompt, choose 'Save session'. This will create a 099-saved-session.sqfm file in /pmagic/pmodules folder wherever PartedMagic is on your usb. Just copy this file in /extractediso/pmagic/pmodules/ and run the script again. It will create a new files.cgz containing your saved sessions and will load it automagically!

After you confirm this is working you can go ahead and delete the extracted iso folder.


Integrating PartedMagic in Fog 1.2.0


Note: Original steps intended for 1.2.0 and below. 1.3.0 would use the web interface to create a custom boot menu item and would not require file editing at the OS level. Original instructions below have been left intact.

In this example I will use the PartedM agic ISO, but Clonezilla, Linux distributions, Hirens Boot CD, and other bootable ISO's can be used.

Create a folder in /tftpboot/fog/ called partedmagic, copy the partedmagic.iso file into this folder and also copy and paste the MemDisk file found in /tftpboot/fog/

Browse to /tftpboot/pxelinux.cfg/ and edit the 'default' file in there and add:

LABEL PartedMagic
        kernel fog/partedmagic/memdisk 
        append iso initrd=fog/partedmagic/partedmagic.iso raw
        MENU PartedMagic
        TEXT HELP
        Gparted + Clonezilla + Firefox

You can also see this forum post for more instruction - [1]

Please remember that if you create a new folder in the /tftpboot directory you will also need to include MemDisk in the same folder! The link above also includes a TFTP folder you can use to try on your own. It includes DBAN and Dell diagnostics's .ISO's.

Note: In FOG 1.3.0+, the MemDisk kernel is included as a default unless specified otherwise.


This is a guide for adding Darik's Boot and Nuke (DBAN) to FOG 1.3.0. While following the below tutorial, please keep in mind that everything in Linux is case sensitive.


For this example, we will be using Fedora 21 Server; these commands should work for CentOS and RHEL as well. For Debian/Ubuntu based distributions you should only need to change the web directory paths to (maybe?) exclude the /html part.

Please note that the below wget URL will likely need updated to a current URL for the latest DBAN ISO.

Here is a step-by-step explanation of what the below commands do:

  • Make a directory in the root directory called "iso."
  • Make a directory in the web folder called "dban."
  • Get the latest copy of dban using wget (URL likely needs updated) and put it into the "iso" directory with the name "dban.iso."
  • Mount the dban.iso file to the "dban" web directory as read-only (must be read only for ISOs).

These commands are executed on your FOG server via CLI with sudo or root permissions:

mkdir /iso
mkdir /var/www/html/dban
wget -O /iso/dban.iso
mount -t iso9660 -o loop /iso/dban.iso /var/www/html/dban

If you've done the steps above correctly, you should be able to visit the directory in a web browser like so to see the files inside the ISO:



Now we must add a new entry to the FOG boot menu. For this, we will navigate in the FOG web UI to here:

FOG Configuration -> iPXE New Menu Entry

In this menu, you will add the below information.

Menu Item: DBAN

Description: Boot and nuke (This is what the menu displays)


kernel ${boot_url}/dban/dban.bzi nuke="dwipe --autonuke" silent vga=785

Menu Show with: All Hosts

It should look something like this when you're done:

DBAN 1.3.0.png

NOTE: You don't change the {boot_url} part, it's an environment variable.

NOTE: Some have reported that this works for them without the double quotes around this part: dwipe --autonuke but you may not have this problem.

Other Parameter Options


kernel ${boot_url}/dban/dban.bzi nuke="dwipe --autonuke" silent nousb vga=785


kernel ${boot_url}/dban/dban.bzi nuke="dwipe" silent vga=785


kernel ${boot_url}/dban/dban.bzi nuke="dwipe --autonuke --method dod522022m" silent vga=785


kernel ${boot_url}/dban/dban.bzi nuke="dwipe --autonuke --method dod3pass" silent vga=785


kernel ${boot_url}/dban/dban.bzi nuke="dwipe --autonuke --method dodshort" silent vga=785


kernel ${boot_url}/dban/dban.bzi nuke="dwipe --autonuke --method gutmann" silent vga=785


kernel ${boot_url}/dban/dban.bzi nuke="dwipe --autonuke --method ops2" silent vga=785


kernel ${boot_url}/dban/dban.bzi nuke="dwipe --autonuke --method prng --rounds 8 --verify all" silent vga=785


kernel ${boot_url}/dban/dban.bzi nuke="dwipe --autonuke --method prng --rounds 8" silent vga=785


kernel ${boot_url}/dban/dban.bzi nuke="dwipe --autonuke --method quick" silent vga=785


kernel ${boot_url}/dban/dban.bzi nuke="dwipe --autonuke --method zero" silent vga=785


Hirens 15.04

Note: Applies to FOG 1.3.0 (Fog Trunk)

First in your /etc/exports add this line:

/var/www/fog/iso/15.04_64 *(ro,sync,no_wdelay,insecure_locks,no_root_squash,insecure)

Then restart NFS. [NFS Service CLI Controls]

Next, extract the Ubuntu ISO to a directory named 15.04_64 in your /var/www/fog/iso directory.

In your Advanced menu use this:

item --gap – ---------------- iPXE boot menu ----------------
item ubuntu15.04_64 Boot Ubuntu 15.04
item return return to previous menu
set path /fog/iso/15.04_64
set nfs_path /var/www/fog/ISO/15.04_64
kernel http://${fog-ip}${path}/casper/vmlinuz.efi || read void
initrd http://${fog-ip}${path}/casper/initrd.lz || read void
imgargs vmlinuz.efi root=/dev/nfs boot=casper netboot=nfs nfsroot=${fog-ip}:${nfs_path} ip=dhcp splash quiet – || read void
boot || read void
goto start

You don’t have to set the variables. I just did it that way in case I ever have to change where the ISO directory lives.