What kldload actually does, step by step.
No magic. No proprietary automation platform. Just a sequence of well-understood steps, executed in the right order. Here's the recipe for turning a blank disk into a running ZFS system. This is exactly what the kldload installer does. You could do it by hand. We just automated it.
Step 1: Partition the disk
Two partitions. First: a 512MB EFI System Partition (FAT32) for the bootloader. Second: everything else, formatted as a ZFS pool. That's it. No swap partition (ZFS can handle swap as a zvol if needed). No /boot partition (ZFSBootMenu reads kernels directly from ZFS).
Step 2: Create the ZFS pool and datasets
Create rpool with LZ4 compression, 4K sector alignment, and POSIX ACLs.
Then create the dataset hierarchy: rpool/ROOT/default (your root filesystem),
rpool/home, rpool/var, rpool/var/log.
Each dataset can have independent snapshot and quota policies.
Step 3: Install the base OS
For Debian: debootstrap lays down a minimal root filesystem.
For CentOS: dnf --installroot does the same.
Then install the kernel, ZFS packages, and essential tools.
Build the ZFS kernel module via DKMS so it matches your exact kernel version.
Step 4: Build the initramfs
The initramfs needs the ZFS module baked in so the kernel can mount the ZFS root filesystem
at boot. On Debian, zfs-initramfs handles this. On CentOS/RHEL, zfs-dracut.
The initramfs also gets the machine's hostid so ZFS can identify its pools.
Step 5: Install the bootloader
Copy the ZFSBootMenu EFI binary to the EFI System Partition. Register it with the firmware
via efibootmgr. Install a backup copy at the UEFI fallback path so it boots
even if the firmware forgets the boot entry. Write /etc/fstab for just the EFI partition —
ZFS datasets are mounted by zfs-mount.service, not fstab.
Step 6: Export and reboot
Cleanly export the ZFS pool so it can be imported fresh on first boot.
Write the zpool.cache so the pool imports quickly.
Enable ZFS systemd services. Power off. Remove the USB. Boot from disk.
You now have a ZFS-on-root Linux system with boot environments, automatic snapshots, transparent compression, and a filesystem that will never silently corrupt your data.
k_install_zfs_storage(), k_bootstrap_base(),
k_install_bootloader() — readable bash functions with comments.
Fork the repo. Read them. Modify them. That's the point.