Friday, November 25, 2011

Boot an ISO from Hard disk using GRUB 2


Get started with a step by step process...!!!!
NOTE: this will work on only linux
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
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…..

No comments:

Post a Comment