Saturday, August 28, 2010

Booting iso images with GRUB 2

With thousdands of linux distributions around , booting iso images with out burning it to a cd or dvd  saves a lot of money and effort.   Let us try to boot system rescue cd. I have  ubuntu  lucid lynx installed on my laptop. Let us see how to boot   system rescue cd  from the iso image.   Get the latest system  rescue cd from here.
I keep all my iso images under /boot/iso folder . You can choose a different folder. (but note the exact path)

Add  the following lines to   /etc/grub.d/40_custom file
menuentry "SystemRescue CD ISO" {
loopback loop (hd0,1)/boot/iso/systemrescuecd-x86-1.5.8.iso
linux (loop)/isolinux/rescue64 setkmap=us isoloop=/systemrescuecd-x86-1.5.8.iso
initrd (loop)/isolinux/initram.igz

 You may have to tweak ( hd0,1 ) depending on  the location of your  iso image.   The line  
  loopback loop (hd0,1)/boot/iso/systemrescuecd-x86-1.5.8.iso

 above  mounts the iso image to  "loop".   The remaining lines specify kernel and initram image within the iso image.  

Now run "sudo update-grub" after saving /etc/grub.d/40_custom to include the new entries into the Grub 2 menu


David PCGuy said...

It would also be nice if grub2 (which I still have problems with on Netbooks and OS' that use the legacy grub) to not just be able to boot into a "rescue cd" but also into a cd image of your present OS. Using remasterme and mylivecd so that the ISO was always up to date (or preferably an update behind). Doing this and having a script that would automatically write the new ISOs and update grub would mean that having to reinstall for those with little knowledge would be a few simple taps of the cursor keys and one on the enter key. Perhaps there should be a warning before the reinstall goes ahead - what do you think and is it possible?

jiNtU jAcoB said...

is it possible to run some other linux operating systems other than rescue cd to try it as live cd?

pls read the post about configuring the features of grub 2 on the link