From 3a93793b5380bf8d13fa7547e3b1b51aaab905e8 Mon Sep 17 00:00:00 2001 From: Maurice Zhou Date: Tue, 14 Feb 2023 18:03:29 +0100 Subject: [PATCH] NixOS Root on ZFS: add escape hatch for zfs rollback Signed-off-by: Maurice Zhou --- .../NixOS/Root on ZFS/configuration-immutable.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/Getting Started/NixOS/Root on ZFS/configuration-immutable.nix b/docs/Getting Started/NixOS/Root on ZFS/configuration-immutable.nix index e696d0d..cb83828 100644 --- a/docs/Getting Started/NixOS/Root on ZFS/configuration-immutable.nix +++ b/docs/Getting Started/NixOS/Root on ZFS/configuration-immutable.nix @@ -244,9 +244,11 @@ in { boot.loader.grub.devices = (map (diskName: zfsRoot.devNodes + diskName) zfsRoot.bootDevices); boot.initrd.postDeviceCommands = '' - zpool import -Nf rpool - zfs rollback -r rpool/nixos/empty@start - zpool export -a + if ! grep -q zfs_no_rollback /proc/cmdline; then + zpool import -N rpool + zfs rollback -r rpool/nixos/empty@start + zpool export -a + fi ''; }