Boot an ISO from Hard disk using GRUB 2

I was googling on how to boot an ISO in hard disk/USB disk, so that I can avoid the hectic CD/DVD burning process to test my favorite GNU/Linux distribution, but sadly I couldn’t find any straight forward method  to achieve this.

I am blessed to attend  ILUG-cochin (Indian Libre User Group) meeting on 4th Sunday of January 2011, where I met with lots of Geeks, who were happy to share their knowledge. Why can’t I be the part of ILUG earlier……. God only knows………

So… I am sharing the technique which I learned in ILUG meeting, with you guys, thanks to Hari, Sreenath for sharing this information with us.

Let us start………

Step 1 : Checking GRUB version

grub-install -v

GRUB 2 should display a version number of 1.96 or later. Legacy GRUB is version 0.97.

If you are using Legacy GRUB, update your GRUB by referring the following link

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

So… now you are upgraded to GRUB 2……. let us proceed…..

Step 2 : Get into GRUB command mode

1. Reboot your distribution

2. Hold down SHIFT to display the menu during boot ( ESC in GRUB legacy)

3. Press ‘c’ to get grub command line

Step 3 : Prepare ISO to boot

loopback loop (hd0,1)/iso/ubuntu10.4.iso

hd0,1 is the partition where the ISO file is located

/iso/ubuntu10.4.iso is the location of the filename

Change these two parameters that suites your environment

linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=ubuntu10.4.iso

This command loads the vmlinuz file from ISO,

In Ubuntu vmlinz is stored inside casper , This will change in different distributions, for example in Red Hat/CentOS server vmlinuz is located inside isolinux

Filename=ubuntu10.4.iso use the appropriate file name instead of ubuntu10.4.iso.

initrd (loop)/casper/initrd.lz

This command loads the initrd.lz from ISO, again the location of initrd.lz will change in various distribution, but both vmlinuz and initrd.lz will be in the same locaiton, for example in Red Hat/CentOS server initrd.lz is also located inside isolinux

boot

Boot the system….

Now the system will be booted with ISO you specified…..

About Anoop Nair

I am a Linux and Networking geek, Interest to learn more and fun to do new experiments, happy to share knowledge that I have learned and experienced in my life and carrier, also trying to learn more on Firewalls, Linux, Switching, Routing etc..............

Check Also

MySql replication

Disaster recovery of Mysql using DRBD and Heartbeat

Disaster recovery (DR) is the process, policies and procedures that are related to preparing for …

Comments

  1. I am very happy to see this post :) I gave a reply to @binbert’s without reading this post ;)
    Keep posting :)

  2. Hi,

    i’ve tried this to boot ubuntu and it loads the installer, but then it fails when it tries to find de CDROM.

    I’ve tryied with the ubuntu live iso and alternative iso and the problem happens on both.

    It seems that the loopback created in grub is lost when the installer is ran.

    Any ideia on how run the installer using this method?

    Thanks.