Creating a local partition with iPXE
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?
Solution 1:
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.