{"id":17101704,"url":"https://github.com/nicholasjackson/bakery","last_synced_at":"2025-06-10T23:05:53.174Z","repository":{"id":57588213,"uuid":"166773891","full_name":"nicholasjackson/bakery","owner":"nicholasjackson","description":"Simple tool to backup and restore ChromeOS Crostini containers","archived":false,"fork":false,"pushed_at":"2019-01-28T07:29:14.000Z","size":1363,"stargazers_count":21,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T00:26:49.497Z","etag":null,"topics":["chromeos","crostini","golang","lxc"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nicholasjackson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-21T08:11:50.000Z","updated_at":"2025-01-23T14:25:27.000Z","dependencies_parsed_at":"2022-09-26T19:50:53.257Z","dependency_job_id":null,"html_url":"https://github.com/nicholasjackson/bakery","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholasjackson%2Fbakery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholasjackson%2Fbakery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholasjackson%2Fbakery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholasjackson%2Fbakery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicholasjackson","download_url":"https://codeload.github.com/nicholasjackson/bakery/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholasjackson%2Fbakery/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259166935,"owners_count":22815588,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chromeos","crostini","golang","lxc"],"created_at":"2024-10-14T15:26:28.902Z","updated_at":"2025-06-10T23:05:53.147Z","avatar_url":"https://github.com/nicholasjackson.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bakery - Crostini backup and restore tool\nSimple tool to backup and restore ChromeOS Crostini containers, influenced by the excelent readme on Reddit\n[https://www.reddit.com/r/Crostini/wiki/howto/backup](https://www.reddit.com/r/Crostini/wiki/howto/backup)\n\n[![CircleCI](https://circleci.com/gh/nicholasjackson/bakery.svg?style=svg)](https://circleci.com/gh/nicholasjackson/bakery)\n\n## WARNING \n* Backup and restore operations can take a long time depending on the size of the container\n* 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\n* 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`\n\n## Demo Video\n[https://www.useloom.com/share/71cdc4055744465f8f467f65cd26db44](https://www.useloom.com/share/71cdc4055744465f8f467f65cd26db44)\n\n## Installation\n* Open a Crosh terminal using ctrl+alt+t\n* Start a new session `vsh termina`\n* Copy the backup binary to /mnt/stateful/lxd_conf\n\nThe latest release can be found, in the `Releases` section, select the correct file for your archictecture.\n\nExample Linux AMD64:\n```bash\n(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\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100   639    0   639    0     0    193      0 --:--:--  0:00:03 --:--:--  2158\n100  752k  100  752k    0     0   138k      0  0:00:05  0:00:05 --:--:--  660k\n\ncd /mnt/stateful/lxd_conf\ntar -zxf bakery.tar.gz \n```\n\n## Backup a Crostini container\nA full list of options can be found by running bakery with the help flag\n\n```bash\n(termina) chronos@localhost /mnt/stateful/lxd_conf $ ./bakery backup --help\nBakery - Crostini Backup and Restore tool\nversion: v0.1.2\n\nUsage of backup:\n  -archive-container string\n        Name of the container to write backup files (default \"penguin\")\n  -archive-location string\n        Location of archive files, this is generally the home folder of your current container (default \"/home/chronos\")\n  -container string\n        Name of the container to backup (default \"penguin\")\n  -snapshot-prefix string\n        Prefix of the snapshot to take, snapshots will have time appended to them (default \"backup-snapshot\")\n  -termina-location string\n```\n\nTo 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:\n\n```bash\n(termina) chronos@localhost /mnt/stateful/lxd_conf $ ./bakery backup -container tester -archive-location /home/jacksonnic\nBakery - Crostini Backup and Restore tool\nversion: v0.1.2\n\nStarting backup, WARNING: This operation can take a long time\n\nCreating snapshot of container:tester name:backup-snapshot-52723394\n\nStopping container tester\n\nPublish container: tester to backup\nIf the container publish is interupted, your container may be left in a bad state,\nin this instance you can restore the snapshot using the command: lxc restore tester backup-snapshot-52723394\nContainer published with fingerprint: 3b46b83105b3f2da09e70531b41705187cf58cc1e015eb14d1b1a778ef4b962f\n\nExporting container to: /mnt/stateful/lxd_conf\nImage exported successfully!           \n\nSplitting backup into 3GB chunks\n\nStarting container tester\nMounting backup path /mnt/stateful/lxd_conf into container penguin\nMount path already exists\n\nMoving backup files to /home/jacksonnic in container penguin\n\nDeleting temporary image backup\n```\n\nThe 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.\n\n## Restore a Crostini container\nA full list of options can be found by running bakery with the help flag\n\n```bash\n(termina) chronos@localhost /mnt/stateful/lxd_conf $ ./bakery restore -help\nBakery - Crostini Backup and Restore tool\nversion: v0.1.2\n\nUsage of restore:\n  -archive-container string\n        Name of the container to read backup files from (default \"penguin\")\n  -archive-location string\n        Location of archive files, this is generally the home folder of your current container (default \"/home/chronos\")\n  -container string\n        Name of the container to restore (default \"penguin\")\n  -termina-location string\n        Location to store temporary backup files in termina (default \"/mnt/stateful/lxd_conf\")\n```\n\nTo 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. \n\n```bash\n(termina) chronos@localhost /mnt/stateful/lxd_conf $ ./bakery restore --container restore -archive-location /home/jacksonnic\nBakery - Crostini Backup and Restore tool\nversion: v0.1.2\n\nStarting restore, WARNING: This operation can take a long time\n\nMounting backup path /mnt/stateful/lxd_conf into container penguin\nMount path already exists\n\nMoving backup files from /home/jacksonnic in container penguin\n\nMerge backup files back into a single archive /mnt/stateful/lxd_conf/backup.tar.gz\n\nimporting backup /mnt/stateful/lxd_conf/backup.tar.gz to image backup\nImage imported with fingerprint: 3b46b83105b3f2da09e70531b41705187cf58cc1e015eb14d1b1a778ef4b962f\n\nInitializing container restore from image backup\nCreating restore\n\nDeleting backup image backup\n```\n\nIf you are restoring the default `penguin` instance you can now remove the temporary container and rename your restored container.\n\n```\nlxc delete penguin --force\nlxc rename restore penguin\n```\n\n## Testing\nTo test `backup` use an empty temporary container, this can be created using the following steps:\n\n```bash\n(termina) chronos@localhost /mnt/stateful/lxd_conf $ lxc init 980e37d286ad tester\nCreating tester\n(termina) chronos@localhost /mnt/stateful/lxd_conf $ lxc start tester\n```\n\nYou can delete the temporary container using the following command\n\n```bash\nlxc delete tester --force\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicholasjackson%2Fbakery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicholasjackson%2Fbakery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicholasjackson%2Fbakery/lists"}