Live cloning and updating of (classroom) computers
Find a file
2026-08-27 15:02:42 +02:00
friclone Create snapshots dir on init if it does not exist 2026-08-27 13:55:41 +02:00
friclone-pull Add support for fetching snapshot names during receive 2026-05-06 14:36:30 +02:00
LICENSE Initial commit 2026-03-30 12:08:33 +02:00
README.md oops, newline 2026-08-27 15:02:42 +02:00

friclone

Tools for live cloning and updating of (classroom) computers. Similar to Snapper, but with restore-on-boot and some tools to distribute the snapshots to multiple workstations.

Installation

Just copy the executable to /usr/local/bin. If you want restore-on-boot, also make sure it is included in the initial ramdisk.

# install friclone
cp friclone /usr/local/bin
# enable restore-on-boot
cp friclone /etc/initramfs-tools/scripts/local-premount/friclone-initrd
update-initramfs
# 

Usage

Common usage

Add (Enroll) volumes to be snapshotted

friclone enroll / 01-root
# if /home/user is on a separate subvolume
friclone enroll /home/user 02-userhome
# for some reason, ubuntu has these as separate subvolumes
friclone enroll /var/lib/portables 03-portables
friclone enroll /var/lib/machines 04-machines

Show a list of enrolled volumes

friclone unenroll /
friclone unenroll /home/user

Unenroll enrolled volumes

friclone unenroll / 01-root
friclone unenroll / 02-userhome
friclone unenroll /va/lib/portables 03-userhome

Create snapshot

friclone snapshot /

List snapshots

friclone list /

Switch to (restore) snapshot (for next boot)

friclone switchto / 2026-01-01T12:13:24+00:00

Freeze system

friclone name / 2026-01-01T12:13:24+00:00 stable

Prototype to server

On prototype:

friclone snapshot /

On server:

friclone-pull / username@prototype.example.com sudo

Server to classroom computers

friclone receive / file:///path/to/snapshots remember

After this works once, you can just use:

friclone receive /

When you want to switch to the newly received snapshot, use something like:

friclone name / 2026-01-01T12:13:24+00:00 latest
friclone switchto / latest

Development

The software in this repository is used at the Faculty of Computer and Information Science and is actively tested in our environment. We use Debian or Ubuntu.

Most of the heavy lifting (snapshot and restore) is done by a single POSIX shell script. This script must work in BusyBox inside the initial ram disk. The transfer of snapshots from a prototype computer to a server and from the server to clients is done by a separate posix shell script. The software should therefore work with most distributions.

Patches to make the software work with other distributions are welcome.

Dependencies

The script requires btrfs-tools and a posix shell. If snapshots are stored on a webserver, the wget command should be available. The wget in busybox is sufficient. Currently, the software only supports BTRFS.