iPXE discussion forum

Full Version: RAW Read and Write to DISK
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
does someone know a way to use ipxe to download a img file and save it to the local disk? or reading the disk and uploading it to a http server?
iPXE does "not" have any disk support.
The exception being the ability to log data to an specific partition type that can be used in case no other log facility is available, commit: https://git.ipxe.org/ipxe.git/commit/3ec...4454ba1513

Other then disk access, iPXE is also missing any kind of filesystem support, maybe you could chain to grub to do this, but I don't think grub has any kind of fs write support eighter?
it is not necessary to have filesystem support.
what i would like to do is
imgfetch http://server/image.img
imgverify image.img http://server/image.sig
imgwrite /dev/sda image.img
which would write the img file to disk (including the mbr/gpt in the img file)

this way one could build a rescue system without anything but ipxe.
What's driving your desire for iPXE-only? I would do this by booting into a minimal Linux initrd. Gentoo have a decent guide.

You would give iPXE something like:
Code:
#!ipxe
dhcp
kernel disk-write/kernel
imgfetch disk-write/initrd
imgfetch disk-write/sda.img /sda.img
boot

The image fetched to /sda.img will appear in that location once you've booted.

The /init in your initrd could then be something like:
Code:
#!/bin/busybox sh

dd if=/sda.img of=/dev/sda
echo Completed.
sleep 10
shutdown -r now
Reference URL's