Wednesday, August 15, 2012

Howto Boot UBUNTU ISO From Hard Drive

Hope your Ubuntu ISO is in your home directory. Open a terminal and run:-


:~$ sudo mkdir -p /boot/ubuntu



Move your ubuntu.iso to newly created Ubuntu folder:-


:~$ sudo mv ubuntu.iso /boot/ubuntu/



Now you have to prepare grub menu to boot your ISO from hard drive:-


:~$ gksu gedit /etc/grub.d/40_custom



Paste this into the empty portion of the '40_custom' file:-


menuentry "UBUNTU ISO" {
set isofile="/path/yourisoname.iso"
loopback loop (disk,partition)$isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject
initrd (loop)/casper/initrd.lz
}



Before saving the above file, you have to give the correct path of your ISO file:-


:~$ sudo fdisk -l



See this output:- /dev/sda3 90318848 202430463 56055808 83 Linux
Here 'sda' is 1st had disk and '3' is partition number. Change the above file according to your own output like this and save:-


menuentry "UBUNTU ISO" {
set isofile="/boot/ubuntu/ubuntu.iso"
loopback loop (hd0,3)$isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject
initrd (loop)/casper/initrd.lz
}



Now update your grub and reboot the computer:-



:~$ sudo update-grub && sudo reboot





Enjoy ***************************************************************************


No comments: