Backup and Restore

How to Create a Backup and Restore a Motorcortex Image

Motorcotex uses USB-drives to restore and backup images of Motorcortex Systems. Please select the stick that you are using:


In this section you will create a Motorcortex USB Clonezilla Drive to install Motorcortex to your controller.

Create MCX-Clonezilla USB Drive

  1. Login to Motorcortex.io and go to the Motorcortex.io Store

  2. Download the latest MCX-Clonezilla Image by pressing the download button:

    image not found
  3. Insert your empty USB Drive into your PC.

Please select the OS you are using:


  1. Right-click on the .img file and select Open With Disk Image Writer.

  2. In the following window select the Destination that you want to write the Motorcortex USB Clonezilla image file to.

  3. Press start restoring to create a MCX-Clonezilla USB Drive.

    image not found
  4. When restoring has completed, the system should automatically mount the ImageData partition of the USB Drive.

  5. Copy the MCX-OS Image file (.img.xz-file) that you downloaded from the Motorcortex Store (see Install) into the ImageData folder.


  1. Write the image to your USB Drive. There are tools available to Create bootable USB drives in like Rufus.

  2. When done, your USB Drive will be named ImageData, In this folder you can put the image that you want to install onto a controller.

  3. Copy the MCX-OS Image file (.img.xz-file) that you downloaded from the Motorcortex Store (see Install) into the ImageData folder.


image not found

Booting From The Motorcortex USB Drive

  1. Make sure your Controller is powered off.

  2. Insert the Motorcortex USB Clonezilla Drive into your Controller. Make sure the image you would like to write to your controller is in the ImageData partition onto the Drive.

  3. Power on the Controller.

  4. Your Controller should automatically boot from the Motorcortex-Clonezilla USB Drive. If it does not boot automatically from USB check your Controller’s BIOS settings to enable booting from USB.

  5. Log in to the Motorcortex-Clonezilla terminal

    There are 2 ways to access the terminal of the MCX-Clonezilla:


    1. Connect your controller with your PC using the Ethernet port.

    2. Make sure the ip address of your network adapter that is connected to the Controller is in the 192.168.2.xxx range. How to do this is explained in Configure Your Network.

    3. Open a terminal.

    4. Connect to your Controller by typing:

      ssh admin@192.168.2.100
      
    5. log in with password vectioneer.

    6. The terminal should immediately show you a screen similar to below.

      image not found

    By attaching a Keyboard and a Display to your Controller you should immediately see a screen similar to below.

    image not found

Install MCX-OS

  1. To start the restore procedure type

    mci restore
    
  2. Now the prompt will ask you what image you would like to restore. Choose the image that you would like to restore.

  3. Second the prompt will ask you to choose the drive where you want to restore your image to.

  4. Restoring the image will take some time. When the process is done, check for any errors in the console

  5. You will get the message Done when the process is finished.

    image not found
  6. Remove the MCX-Clonezilla USB drive.

  7. Now you can reboot or poweroff.

    sudo reboot
    
  8. Wait for a couple seconds for the system to restart.

  9. Congratulations you have installed MCX-OS onto your Controller!

The next step is to set-up the connection between your controller and your laptop. Connect Your PC


The MOTORCORTEX-Imager USB Stick is a bootable USB drive that can be used to create backups and restore images of MOTORCORTEX Systems.

Downloading and flashing the MOTORCORTEX-Imager image to a USB stick

  1. You will need an USB Stick of at least 6Gb and at least 7Gb of free space on your PC.
  2. Download the latest MOTORCORTEX-Imager release: MOTORCORTEX-Imager.
  3. Extract the image, so you should have a 6Gb .img file.
  4. On Windows systems, you will need an external tool to write disk images to an USB device. There are several options, one of them is http://unetbootin.github.io. On most Linux distributions you can just on the img file and this will open the Disk Image Writer tool.
  5. Write the image to your USB Drive.
  6. When done, you can mount the stick on your system and copy an existing image file onto the ImageData partition of the stick.

Booting from the MOTORCORTEX-Imager USB stick

The Motorcortex-Imager can be used with a screen and keyboard attached to the controller or over an SSH connection, so no screen and keyboard is necessarily.

Using a Screen and Keyboard

  1. Make sure the controller is switched off.

  2. Insert the Motorcortex-Imager USB Stick into an available USB port of the controller.

  3. Attach a keyboard to one of the USB-ports and a display to the HDMI-port.

  4. Switch the controller on.

  5. If all is correct you will see the something like the picture below:

    image not found

If above screen does not appear, check the screen and usb connection. If that does not help, check the bios settings of the Motorcortex Controller, it might be that USB stick is not first in the boot order.

Using SSH

  1. Make sure the controller is switched off.

  2. Insert the Motorcortex-Imager USB Stick into an available USB port of the controller.

  3. Switch the controller on.

  4. Give the controller some time to boot. Log in after 20 seconds using a SSH client like Putty, the Linux Terminal or Windows Command Line. Type

    ssh tc@192.168.2.100

Log in with password vectioneer.

  1. If all is correct you will see the something like the picture below:

    image not found

    If above screen does not appear, check network settings and network connection (tip: first try

    ping 192.168.2.100

    If that does not help, check the bios settings of the Motorcortex Controller, it might be that USB stick is not first in the boot order.

Making a back-up

  1. Type sudo mcx-backup to start the back-up procedure.

  2. Choose which disk you want to back-up. Hard disks and solid state disks usually start with SD.. SD cards and USB sticks with eMMC.

  3. Next choose where you want to store your image:

    1. This is the default option, it stores it on the USB stick (/mnt/usb/), followed by the date and time on the controller + mcx-image.img.xz.
    2. It is also possible to choose your own name and location. Type /mnt/usb/ to store it on the USB stick. Follow this by the name you want to give. End with .img or .img.xz. The .xz means that the file is zipped. It is recommended to use zip, since otherwise the image file will be the size of the disk (in case of the Motorcortex Fitlet2 this is 32GB). If you follow this you will get something like:

    /mnt/usb/2020-04-08_another-image_name.img.xz

  4. Creating a backup image will take some time. You can watch the progress in the console.

  5. When the backup is finished the number of bytes written will be shown. Please check if there are any errors being reported that may indicate that creating the image has failed.

    image not found
  6. Now you can reboot or poweroff. In case you are done with the back-up and want to go back to the Motorcortex Operating System, type:

    sudo poweroff

  7. Wait for for the system to power off. During this time any cached data is still written to the disk, so no not switch off early.

  8. The system should reboot or power off automatically. At that time remove the USB stick.

  9. Switch on the power again to start the system from the internal storage again.

  10. It is good practice to restore an image to another system or boot the image in a virtual box, to see if the backup went well.

Restoring an image (Cold Start)

This method can be used to install a fresh MOTORCORTEX-OS image or a backup image to your controller.

  1. If the MCX boot stick does not already contain your source image, copy it into the ImageData partition of the USB stick. Supported image file formats are raw image (.img), compressed images (.img.xz) or WIC images (.wic).
  2. Boot from the USB stick and log into the system (see above)
  3. Type sudo mcx-restore -f to start the restore procedure. The -f option will expand the image to use the full disk size, this is useful if you are restoring a truncated image and you wish to use all available disk space on the target system.
  4. Choose which image you would like to restore.
  5. Choose the drive where you want to restore your image to.
  6. Be patient, restoring the image will take some time. When the process is done, check for any errors in the console
  1. You will get the message Done when the process is finished.

    image not found
  2. Now you can reboot or poweroff. In case you are done with the back-up and want to go back to the Motorcortex Operating System, type:

    sudo poweroff

  3. Wait for 20 seconds for the system to power off.

  4. Switch off the power of the controller.

  5. Remove the USB stick.

  6. Switch on the power again.

  7. Done.

Last modified June 9, 2022: maintainance --> maintenance (7439acba)