Linux deployment · Clonezilla · open source

Replant

Capture the installed system once. Replant it wherever it fits.

Replant turns a Clonezilla image of a Linux PC into a compact package that restores onto another PC, even one whose disk is smaller than the original's. One script on a USB stick, and the new machine boots the system you saved.

Get started View on GitHub

  • Restores onto smaller or larger disks
  • Plain Bash restorer, runs from an Ubuntu Live USB
  • Checks everything before it writes anything
  • MIT licensed

The problem

You set up one Linux PC exactly the way you want it, save it with Clonezilla, and plan to roll the same system out to more machines. Then the next machine turns out to have a 64 GB eMMC chip instead of the 256 GB SSD you started from.

A Clonezilla image is a copy of the disk’s partitions, and its filesystems are as big as the partitions they came from. Restoring onto a smaller disk simply doesn’t fit, even when the system only uses a fraction of the space.

Restoring the Clonezilla image

256 GB of partitions onto a 64 GB disk: it does not fit, even though only 17 GB of it is actually used.

Replanting it

Only the 17 GB of files are packed (about 4 GB compressed). The restorer sizes the partitions to the new disk and puts the files back.

Replant works at the level of files, not blocks. It unpacks your Clonezilla image, archives the filesystems themselves, and generates a restore script that rebuilds them at whatever size the target disk allows. The restored system keeps its original filesystem and partition IDs, so the boot loader and /etc/fstab work without any edits.

This isn’t theoretical: a system saved from a 256 GB NVMe drive has been restored with Replant onto a mini PC with a 62.5 GB eMMC disk, and it booted.

How it works

  1. PrepareInstall Replant on your own Linux machine. You only do this once.
  2. ProcessPoint it at a Clonezilla image. It checks the image and builds a restore package.
  3. ApplyBoot the target PC from an Ubuntu Live USB and run the package's restore.sh.

Built to be careful

Restoring a disk is destructive by nature, so Replant checks at every step and explains itself when it says no.

Read-only on your image

Your Clonezilla image is never modified. replant inspect tells you up front whether the image is supported, and why not if it isn't.

Verified at every stage

Checksums, Partclone's own checks and filesystem checks (e2fsck, fsck.fat) all run before the package is accepted.

Dry run first

The restorer shows what is on the target disk now and the layout it will create, and writes nothing until you ask it to.

Hard to aim at the wrong disk

It refuses disks that are mounted, in use, too small or holding the package, and makes you type the disk name to confirm.

No special restore media

The restorer is a standalone Bash script that runs from a stock Ubuntu Desktop Live USB. It doesn't need Python or Replant installed.

Minimal root access

Building a package needs sudo for a single, auditable step. Everything else runs as your own user.

What it supports today

Replant is young (alpha), and version 1 deliberately supports one common layout really well: the one a default Ubuntu installation creates.

Other layouts (legacy BIOS/MBR, LVM, encrypted disks, extra partitions, gzip-compressed images) are detected and refused with an explanation rather than half-handled. Secure Boot after a restore has not been specifically verified yet.

Get started

Restoring erases the target disk completely. Every partition and every file on it is replaced by the system from your image. That is the whole point, but back up anything you care about on the target PC first.

1. Prepare (once)

On an Ubuntu or Debian machine with sudo:

sudo apt-get install git zstd e2fsprogs dosfstools util-linux tar
# uv runs Replant with the right Python setup
curl -LsSf https://astral.sh/uv/install.sh | sh

git clone https://github.com/arturormk/replant.git
cd replant
# build current Partclone and fsarchiver into ./bin-tools
tools/build-tools.sh

You need free space for roughly the data actually used on the original disk, plus the package: about 17 GB + 4 GB for a typical Ubuntu desktop, not the full disk size.

2. Process the image

# Is the image supported?
uv run replant inspect /data/images/office-pc-img

# Rebuild and verify its filesystems (prints the run directory)
uv run replant extract --tools bin-tools /data/images/office-pc-img

# Build the restore package
uv run replant pack --tools bin-tools replant-work/<run> \
    --output replant-packages/office-pc

pack ends by telling you the smallest disk the package fits on. The package holds a full copy of the system, password hashes included, so treat it as sensitive.

3. Apply it to the target PC

Copy replant-packages/office-pc/ to a USB stick, boot the target PC from an Ubuntu Desktop Live USB (26.04 LTS or newer, UEFI mode, “Try Ubuntu”), connect to the network, and open a terminal in the package folder:

# Find the target disk: check sizes and models carefully
lsblk -o NAME,SIZE,MODEL,TYPE

# Install missing tools, check the package (writes nothing)
sudo bash restore.sh --check --install-deps

# The full plan for this disk (still writes nothing)
sudo bash restore.sh --disk /dev/nvme0n1 --dry-run

# The real thing: asks you to type the disk name, then restores
sudo bash restore.sh --disk /dev/nvme0n1

When it says Done, remove the USB sticks and reboot into the replanted system.

Learn more

Replant is MIT licensed. It drives external tools (Partclone, fsarchiver, e2fsprogs and others) that are separate programs under their own licences.