Skip to content

Add simple zfs example and make-disk-image test for it#1235

Open
MatthewCroughan wants to merge 2 commits intonix-community:masterfrom
MatthewCroughan:mc/simple-zfs-example-and-test
Open

Add simple zfs example and make-disk-image test for it#1235
MatthewCroughan wants to merge 2 commits intonix-community:masterfrom
MatthewCroughan:mc/simple-zfs-example-and-test

Conversation

@MatthewCroughan
Copy link
Copy Markdown
Contributor

This test and example is good to keep track of. The example is how I actually use disko on my own setups, and I think it's a good starter template to get the most out of ZFS in the real world, and worth sharing. Can refine if there is disagreement on some of the values.

The long standing dreaded "cp: Cannot allocate memory" issue seems to be limited to ZFS, and can only be reproduced at the moment on kernel 6.19, and not the default kernelPackages, which is set to LTS 6.12.

To reproduce that issue, add boot.kernelPackages = pkgs.linuxPackages_6_19; to tests/make-disk-image-zfs.nix like so:

diff --git a/tests/make-disk-image-zfs.nix b/tests/make-disk-image-zfs.nix
index 823023c..f4cf1a6 100644
--- a/tests/make-disk-image-zfs.nix
+++ b/tests/make-disk-image-zfs.nix
@@ -9,6 +9,7 @@
   (
     { config, ... }:
     {
+      boot.kernelPackages = pkgs.linuxPackages_6_19;
       networking.hostId = "00000000";
       disko.devices.disk.disk1.imageSize = "5G";
       environment.systemPackages = with pkgs; [

This is a real world example that contains some nice features like zstd compression and noatime, just to show what's possible. A user could just use this as-is and change only the disk path
This uses the simple zfs on root example to test that zfs disk images
can be made in CI
@MatthewCroughan MatthewCroughan force-pushed the mc/simple-zfs-example-and-test branch from 1ee9e02 to 06a3e1c Compare March 14, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant