Booting directly from an ISO image present in the Hard Disk

Booting directly from an ISO image present in the Hard Disk

Grub2 has the capability to boot directly from the ISO file present in your hard drive’s storage. This method may also be useful for distro hoppers, who want to save time in creating bootable media and who wish to avoid inserting a USB device into their systems every time, to try live distributions. Just place your downloaded ISO in any known location inside one of your partitions.

Open the ISO in any archive manager, go inside the Casper folder and view its contents.

The file with vmlinuz.efi or a similar name is your kernel file and initrd.gz (or something similar) is your initial ramdisk whose name you require in the next step.

Open the file in a text editor :

vi /etc/grub.d/40_custom

Then add the following menu entry at the end :

menuentry “New os” {
lookback loop (hd0,2)/home/user/mynewos.iso
linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/
filename=/home/user/mynewos.iso noeject
initrd (loop)/casper/initrd.gz
}

Here, in (hd0,2), ‘0’ represents the internal hard disk (sda) and ‘2’ represents the partition number (sda 2). Now save this file and run the following command:-

$ sudo update-grub

Reboot and select the new OS entry in the boot menu. If all the files’ names and configurations are correct, you will boot into the OS image that was present on your hard disk.

Post Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like