Tutorial : Backup your Chrome OS Crostini Container to a remote server

Tutorial : Backup your Chrome OS Crostini Container to a remote server

I have been contacted by serveral readers and seen countless posts on reddit from users who have been forced to powerwash their devices after a unstable “Dev” update to their Chromebook. While I do not recommend that users who demand stability use the “Dev” channel, I do understand why they do as it offers a lot of features that allow a Chromebook to replace their primary machine. I am a firm believer in a saying that says “If it is not backed up, you must not care about it”. As Google does not yet offer a way to backup your device, allow me to show you a simple way to do this via rsync and a remote server.

Important Note

These instructions will show you how to backup the contents of your “home” directory within the Linux Container to a remote server. You should look at a tutorial to secure your server after setting it up if you choose to use a server that is exposed to the public internet. These steps will only backup the home directory in your container, not the entire container.

Getting and Setting Up a Server

If you already have a server or VPS, feel free to skip to the next section. You will need to get your hands on a Linux VPS or dedicated server to act as your backup location. The amount of storage is dependant on how much data you wish to store.

I strongly recommend using a “Storage VPS” from a company called HostHatch which will run about $5.00 per month for 250 GB of storage. Storage VPSs normally lack powerful processors and large amounts of RAM to focus on offering customers more storage. You wont need SSD storage so no need to spend a lot of money.

If you need to store a lot of data, you may want to look into a dedicated server. Companies like Dacentec can get you online with a dedicated server in about 48 hours for as little as $40 a month.

Whatever provider you use, you will need to setup a simple VPS running any flavor of Linux that you are comfortable with. You do not need a desktop environment, only basic SSH access and a IP Address or Hostname. You should perform all operating system upgrades before moving onto the next step.

Create a folder within your home directory called “crostini-backups”

kmyers@backup-server:~$ mkdir crostini-backups

Do not be tempted to use a shared web hosting plan for backups as many forbid this in their terms of service.

Setting up SSH Key Authentication

Access your Crostini terminal on your Chromebook and run the following command to generate a public and private SSH key. This will allow you to access your storage VPS without the need to enter a password.

keithiokepamyers@penguin:~$ ssh-keygen

Go ahead and accept all default prompts to create the keys, it will take a few seconds. Once complete, we will copy the keys to your storage VPS by running the following command. Please replace <Username> with the username you use to access your Storage VPS and <IP OR HOSTNAME> with the IP Address or Hostname of your Storage VPS. Your username may be “root” with most distributions

keithiokepamyers@penguin:~$ ssh-copy-id <Username>@<IP OR HOSTNAME>

You should be asked for the password for the remote storage VPS and a message saying that it was successful.

Performing the Backup

You will need to install “rsync” by running sudo apt-get install rsync .

Whenever you want to backup your Crostini home directory, simply run the following at the Crostini Terminal. Please replace <Username> with the username you use to access your Storage VPS and <IP OR HOSTNAME> with the IP Address or Hostname of your Storage VPS

rsync -arvz --progress ~/  <Username>@<IP OR HOSTNAME>:crostini-backups/

The first backup will take some time but every subsequent backup should be much faster as rsync will only backup the changes.

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Leave a Comment