Skip to content

ZFS as the boot disk on Ubuntu 24.04: snapshots, scrubs, and serious-business setup

Install Ubuntu 24.04 with a ZFS root, configure datasets, schedule scrubs, and use bootable snapshots as the rollback you wished apt had.

ZFS as the root filesystem on Ubuntu turns “rollback that bad kernel update” from a hope into a one-command operation. The installer offers ZFS-on-root as an option from 20.04 onward, and 24.04 ships it with cleaner integration — bootable dataset clones, automatic scrubs, and the integrity guarantees ZFS is famous for. The catch is that you give up some operational simplicity (a ZFS root has more moving parts than ext4) for the upside of snapshots, scrubs, and atomic system state. This article walks the install option, the dataset layout the Ubuntu installer creates, the snapshot management we apply, and the boot-environment workflow that makes rollbacks trivial.

How to verify

# Confirm ZFS root is in use
mount | grep 'on / type zfs'
zpool status
zpool list
zfs list

# Snapshot inventory
zfs list -t snapshot | head -20

# Boot environments (Ubuntu's zsys may be present pre-24.04, deprecated in 24.04+)
zfs list -t filesystem | grep ROOT

What’s happening

The Ubuntu ZFS-on-root install lays down two pools: bpool for /boot (kept simple because GRUB has limited ZFS feature support) and rpool for everything else. Under rpool, the installer creates a structured dataset layout — rpool/ROOT/ubuntu_<id> is the active root filesystem, with rpool/USERDATA/... holding home directories on a separate dataset (so home survives a root rollback). The kernel boots from the bpool/BOOT/ubuntu_<id> dataset, and GRUB knows how to find the matching root.

ZFS’s value here is twofold. First, snapshots are nearly free — taking a snapshot of the root dataset is metadata-only; storage costs accrue only as the live root diverges. Second, rollback is atomic — a zfs rollback reverts the dataset to the snapshot state instantly, and a zfs clone lets you boot a previous state without destroying the current one. The operational pattern: snapshot before apt upgrade, and if it goes badly, reboot into the pre-upgrade snapshot.

The hassle is around the boot-environment integration. Ubuntu 20.04/22.04 used zsys to automate the snapshot-on-upgrade and present boot environments in GRUB; Ubuntu 24.04 deprecated zsys, and the official path is manual or via third-party tools like zfsbootmenu or zrepl. For our deployments we use a small ansible role that snapshots rpool/ROOT/ubuntu_* before any system change, with a rotation policy.

Scrubs matter for the data-integrity guarantee. ZFS reads each block, recomputes the checksum, and compares against the stored checksum; mismatches are auto-corrected from the redundancy if there is any (mirror or raidz). Without a scheduled scrub, silent bit rot accumulates. Ubuntu installs zfs-zed and a systemd timer that runs zpool scrub weekly — verify it’s enabled.

The procedure

  1. During Ubuntu 24.04 installation, on the disk-setup screen, choose “Advanced features → Use ZFS”. The installer creates the bpool/rpool layout automatically. For a single-disk install this gives no redundancy; for two disks the installer offers a mirrored layout.

  2. After install, verify pool layout:

    zpool status
    zfs list

    You should see bpool and rpool with the dataset tree under each.

  3. Confirm the weekly scrub timer is enabled:

    systemctl status zfs-scrub-monthly@bpool.timer
    systemctl status zfs-scrub-monthly@rpool.timer
  4. Take a manual snapshot before a risky upgrade:

    sudo zfs snapshot -r rpool/ROOT/ubuntu_<id>@before-2026-06-02
    sudo zfs list -t snapshot | head -10
  5. Run the upgrade:

    sudo apt update && sudo apt upgrade -y
  6. If the upgrade went bad, rollback (this is destructive — everything after the snapshot disappears):

    sudo zfs rollback -r rpool/ROOT/ubuntu_<id>@before-2026-06-02
    sudo reboot
  7. For a less-destructive workflow, clone the snapshot to a new dataset and boot from it:

    sudo zfs clone rpool/ROOT/ubuntu_<id>@before-2026-06-02 rpool/ROOT/ubuntu_rollback
    sudo zfs promote rpool/ROOT/ubuntu_rollback
    sudo update-grub
    sudo reboot
  8. Schedule periodic snapshots via a small script in /etc/cron.daily/zfs-snapshot:

    #!/bin/bash
    set -eu
    DATE=$(date +%Y%m%d-%H%M)
    /usr/sbin/zfs snapshot -r rpool/ROOT/ubuntu_<id>@daily-${DATE}
    # Retain last 14 daily snapshots
    /usr/sbin/zfs list -t snapshot -o name -s creation | \
      grep "rpool/ROOT/ubuntu_<id>@daily-" | \
      head -n -14 | \
      xargs -r -n 1 /usr/sbin/zfs destroy
    sudo chmod +x /etc/cron.daily/zfs-snapshot

Common pitfalls

  • rpool/USERDATA/* datasets are separate from the root; rollback of root does not touch home directories. That’s usually what you want, but be aware if you’re tracking down “why is my dotfile change still there after rollback.”
  • ARC (ZFS’s adaptive replacement cache) defaults to half of system RAM, which can confuse memory accounting and surprise small-RAM servers. Tune with /etc/modprobe.d/zfs.conf setting zfs_arc_max.
  • GRUB on bpool only supports a subset of ZFS features; don’t enable advanced features (encryption, certain compression algorithms) on bpool or GRUB stops finding the kernel.
  • A failed snapshot rotation script that fills rpool is a real risk — monitor zfs list -o name,used,available in your usual monitoring.
  • ZFS on USB-connected disks is fragile under USB resets; for production use SATA/SAS/NVMe direct attach.

In the engagements we run, ZFS-on-root shows up on managed VMs and bare-metal hosts where a clean rollback path is part of the operating model — every apt upgrade is preceded by a snapshot, and every kernel patch has a documented “boot the previous snapshot” recovery procedure. We pair it with a snapshot-aware backup story and monitor scrub results and pool capacity in the same Prometheus instance that watches the rest of the platform — ZFS is one of the few filesystems where the operating model genuinely changes for the better when you embrace it.