0

Is it possible to create a local partition from an ISO or a similar filetype either within iPXE itself, or with the help of another network boot program?

I know PXE is usually used for "diskless booting", but I want to boot certain images (ISOs in this case) that may very well exceed the amount of RAM that the client PCs possess (I also don't know whether iPXE implements something like swap memory). Therefore I'm not really comfortable using memdisk or wimboot and would rather "install" the ISO to the local disk and then boot it using sanboot or chainloading GRUB4DOS.

Now I did find many explanations as on how to boot from a local disk, but none that explain how to get a remote image onto my local disk, can anybody help here?

NiKiZe
  • 1,189
  • 7
  • 17
RikuXan
  • 207
  • 1
  • 3
  • 11
  • Why would you want to boot an ISO from a hard drive?? Why not just *install* whatever you're trying to boot? Why involve iPXE at all? – Chris S Mar 07 '14 at 15:55
  • Base line is: I want to be able to do it remotely. I want to keep my images (Win7 installer, live virus scan or backup) managed centrally and I want to be able to boot them on a machine that's connected to the network without any local help. – RikuXan Mar 07 '14 at 16:00
  • I don't follow, how does that have anything to do with iPXE or iPXE booting and ISO from a local disk?? – Chris S Mar 07 '14 at 16:09
  • The ISO is supplied over network via iPXE. The question I'm asking is not how to boot from a local partition, but rather how to create a local partition from a downloaded ISO (or wim or whatever). Also, I don't necessarily want to boot an ISO, I just happen to have the image as an ISO, for all I care it can be unpacked or converted, I just want it on the disk. – RikuXan Mar 07 '14 at 16:14
  • 1
    If you're pulling everything over the network anyway, why not just boot a bare OS, then run whatever utilities or installers from the network? Or if you're really bent on running a prepackaged solution, use network block storage, like iSCSI or ATAoE... – Chris S Mar 07 '14 at 16:33
  • I could theoretically boot a bare OS with autorun scripts that download my ISO, create a new partition, unpack the ISO to the partition, change the boot device to this new partition and let it reboot. However, I think that is quite a hassle for such a "simple" task, when I see that there is a bootloader implementation that loads an ISO completely into RAM, hooks file system access and acts as if the system was installed locally, I find it hard to believe there is nothing that would just install it locally on the disk. – RikuXan Mar 07 '14 at 16:49
  • It seems that you can just burn the `ipxe-efi.usb` can be copied onto a partition like `dd if=./ipxe-efi.usb of=/dev/sda1` and then it's a fat32 partition and you can boot off it. – CMCDragonkai Nov 12 '19 at 22:33

1 Answers1

2

If you look at how your block devices work, your disk (e.g. /dev/sda) or a partition (e.g. /dev/sda1) or a cdrom (e.g. /dev/sr0), or even an image file (e.g. mycdrom.iso) all look pretty much the same.

You can use cat or dd to copy images around and use them however you see fit.

It sounds like all you want to do is: cat /dev/sr0 > /var/cdrom_image_path/whatever.iso

Then you can export whatever.iso as an iSCSI target with targetcli if you want it to appear as iSCSI, or use whatever PXE stack you think is best.

As just one example of copying images, maybe take a look at how the OpenStack bare metal project works. They PXE boot an iSCSI target server, share /dev/sda as a target, and then connect to it from the main server to write the disk image. It is quite slick.

Mark
  • 21
  • 2