With grub2 you can directly boot an (iso9660) ISO using its loopback option. This is great because it provides another nice rescue scenario – for example when using grml (the Debian based Linux Live-CD for sysadmins). You no longer need to extract kernel and initrd from the ISO to be able to boot it using the isofrom bootoption. All you need to do is put a plain grml ISO to your harddisk.
Due to popular request (especially in #grub) PLEASE NOTE: grub itself can NOT boot CDROM images/ISOs. Neither version 1 nor version 2 of grub. Grml provides this feature via its isofrom bootoption. Grub2 strongly simplifies this setup with its loopback option but grub alone will NOT be enough. It’s the live system (as for example grml) that has to support this “boot from ISO” feature.
I’ve tested it with grml-small 2008.11 and grml-small 2009.05-rc1 using grub2 from Debian/unstable (1.96+20090317-1). In the following example the ISO file grml-small_2008.11.iso is available in directory grml on device /dev/sda1. You can boot it from the interactive grub shell using:
loopback loop (hd0,1)/grml/grml-small_2008.11.isolinux (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.gzboot
So if you are using grub2 already consider adding an entry like the following to your 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 you the option to boot grml from your harddisk even if you don’t have the possibility to boot via CD/USB/PXE/….
Tip: starting with grml 2009.05(-rc1) you 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 configuration using findiso is even 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}
This entry was posted by mika on Monday, May 25th, 2009 at 19:58 and is filed under Computer, Debian, English. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.
联系客服