SystemRescueCD from ISO image

The new grub loader shipped with Ubuntu Lucid is able to boot systems directly from ISO images located in any hard disc partition.

Lets use this fact and have always the latest SystemRescueCD at hand, without having to burn a new CD, just by having its ISO on our Ubuntu partition.

There are some instructions on their web-site, but
  1. they don't work

  2. why not use grub's update mechanism to include the SystemRescueCD entry automatically, instead of having to add it by hand.


Therefore, grub offers to have some scripts in /etc/grub.d which are called during the update process and I'll give you here the steps for adding the ISO image as entry "magically".

Install instructions


  1. Download latest SystemRescueCD image from their web.

  2. Move it somewhere inside the /boot folder, for example I use a subfolder:
    sudo mkdir /boot/sysrcd
    sudo mv systemrescuecd*.iso /boot/sysrcd/

  3. Create a new file /etc/grub.d/50_sysrcd and put the following content:
    #!/bin/sh

    # Search for System Rescue CD iso file in /boot and add it as boot-entry.

    for iso in $(find /boot -name systemrescuecd*.iso)
    do
    isofile=`echo $iso`
    version=`echo $iso | cut -d "-" -f 3 | cut -d "." -f 1,2,3`
    echo "Found SystemRescueCD image: ${iso}" >&2
    cat << EOF
    menuentry "SystemRescueCd ${version}" {
    loopback loop ${isofile}
    linux (loop)/isolinux/rescuecd isoloop=${isofile}
    initrd (loop)/isolinux/initram.igz
    }
    EOF
    done

  4. Make it executable:

  5. sudo chmod a+x /etc/grub.d/50_sysrcd

  6. Now, we are ready to update the grub menu:
    sudo update-grub


That's it, now when you reboot your system, you should see the SystemRescueCD as latest entry and you can just boot it up.

You could also have several versions of the ISO images in /boot/sysrcd and this will give several grub entries.

Nice if you need to tweak your system partitions, need to recover something from your broken Windows partition, you just have the tools there, and it only occupies about 250 MB on your Linux partition.
And whenever you want to use a newer version, just download the new one, replace the old ISO, and update the grub menu again.

Troubleshooting


If you get these messages during update-grub
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst

and
Updating /boot/grub/menu.lst ... done

this means that you still using grub version 1, not the latest one.
In that case, you should first upgrade grub with
sudo aptitude install grub2