PXE ZFS
Status: proposed design, not an execution receipt. This guide sketches a physically separated PXE capture/restore station using FreeBSD VNET jails, Clonezilla, iPXE and ZFS. Hardware boot, DHCP isolation, source-disk write protection, capture and restore have not been verified by the Agent Vault pilot.
The commands are incomplete examples. Before execution, supply and review jail creation, interface addresses, image repository mounts (including Clonezilla /home/partimag), matching image names, snapshot-menu generation and the policy for further captures after making a dataset read-only. Do not treat this page as a verified unattended imaging runbook.

Monica (Valhala / ZFS): Storage hygiene and filesystem immutability custodian (strict ZFS datasets, quotas, and read-only snapshots).
Joey (HP OmniBook): Single-cable field client (connects to capture or restore, separate capture and restore intentions).
Phoebe (Jev): Pre-flight semantic policy verification โข Chandler (Debby): Systems operator console โข Ross (Oxigraph): Data provenance archivist.
Two-Door Physical Architecture (or Three Doors with Host Management)
Section titled โTwo-Door Physical Architecture (or Three Doors with Host Management)โFrom the perspective of the field laptop, this is a two-door architecture (two dedicated physical NICs):
- Capture Port (
bge1): strictly saves fresh disk images (read-only NVMe source). - Restore Port (
bge2): presents an interactive ZFS snapshot boot menu prior to touching the disk.
If we include the primary management port (bge0 at 192.168.1.x / monica.lan), which handles host administration with zero contact with PXE or DHCP broadcasts, the full topology represents a three-door architecture.
To limit the risk of disk overwrites and DHCP leakage, the proposed design physically separates Capture and Restore onto dedicated physical network interfaces:
MONICA / VALHALA (proposed topology; example pool: zroot) [Management Port bge0: 192.168.1.x / monica.lan] โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Dataset: zroot/backups/omnibook-joey โ โ Quota: 350G | compression: zstd โ โโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ [bge1: CAPTURE PORT] [bge2: RESTORE PORT] Jail: pxe-capture (192.168.101.0/24) Jail: pxe-restore (192.168.102.0/24) โข Dedicated physical pass-through โข Dedicated physical pass-through โข Purpose: UNATTENDED IMAGE CAPTURE โข Purpose: INTERACTIVE SNAPSHOT RESTORE โข Action: ocs-sr savedisk (source protection unverified) โข Action: iPXE snapshot menu -> restoredisk โข Triggers auto-shutdown when complete โข Requires explicit on-screen selection โฒ โฒ โ โ โโโโโโโโโ Direct Cat6 Cable from Joey's Laptop (Auto-MDIX) โโโโโโโโโโbge0: The production host management network (Monica:192.168.1.x/monica.lan). Never runs DHCP or PXE services.bge1(Port 1 - Capture): Intended for thesavediskworkflow. Source-disk write protection must be independently verified; the selected port alone does not enforce it.bge2(Port 2 - Restore): Dedicated strictly to deploying selected ZFS restore points. It presents an on-screen menu of available snapshots before touching the disk.
Phase 1: Storage & Dataset Preparation (Host)
Section titled โPhase 1: Storage & Dataset Preparation (Host)โExamples use zroot as the pool name, following the FreeBSD Handbook convention. Substitute your actual pool name and mountpoints when applying them.
On the FreeBSD host, create a dedicated backup dataset with safety quotas and streaming record sizes:
# Create dedicated backup dataset with 1MB recordsize and 350GB safety quotadoas zfs create -o mountpoint=/zroot/backups/omnibook-joey \ -o compression=zstd \ -o recordsize=1M \ -o atime=off \ -o quota=350G \ zroot/backups/omnibook-joeyPhase 2: Capture Jail (pxe-capture on bge1)
Section titled โPhase 2: Capture Jail (pxe-capture on bge1)โ1. Jail Network Attachment
Section titled โ1. Jail Network AttachmentโPass bge1 directly into the VNET jail:
# In jail configuration:vnet;vnet.interface = "bge1";When the jail starts, bge1 completely leaves the host network stack and belongs exclusively to the jail.
2. Dnsmasq Configuration (Jail)
Section titled โ2. Dnsmasq Configuration (Jail)โIn /usr/local/etc/dnsmasq.conf:
interface=bge1bind-interfacesexcept-interface=lo0
dhcp-range=192.168.101.50,192.168.101.100,255.255.255.0,1hdhcp-option=3,192.168.101.1
enable-tftptftp-root=/tftpboot
# UEFI Client Architecture Detectiondhcp-match=set:efi-x86_64,option:client-arch,7dhcp-match=set:efi-x86_64,option:client-arch,9dhcp-userclass=set:ipxe,iPXE
dhcp-boot=tag:ipxe,http://192.168.101.1/boot.ipxedhcp-boot=tag:efi-x86_64,snponly.efi3. Unattended Capture Script (/usr/local/www/boot.ipxe)
Section titled โ3. Unattended Capture Script (/usr/local/www/boot.ipxe)โ#!ipxe
set server_ip 192.168.101.1set base_url http://${server_ip}/clonezilla
echo ==========================================================echo Starting Unattended Factory Image Capture to Valhalaecho ==========================================================
kernel ${base_url}/vmlinuz boot=live config noswap nomodeset noprompt nosplash \ ocs_live_run="ocs-sr -q2 -j2 -z9p -i 4096 -sfs -senc -batch -p poweroff savedisk 1-factory-unopened nvme0n1" \ fetch=${base_url}/filesystem.squashfsinitrd ${base_url}/initrd.imgbootPhase 3: Interactive ZFS Restore Menu (pxe-restore on bge2)
Section titled โPhase 3: Interactive ZFS Restore Menu (pxe-restore on bge2)โThe design calls for a restore jail on bge2 that enumerates approved ZFS snapshots. The example below is a static menu; the snapshot query, repository mount and menu generator are not implemented here:
#!ipxe
set server_ip 192.168.102.1set base_url http://${server_ip}/clonezilla
menu Valhala ZFS Restore Points (Select Target Snapshot)item 1-factory-unopened [1] Factory Clean (Out of the Box)item 2-windows-activated [2] Windows 11 Activated + Driversitem cancel [3] Cancel and Rebootchoose target && goto ${target}
:1-factory-unopenedecho Restoring Factory Clean Image...kernel ${base_url}/vmlinuz boot=live config noswap nomodeset noprompt nosplash \ ocs_live_run="ocs-sr -g auto -e1 auto -e2 -r -j2 -k0 -batch -p poweroff restoredisk 1-factory-unopened nvme0n1" \ fetch=${base_url}/filesystem.squashfsinitrd ${base_url}/initrd.imgboot
:2-windows-activatedecho Restoring Windows 11 Activated Image...kernel ${base_url}/vmlinuz boot=live config noswap nomodeset noprompt nosplash \ ocs_live_run="ocs-sr -g auto -e1 auto -e2 -r -j2 -k0 -batch -p poweroff restoredisk 2-windows-activated nvme0n1" \ fetch=${base_url}/filesystem.squashfsinitrd ${base_url}/initrd.imgboot
:cancelrebootPhase 4: ZFS Snapshot Lifecycle & Immutability
Section titled โPhase 4: ZFS Snapshot Lifecycle & ImmutabilityโWhen an image capture completes on bge1:
# 1. Take an instant ZFS snapshotdoas zfs snapshot zroot/backups/omnibook-joey@1-factory-unopened
# 2. Mark the dataset read-only to prevent tampering or accidental writesdoas zfs set readonly=on zroot/backups/omnibook-joeyWith this example dataset mounted at the shown path, the snapshot can be accessed read-only via:
/zroot/backups/omnibook-joey/.zfs/snapshot/1-factory-unopened/Proposed Hardware Steps (Unverified)
Section titled โProposed Hardware Steps (Unverified)โ- Plug the Realtek RTL8153 USB-C Gigabit Ethernet adapter into the laptop.
- Connect a Cat6 patch cable from the adapter directly into:
bge1for Saving an Image (unattended, shuts down when finished).bge2for Restoring an Image (displays the ZFS snapshot menu).
- Power on the laptop, press F9, and select UEFI Network Boot (IPv4).