All Projects → nicholasjackson → bakery

nicholasjackson / bakery

Licence: MIT License
Simple tool to backup and restore ChromeOS Crostini containers

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to bakery

beleyenv
A dev-focused, idempotent system bootstrap script for ChromeOS's officially supported Linux container. Designed for me, but flexible enough for you to use too!
Stars: ✭ 45 (+150%)
Mutual labels:  chromeos, crostini
chromeos.dev
chromeOS.dev is the digital home for all things Chrome OS. Learn how to adapt and optimize your existing apps to work on Chrome OS, the success other companies have had doing so, how to use Chrome OS as your developer machine, and keep up-to-date with the latest on Chrome OS.
Stars: ✭ 150 (+733.33%)
Mutual labels:  chromeos
check lxc
Monitoring plugin to check LXC (Linux Container)
Stars: ✭ 13 (-27.78%)
Mutual labels:  lxc
saltstack-lxc-vagrant
Vagrantfile for setting up a SaltStack test/dev environment.
Stars: ✭ 13 (-27.78%)
Mutual labels:  lxc
blogr-pve
Puppet provisioning of HA failover/cluster environment implemented in Proxmox Virtual Environment and Linux boxes.
Stars: ✭ 28 (+55.56%)
Mutual labels:  lxc
edi-raspbian
edi configuration for emulated raspbian and raspbian cross compilation.
Stars: ✭ 16 (-11.11%)
Mutual labels:  lxc
Proxmox
Proxmox Helper Scripts
Stars: ✭ 3,882 (+21466.67%)
Mutual labels:  lxc
crosware
Tools, things, stuff, miscellaneous, etc., for Chrome OS / Chromium OS
Stars: ✭ 36 (+100%)
Mutual labels:  chromeos
ProxmoxVE PHP API
ProxmoxVE PHP API
Stars: ✭ 78 (+333.33%)
Mutual labels:  lxc
emrah-buster-templates
The templates of the emrah-buster installer.
Stars: ✭ 57 (+216.67%)
Mutual labels:  lxc
icp-ce-on-linux-containers
Multi node IBM Cloud Private Community Edition 3.2.x w/ Kubernetes 1.13.5 in a Box. Terraform, Packer and BASH based Infrastructure as Code script sets up a multi node LXD cluster, installs ICP-CE and clis on a metal or VM Ubuntu 18.04 host.
Stars: ✭ 52 (+188.89%)
Mutual labels:  lxc
vps host server
VPS Hosting Server Daemon for provisioning, monitoring, and communications with the central system.
Stars: ✭ 12 (-33.33%)
Mutual labels:  lxc
softwarecontainer
Framework to manage and contain applications in an automotive setting
Stars: ✭ 19 (+5.56%)
Mutual labels:  lxc
chromium os-tinker board
Build your Chromium OS for Asus Tinker Board
Stars: ✭ 30 (+66.67%)
Mutual labels:  chromeos
chromeos-key-remapper
IME / tooling for remapping key combos to other key combos on Chrome OS
Stars: ✭ 29 (+61.11%)
Mutual labels:  chromeos
chromeos-filesystem-onedrive
This project provides a OneDrive FileSystem mount for ChromeOS
Stars: ✭ 33 (+83.33%)
Mutual labels:  chromeos
cv4pve-api-php
Proxmox VE Client API for PHP
Stars: ✭ 45 (+150%)
Mutual labels:  lxc
opensvc
The OpenSVC node agent
Stars: ✭ 27 (+50%)
Mutual labels:  lxc
ansible virtualization
Ansible Collection: Virtualization roles
Stars: ✭ 31 (+72.22%)
Mutual labels:  lxc
harbour-containers
A Linux containers manager for SailfishOS
Stars: ✭ 30 (+66.67%)
Mutual labels:  lxc

Bakery - Crostini backup and restore tool

Simple tool to backup and restore ChromeOS Crostini containers, influenced by the excelent readme on Reddit https://www.reddit.com/r/Crostini/wiki/howto/backup

CircleCI

WARNING

  • Backup and restore operations can take a long time depending on the size of the container
  • The volume used by your Linux installation can grow 3x as the backup and restore process will make a copy of your image, at present it is not possible to resize the volume after temporary files have been cleaned up
  • Interuption of the backup and restore process can leave your Linux install in an unstable state, it is recommended to perform this operation while connected to a power source and to set the power when idle to Keep display on

Demo Video

https://www.useloom.com/share/71cdc4055744465f8f467f65cd26db44

Installation

  • Open a Crosh terminal using ctrl+alt+t
  • Start a new session vsh termina
  • Copy the backup binary to /mnt/stateful/lxd_conf

The latest release can be found, in the Releases section, select the correct file for your archictecture.

Example Linux AMD64:

(termina) chronos@localhost ~ $ curl -L https://github.com/nicholasjackson/bakery/releases/download/v0.1.2/bakery_0.1.2_Linux_amd64.tar.gz -o /mnt/stateful/lxd_conf/bakery.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   639    0   639    0     0    193      0 --:--:--  0:00:03 --:--:--  2158
100  752k  100  752k    0     0   138k      0  0:00:05  0:00:05 --:--:--  660k

cd /mnt/stateful/lxd_conf
tar -zxf bakery.tar.gz 

Backup a Crostini container

A full list of options can be found by running bakery with the help flag

(termina) chronos@localhost /mnt/stateful/lxd_conf $ ./bakery backup --help
Bakery - Crostini Backup and Restore tool
version: v0.1.2

Usage of backup:
  -archive-container string
        Name of the container to write backup files (default "penguin")
  -archive-location string
        Location of archive files, this is generally the home folder of your current container (default "/home/chronos")
  -container string
        Name of the container to backup (default "penguin")
  -snapshot-prefix string
        Prefix of the snapshot to take, snapshots will have time appended to them (default "backup-snapshot")
  -termina-location string

To backup a Crostini container use the following command, replace container with your own container name and archive-location with the location to store the backup files. Generally this should be something like your home folder so you can copy the files using ChromeOS files:

(termina) chronos@localhost /mnt/stateful/lxd_conf $ ./bakery backup -container tester -archive-location /home/jacksonnic
Bakery - Crostini Backup and Restore tool
version: v0.1.2

Starting backup, WARNING: This operation can take a long time

Creating snapshot of container:tester name:backup-snapshot-52723394

Stopping container tester

Publish container: tester to backup
If the container publish is interupted, your container may be left in a bad state,
in this instance you can restore the snapshot using the command: lxc restore tester backup-snapshot-52723394
Container published with fingerprint: 3b46b83105b3f2da09e70531b41705187cf58cc1e015eb14d1b1a778ef4b962f

Exporting container to: /mnt/stateful/lxd_conf
Image exported successfully!           

Splitting backup into 3GB chunks

Starting container tester
Mounting backup path /mnt/stateful/lxd_conf into container penguin
Mount path already exists

Moving backup files to /home/jacksonnic in container penguin

Deleting temporary image backup

The backup files will be output into your archive-location folder in 3GB chunks. Once the backup has completed you can move these to external storage for safe storage.

Restore a Crostini container

A full list of options can be found by running bakery with the help flag

(termina) chronos@localhost /mnt/stateful/lxd_conf $ ./bakery restore -help
Bakery - Crostini Backup and Restore tool
version: v0.1.2

Usage of restore:
  -archive-container string
        Name of the container to read backup files from (default "penguin")
  -archive-location string
        Location of archive files, this is generally the home folder of your current container (default "/home/chronos")
  -container string
        Name of the container to restore (default "penguin")
  -termina-location string
        Location to store temporary backup files in termina (default "/mnt/stateful/lxd_conf")

To restore a container, first copy your backup archive to a running Crostini container. You can then use the following command replacing the value of the container flag with the name to which you want to restore your backup and the archive-location to the location of your backup files in a running container. Generally this is the home folder.

(termina) chronos@localhost /mnt/stateful/lxd_conf $ ./bakery restore --container restore -archive-location /home/jacksonnic
Bakery - Crostini Backup and Restore tool
version: v0.1.2

Starting restore, WARNING: This operation can take a long time

Mounting backup path /mnt/stateful/lxd_conf into container penguin
Mount path already exists

Moving backup files from /home/jacksonnic in container penguin

Merge backup files back into a single archive /mnt/stateful/lxd_conf/backup.tar.gz

importing backup /mnt/stateful/lxd_conf/backup.tar.gz to image backup
Image imported with fingerprint: 3b46b83105b3f2da09e70531b41705187cf58cc1e015eb14d1b1a778ef4b962f

Initializing container restore from image backup
Creating restore

Deleting backup image backup

If you are restoring the default penguin instance you can now remove the temporary container and rename your restored container.

lxc delete penguin --force
lxc rename restore penguin

Testing

To test backup use an empty temporary container, this can be created using the following steps:

(termina) chronos@localhost /mnt/stateful/lxd_conf $ lxc init 980e37d286ad tester
Creating tester
(termina) chronos@localhost /mnt/stateful/lxd_conf $ lxc start tester

You can delete the temporary container using the following command

lxc delete tester --force
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].