Boot ISO With Grub

= Boot ISO With Grub =

The ISO must be placed on an EXT4 formatted partition!.

Before you begin, create a backup of your grub.cfg

&gt; cp /boot/grub/grub.cfg{,.bak}

Locate the partition you want to use for the ISO.

&gt; [mj@gnu ~]$ df -h

&gt; Filesystem Size Used Avail Use% Mounted on

&gt; /dev/sdb2 15G 3.5G 12G 24% /

&gt; /dev/sdb3 21G 4.5G 16G 23% /home

&gt; /dev/sdb4 20G 5.3G 14G 29% /var/iso

&gt; /dev/sdb1 511M 37M 475M 8% /boot

It will return a list of partitions, and where they are mounted. In this case, I have a dedicated partition for ISO files.

My ISO file is named gnuradio.iso and resides in /var/iso

When you add your entry in grub, it is very important to add the path of the ISO relative to the partition. In this case, the ISO file is in the root of the partition. This is not relative to your system's root.

In /etc/grub.d/40_custom add:

&gt; menuentry &quot;GNU Radio Linux (ISO)&quot; {

&gt; set isofile=&quot;/gnuradio.iso&quot;

&gt; loopback loop (hd1,4)$isofile

&gt; linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile toram noprompt noeject

&gt; initrd (loop)/casper/initrd.lz

&gt; }

You most likely need to tweak the grub entry.

&gt; set isofile=&quot;/gnuradio.iso&quot;

This is the path relative to the partition, where your ISO file is stored. I named the ISO something simple, so it's easy to update, without the need to update grub.

&gt; loopback loop (hd1,4)$isofile

This line specifies which partition to use. In my setup, I have two hard disks. Where /dev/sdb is my main disk for my Linux OS.

To make it boot, I need to tell grub where to look. hd1 specifies it is my second disk /dev/sdb, and ,4 specifies it is partition 4. Which is /dev/sdb4.

&gt; linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile noprompt noeject

&gt; initrd (loop)/casper/initrd.lz

Theese two lines tells how to boot the ISO. You can figgure theese out by mounting the ISO file (not covered here) and checking the boot folders.

The last thing you need to do, is update grub, to apply the changes. On Arch you do this:

&gt; grub-mkconfig -o /boot/grub/grub.cfg

If you run a Debian flavored distribution, you're most likely looking for this:

&gt; update-grub

Now you should be able to reboot and see a new entry in grub.

Sources:

http://ubuntuforums.org/showthread.php?t=1549847&amp;page=3

https://help.ubuntu.com/community/Grub2/ISOBoot/Examples

https://wiki.archlinux.org/index.php/GRUB