This is an old revision of the document!
Table of Contents
Encrypted backups
The 3-2-1 rule
It is generally recommended to try to follow the 3-2-1 rule: at least 3 copies, on at least 2 devices, with at least one off-site copies.
For example: 1) your computer 2) a local backup on an external disk 3) a cloud to store another backup
It requires sometimes complex setups, but it is a good practice. However, what this rule does not say, but is very important (actually more important), is that your backups should ABSOLUTELY be encrypted. Otherwise any attempt to implement full disk encryption will be useless, since anyone could just grab the entirety of your data by just accessing your backups.
In this page we are reviewing several tools used to make backups.
- Some of them should be implemented before a dramatic configuration change to be sure that you can switch back to a working setup in case of a dramatic incident. Clonezilla is an open source project that allows to do this. It is cross platform except that M1 silicon Macs (basically any recent Mac laptops) cannot use it. Mac has a build in proprietary alternative called Time Machine. It is rather easy to use.
- Some of them should be implemented on your “regular” folders (i.e. not your programs) quite often. I will propose to use restic for this. It is open source and cross platform.
Clonezilla (to use before a dramatic change to your config)
you should ABSOLUTELY do it before any operation on your disks or partitions (such as the one presented here for instance) : there is a significant risk to destroy ALL your data.
Clonezilla is a free, open source software that allows to make a disk image and save it in a compressed encrypted file to be stored on an external drive. With this, you will be able to restore your whole disk in its current state where it works fine.
For this, you will need:
- An external hard drive to store the backup. I suggest using an external SSD with a capacity a bit bigger than your whole drive capacity. You do not need to encrypt this disk, as the backups themselves will be encrypted.
- An external USB stick to install CloneZilla. It should be at least 1GB and be used only for CloneZilla
STEP 1: prepare the CloneZilla USB stick
First, download the file as an iso.
optional but very good practice: verify your download
This step requires that you have installed GPG. If you did not, please find the instructions here.
Then, verify the download, using the following commands:
wget https://clonezilla.org//downloads/stable/data/CHECKSUMS.TXT wget https://clonezilla.org//downloads/stable/data/CHECKSUMS.TXT.gpg gpg --keyserver hkp://keys.openpgp.org --recv-key 667857D045599AFD gpg --verify CHECKSUMS.TXT.gpg CHECKSUMS.TXT
The output should show the line:
gpg: Good signature from "DRBL Project (Diskless Remote Boot in Linux) <drbl@clonezilla.org>" [unknown]
You then have verified that the file CHECKSUM.TXT has been encrypted by the owner of the private key of the clonezilla project. You can then compare the checksum of your file with the content of CHECKSUMS.TXT:
sha256sum clonezilla-live-3.2.1-9-amd64.iso
Replace the filename with the actual file you downloaded if it is another version. Check that the output of this command is part of the output of:
cat CHECKSUMS.TXT
If so, you are sure to have the right file. You can then proceed to flash you USB key. I recommend using Balena Etcher, which is Open Source, user friendly and cross platform.
STEP 2: do the actual backup
you can then follow the clonezilla guide to backup your whole image to an encrypted image stored in your unencrypted disk. Do not forget to tick the “encrypt your image” option, and secure it with a strong passphrase that you will remember.
Restic (to use regularly to make encrypted snapshots of your folders (ie: not your programs))
This second backup tool is to be used regularly to backup your Home directory (for example the /C/Users/YourUsername directory in windows, or the /home/yourusername on linux), as well as any file folder that is not your installed programs (like an extra disk used only to store files, videos, etc.), and can also be used to backups smaller folders.
It is called Restic. Contrary to CloneZilla, you do not need to turn off the computer to make the backup, which makes CloneZilla a bit cumbersome to use on a daily basis, and also impossible to use for recent MacOS laptops. It is also incremental: if you make several snapshots, only the difference since the last snapshot will actually be saved. This makes it extremely lightweight and fast (once a snapshot already exists).
Installation
you can follow the instructions here for installing it on your favourite OS.
Case of a Debian based Linux OS
Open a terminal and enter:
apt-get install restic
Case of MacOS
you can install it using brew. If brew is not installed on your computer, open a terminal and enter:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
when this is installed, you can simply enter:
brew install restic
Case of Windows
open a powershell terminal, then enter:
winget install --exact --id restic.restic --scope Machine
Initialisation of the backup folder
More detailed infos can be fond here.
Make a directory for the backup location. The open a terminal and enter:
restic init --repo /path/to/your/backup/directory
You will be asked a password. You should choose a strong password, either directly generated from the diceware method or randomly generated by a password manager that is locked by a password generated by the diceware method.
Do the actual backup
open a terminal and enter:
restic -r /path/to/your/backup/directory --verbose backup /path/to/the/folder/you/want/to/backup
you will be asked for your password and informed about the process. If it is the first snapshot of a big folder, it can take a bit of time.
If you need to restore a snapshot
More infos can be found here.
First, you can see the existing snapshots in your backup folder by entering:
restic -r /path/to/your/backup/folder snapshots
(base) usera@usera-computer1:~/Downloads$ restic -r testdir snapshots enter password for repository: wrong password or no key found. Try again enter password for repository: repository 7d765fa4 opened (repository version 2) successfully, password is correct ID Time Host Tags Paths —————————————————————————————— 9e4378a4 2026-06-19 10:15:59 usera-computer1 /home/usera/Downloads/testdir2 —————————————————————————————— 1 snapshots
If you need to restore a snapshot
Once this is done, you can do another backup of your /home, which contains all your regular files. For this you can use the software backintime. You can install it with:
sudo apt install backintime-qt
Before launching it, we need to decrypt the encrypted disk, and mount the logical volume we intend to use:
sudo cryptsetup luksOpen /dev/sdb2 cryptsetup sudo vgchange -ay sudo mount /dev/mapper/vgbackup-home /mnt
now everything written on /mnt on your computer will be written on your disk.
You can then launch backintime with:
sudo backintime-qt
you can then configure it to save things in /mnt:
And then click on “Take snapshot” and wait for it to finish:
you can then unmount and remove your backup disk:
sudo umount /mnt sudo vgchange -an vgbackup sudo cryptsetup luksClose cryptodisk




