Skip to content

Backing up and cloning your OpenAPS Edison

swainoe edited this page Jul 12, 2016 · 1 revision

Introduction:

It's always best to have a backup. As much fun as it is coding an OpenAPS, when one breaks, it's best to get it functioning ASAP. Sometimes nothing will do but to start from scratch. Following are instructions to back up your Edison OpenAPS so that you can restore a broken image or make an awesome APS clone army. It takes about 20 min to create a backup image and about 20 min to flash it onto the Edison, so using these methods, you can have a shiny new APS in less than an hour with very little programming.

First, make sure you Edison is running perfectly. It's also a good idea to comment out your cron jobs.

Step 1: Create a Backup Image

#create folder for USB drive
sudo bash
mkdir -p /media/usbdrive

#plug in a USB drive to the USB OTG port then mount USB drive
mount /dev/sda1 /media/usbdrive

#create the compressed image (replace "IMAGE_NAME" with whatever you want to call your backup image)
dd bs=4M if=/dev/mmcblk0 | gzip > /media/usbdrive/IMAGE_NAME.gz

Step 2: Flash image onto Edison

#flash with ubilinux/yocto first for clean install

#create folder for USB drive
su -
mkdir -p /media/usbdrive

#plug in a USB drive to the USB OTG port

#mount USB drive
mount /dev/sda1 /media/usbdrive

#image Edison
gzip -dc /media/usbdrive/IMAGE_NAME.gz  | dd bs=4M of=/dev/mmcblk0

#unplug to shut down Edison; all commands will return "segmentation fault" error (don't let that scare you)

#boot up (do not remove USB drive) then reboot again – do not remove USB drive until after 2nd boot
sudo shutdown –r now

That's it! All you have to do now is change the hostname (if you're adding to your Edison APS army), manually test loop to make sure it works, and turn cron jobs back on.