Booting an ISO through Grub2
Using grub2 we can directly boot an (iso9660) ISO using its loopback option. It provides another nice rescue method – for example when using grml (the Debian based Linux Live-CD for sysadmins. We no longer need to extract kernel and initrd from the ISO to be able to boot it using the isofrom bootoption. So we need to do is put a plain grml ISO to our harddisk.
If we are using grub2 already consider adding an entry like the following to our grub config
(/boot/grub/grub.cfg):
menuentry "grml-rescue system from harddisk (ISO = grml-small_2008.11.iso)"
{
loopback loop (hd0,1)/grml/grml-small_2008.11.iso
linux (loop)/boot/grmlsmall/linux26 isofrom=/dev/sda1/grml/grml-small_2008.11.iso boot=live quiet vga=791 noeject noprompt
initrd (loop)/boot/grmlsmall/initrd.gz
}
This entry gives the option to boot grml from our harddisk even if we don’t have the possibility to boot via CD/USB/PXE/….
Tip: starting with grml 2009.05(-rc1) we can also use findiso=/path/to/grml.iso instead of isofrom=/dev/sdX/path/to/grml.iso. findiso is a dynamic version of isofrom as it looks for the specified ISO file on all disks where it usually looks for the .squashfs file (so you don’t have to know the device name compared to isofrom=…). The above method using findiso can also make much easier to set up and would look like this:
menuentry "grml-rescue system from harddisk (ISO = grml-small_2008.11.iso)" {
loopback loop (hd0,1)/grml/grml-small_2008.11.iso
linux (loop)/boot/grmlsmall/linux26 findiso=/grml/grml-small_2008.11.iso boot=live quiet vga=791 noeject noprompt
initrd (loop)/boot/grmlsmall/initrd.gz
}
