Repository navigation
zark 2.3.1
zark 2.3.1 is a fix release for one situation: a backup drive that goes away during a backup (unplugged, or a USB link that drops). zark 2.3.0 could hang there, and so could an ssh login, apt and update-grub on a system with such a drive. It supports Ubuntu 24.04 LTS, 26.04 LTS and 26.10, and is published in the PPA for the three series.
What's fixed
- An ssh login,
aptorupdate-grubno longer hangs on a pool whose drive went away. The guards zark installs (the login reminder, the APT hook, the kernel prerm guard, the update-grub guard and its scan file) read the pools' states from the kernel first, start nozpoolorzfscommand while a pool is not ONLINE or DEGRADED, scan only the disks and partitions udev records as ZFS members, and wait a few seconds at most. A pool that is not healthy refuses kernel, GRUB, shim and ZFS installs and stopsupdate-grubuntil it is healthy or gone. The fault is in 2.3.0 too: runsudo zark setupafter upgrading (below). - A backup whose drive goes away no longer hangs.
zark backupwatches the drive while its pool is imported. When the drive goes away it says so and gives the two ways out: first, unplug it and reboot at once with the command zark prints (the system's healthy pools synced, thensystemctl reboot --force --force: a plain reboot can hang on a suspended pool); second, plug it back in and runsudo zpool clear <pool>, which can crash the OpenZFS 2.4 module. The run starts no further transfer, waits at its end for the drive to come back (Ctrl+C there leaves the pool imported) and is never marked complete. Cleanup,zark clean,zark umount,prepareandfullchecknever export, or unload the keys of, a read-write backup pool whose drive is gone. - An interrupted transfer to a drive that went away no longer spins at full CPU. After Ctrl+C, the side of the transfer on the suspended pool gets no signal and sleeps until the reboot or a resume; the other side is stopped as before.
- A forensic capture no longer kills a backup: command output that is not valid UTF-8 is read with replacement characters, and a capture never stops a run. A passphrase the locale cannot encode is named as such.
- Datasets are no longer called diverged after the drive went away: a listing that writes anything to stderr fails instead of returning a partial list.
- The read-back no longer says ONLINE over data errors: one measure of the pool's errors at step 3, before the export and at the read-back; new errors end the run NOT VERIFIED.
- A resumed transfer is estimated whole from the start, so
progress.json's total no longer grows mid-run and the space check counts it;zark prepare's size to transfer leaves excluded datasets out. zark monitorno longer says "connected" after an eject.
The full list is in CHANGELOG.md.
Upgrading from 2.3.0
sudo apt upgrade, then, once per system:
sudo zark setupThe package upgrade leaves the installed guards as they are, and 2.3.0's login reminder hangs an ssh login while a backup pool is suspended. Until setup runs, zark backup and zark monitor say zark's guards are out of date: run sudo zark setup. Nothing on a drive or in /etc/zark changes; 2.3.0 reads everything 2.3.1 writes. Details in docs/UPGRADING.md.
Known limitations
- On OpenZFS 2.4, a
zpool clearof a pool whose drive went away with writes in flight can crash the ZFS module (OpenZFS #18394): writes to the pool then hang, and the reboot itself may need a power-off. zark offers the forced reboot first and never runs the clear itself. - The forced reboot zark prints closes nothing and stops no service: save open work first, and do not run it while apt or dpkg is running (zark says when one is).
- A pool whose drive never returns stays imported and suspended until a reboot.
- A read-only pool,
purge's destroy andrecover's exports are not covered yet: see the CHANGELOG. - Where udev keeps device records, the guards see a backup drive as plugged in only when udev records its partition as a ZFS member; a pool on LUKS, md or a loop device does not count.
- The drive-loss path is validated on hardware on Ubuntu 26.10 with OpenZFS 2.4.4 only.
Install
sudo add-apt-repository ppa:juanmitaboada/zark
sudo apt update
sudo apt install zarkFor recovery from a live session, use zark_2.3.1.tar.gz below (tar xzf zark_2.3.1.tar.gz && cd zark && sudo ./zark recover). zark_2.3.1-1_amd64.deb is for machines without the PPA: it is built from the same source as the PPA's packages and versioned 2.3.1-1. The PPA's carry a series suffix and sort below it, so on a machine with the PPA, install with apt.