I have copied an ISO file into a partition (i.e. dd if=isofile of=/dev/sdb1). How can I boot into that partition via GRUB?
When I try just with chainloader (hd1,0)+1, it says unknown executable format.
See my answer on your boot-from-ISO-files question. Using that as a starting point, I ran some tests with an old hard-drive. I've previously configured Grub2 to boot a multi-ISO flash drive, so what I did was:
This works because Grub2 can read ISO9660 filesystems, because this particular ISO is loading an OS that can cope with an ISO on a partition, and because practically everything the kernel loads is in the initrd.
If you're using Grub4DOS or Grub 1, you may be able to pull a similar trick with the chainloader. Presuming that this works to boot the Win7 ISO directly (source):
You may have luck with this modification (assuming you "burned" the ISO to the second primary partition, (hd0,1); otherwise substitute the proper partition):
You may also get away with this:
However, the ISO isn't really configured to boot from a drive, so you may run into other problems.
Here's how I was able to do it using Grub4DOS (last official build):
Grub4DOS can boot iso images, so it should be able to do it for partitions.
But this doesn't work, the whole disk is getting mapped.
To chainload Grub4DOS from Grub2:
Add this to
Conclusion: It's pretty cool actually.
This should work with any hybrid iso. Works great with ubuntu live images and other linux isos as they manage to find their files in the iso9660 partition. Anything real-mode (DOS) should be fine too. Windows isos won't be able to cope.
Gujin can do it also btw.