Table of Contents

DESCRIPTION

Commands to snapshot, backup and restore Crostini Linux containers on ChromeOS.

SNAPSHOT

Create

lxc snapshot sens <LABEL>
lxc snapshot sens backup-snapshot

Restore

Destroy and re-create the container.

lxc restore setns <LABEL>

BACKUP/RESTORE

Create a full backup image.

Backup

lxc publish setns --alias backup
lxc image list
lxc image export backup $LXD_CONF/backup

Restore

From Image

lxc delete setns

# lxc init <image name> <container name>
lxc init backup setns

From Export

lxc image import $LXD_CONF/backups/backup.tar.gz --alias backup

MOVING FILES INTO CONTAINER

Mount

lxc config device add unveil lxd-conf disk source=$LXD_CONF path=/mnt/lxd_conf

Push

Limited by the amount of diskspace in /tmp:

lxc file push $LXD_CONF/backup.tar.gz unveil/home/msantos/backup.tar.gz

(markdown)