From 305c0d470976e182eeb677b337cd4e650850a8fc Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 19 Jan 2026 14:04:42 -0600 Subject: Fix journald on ZFS: wait for mounts, enable persistent storage --- custom/install-archzfs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'custom/install-archzfs') diff --git a/custom/install-archzfs b/custom/install-archzfs index 2c679a7..64e6dda 100755 --- a/custom/install-archzfs +++ b/custom/install-archzfs @@ -959,6 +959,23 @@ EOF arch-chroot /mnt pacman-key -r DDF7DB817396A49B2A2723F7403BD972F75D9D76 2>/dev/null || true arch-chroot /mnt pacman-key --lsign-key DDF7DB817396A49B2A2723F7403BD972F75D9D76 2>/dev/null || true + # Configure journald for ZFS + # Problem: journald starts before ZFS mounts /var/log, so journal files + # get created in tmpfs then hidden when ZFS mounts over it. + # Solution: Make journal-flush wait for zfs-mount, and enable persistent storage. + info "Configuring journald for ZFS..." + mkdir -p /mnt/etc/systemd/journald.conf.d + cat > /mnt/etc/systemd/journald.conf.d/persistent.conf << 'EOF' +[Journal] +Storage=persistent +EOF + + mkdir -p /mnt/etc/systemd/system/systemd-journal-flush.service.d + cat > /mnt/etc/systemd/system/systemd-journal-flush.service.d/zfs.conf << 'EOF' +[Unit] +After=zfs-mount.service +EOF + # Set root password info "Setting root password..." echo "root:$ROOT_PASSWORD" | arch-chroot /mnt chpasswd -- cgit v1.2.3