This toolset is intended to use for managing remote Linux devices (RaspberryPi in mind, but any remote Linux system will work) from host Linux systems, by basically simplifying 6 tasks, where you need to:
sshfor performing remote tasks (either directly or over a link up server).
- ..use simple drag and drop style file transfers (by
- ..backup the target's entire root filesystem (by
- ..create fast and efficient differential full backups (by hardlinks or by BTRFS snapshots).
- ..create a separate bootable system disk from any of your backups.
- ..clone a target with a new identity.
This simplification is achieved by:
- Placing separate scripts for each task described above and providing a simple
- Keeping the scripts, configuration files and backups in a folder called
- Linux OS
git(for submodule fetching and
Follow these steps for every project:
# on your host (eg. your laptop) mkdir your-project cd your-project git clone --recursive https://github.com/aktos-io/dcs-tools
Assuming you are in
/path/to/your-project folder already,
Create your configuration file and mandatory folders/flags:
(Optional): Send your RSA public key to the target in order to prevent asking password on every connection:
Set connection type
either connect to your target by its direct IP address and port:
or meet with your target on a link up server (see link-with-server)
See doc/configuration.md for explanations.
Makes ssh connection either directly or via the link up server according to your connection type.
Mount target root
Mounts the root folder to
your-project/NODE_ROOT, which you can use for drag-n-drop style file transfers.
You can later unmount with
make umount-root without using
Sync target's root folder
Sync whole root partition of the target with
your-project/sync-root folder. You can use this command consecutively to keep your
sync-root folder up to date as much as possible. Only differentiating data will be transmitted (if any).
This command will only copy the current state of your target to your host machine. You will need to create your backups manually, with
make backup-sync-root command
Create a backup from the
sync-root folder into
./backups folder either by hardlinks method or by creating a btrfs subvolume, according to your
method-*flags can be set by
Following tools are for advanced usage, use them with extreme caution.
Produce bootable disk from a backup
Produces a bootable disk that is capable of booting your target hardware.
Restore files from a backup to physical disk
Restores all files from backup folder to the SD card. Useful when you want to update your physical backup disk with your latest sync folder.
Give New ID
Make appropriate changes to give new identity to an installation. Useful for creating a new controller/machine based on current installation.
Backups have following properties:
- portable (you can move your copies around. eg: take first backup locally, remove disk, mound on another computer,
- differential (only differences are transmitted)
- dead simple copies of original files (you can simply copy/paste when you need to restore or move your files around) (see BIG WARNING)
- versioned : Take any number of full backups as much as you like. You are responsible for deleting old backups.
- efficient storage usage (if you backup your 10 GB root for 5 times, you end up using 10.2 GB disk space if you have no modified files. But you will see the
snapshotsfolder has a size of 50 GB. (Magic? No: Hardlinks or BTRFS subvolumes)
Move your backups around carefully
If you are not using btrfs, "dead simple copies" feature has a problem by its design: As backups are just plain folders, this may lead breaking (unintentionally changing) the ownership of the files if you move/copy your files carelessly (eg. if you
mv your/snapshot to/another/location and then interrupt the command in the middle, you will probably end up with moved files having
root:root permissions.) That's why you SHOULD always use
rsync for such movements.
If you are using
--method btrfs, backups are made as readonly snapshots, so you will not have such problems.
Use correct filesystem
Make sure that you are performing
make sync-root command on a native Linux
filesystem. You will end up having a backup with wrong file ownership and/or