OpenSource For You

TIPS & TRICKS

-

Booting an ISO directly from the hard drive using GRUB 2

We often find ourselves in a situation in which we have an ISO image of Ubuntu on our hard disk and we need to test it by first running it. Try out this method for using the ISO image.

Create a GRUB menu entry by editing the /etc/ grub.d/40_custom file. Add the text given below just after the existing text in the file:

#gksu gedit /etc/grub.d/40_custom

Add the menu entry:

menuentry “Ubuntu 12.04.2 ISO”

{ set isofile=”/home/<username>/Downloads/ubuntu-12.04.2desktop-amd64.iso” #path of isofile

loopback loop (X,Y)$isofile linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/ filename=$isofile noprompt noeject

initrd (loop)/casper/initrd.lz

}

isofile variable is not required but simplifies the creation of multiple Ubuntu ISO menu entries.

The loopback line must reflect the actual location of the ISO file. In the example, the ISO file is stored in the user’s Downloads folder. X is the drive number, starting with 0; Y is the partition number, starting with 1. sda5 would be designated as (hd0,5) and sdb1 would be (hd1,1). Do not use (X,Y) in the menu entry but use something like (hd0,5). Thus, it all depends on your system’s configurat­ion.

Save the file and update the GRUB 2 menu:

Now reboot the system. The new menu entry will be added in the Grub boot option.

—Kiran P S, pskirann@gmail.com

 ??  ??
 ??  ??

Newspapers in English

Newspapers from India