Skip to content

Backup Restore

Calin Crisan edited this page Dec 1, 2022 · 4 revisions

Create Archived Folders

Archived (and compressed) folders can be created with the purpose of backing up data and restoring it later. The archived folder's contents should be relative to /data.

The following command creates an archived folder for /data/etc and places in /boot, assuming that (1) boot partition is mounted read-write and (2) the archived contents are small enough to fit into the remaining space of the boot partition:

tar -acf /boot/backup-etc.tar.gz -C /data etc

Restore Archived Folders

Archived folders placed on the boot partition and named backup-*.tar.gz will automatically be restored at next boot.

The S20restorebackups init script will extract and restore all archives with the above name to /data. After a successful restoration, the archive file is removed from boot partition.

Before the restoration, the boot partition is mounted read-write. It is remounted read-only afterwards.

Clone this wiki locally