Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

Backup and deploy

Revision as of 08:38, 24 June 2015 by Hipboi (Talk | contribs)

Introduction

We have been asked the questions by many individual users as well as some commercial users that "i have setup my own server on rock pro and running well, now i want to backup in case i lose data in the future" or "we have developed our own application and setup the environment now we want to install the same environment to 100 rock pro, how to do that". So we write this. This how-to tells you how to backup and restore the same firmware to your boards step by step. This how-to works for rock/rock pro/rock2 square. This how-to works under Linux. What you should know before read this:

Backup

We use rkflashtool to backup each partition of the image, install it if you haven't.

   sudo apt-get install libusb-1.0-0-dev
   git clone https://github.com/linux-rockchip/rkflashtool
   cd rkflashtool
   make

Put your device into Loader Mode and run the following command

   sudo ./rkflashtool p > parameter.bak                   #fetch parameters

open parameter file and check out all the partitions. It's like this mtdparts=rk29xxnand:0x00008000@0x00002000(boot),-@0x0000A000(linuxroot)

   sudo ./rkflashtool r boot > boot.img.bak
   sudo ./rkflashtool r linuxroot > linuxroot.ext4.bak # This will take a long time

Now you have parameter, boot, linuxroot partition backup.

Shrink rootfs

By default, linuxroot partition is very large(~8GB for rock pro), we can shrink it if the partition is not fully used. We can use gparted to shrink the rootfs.

   sudo apt-get install gparted
   sudo gparted linuxroot.ext4.bak

Shrink rootfs.png Shrink rootfs2.png

And click Apply button to start shrink. Sometimes the gparted reports shrink failed but the actual size changed.

Restore

For one device, to restore is easy, just write back what we backup.

   sudo ./rkflashtool P < parameter.bak 
   sudo ./rkflashtool r boot < boot.img.bak
   sudo ./rkflashtool r linuxroot < linuxroot.ext4.bak

If you have 100 devices and want to restore, you can repeat above for 100 times but we have another way - pack the partitions to a rockchip format firmware and use RKbatchtool to flash each board automatically.

Help and Discussion

If you have any questions or stuck at some steps, post at this thread:

The community will help :)