Backup and restore

From IPLOG
Revision as of 13:31, 25 April 2018 by Z013 (talk | contribs) (Created page with "How to backup and restore your system. In this document, we will focus on the system backup and restore it back, including the user applications. == Backup user data == All...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

How to backup and restore your system. In this document, we will focus on the system backup and restore it back, including the user applications.

Backup user data

All user data and changes are stored in /mnt/userfs. This partition can be backed up by running the command:

root@buildroot:~# metel-backup
This will create 2 files.
/tmp/backup.tar 
* it contains an image of /mnt/userfs partition

/tmp/permissions
* it contains file access rights and ownership

Note: The /tmp/ folder is temporary. After reboot, the content is empty. If you want to keep the backup, move the files to a permanent storage.


Restore user data

Data to restore must be placed in root temporary directory(/tmp). Copy the backup files to that location.

/tmp/backup.tar
/tmp/permissions

Then it is possible to start a data restoration command:

root@buildroot:~#metel-restore

Before restoring, you will be asked if you want to delete the current user data first.

root@buildroot:~# ls /tmp
-rw-r--r-- 1     root root     8824832 Jan 5 15:40 backup.tar
drwxr-xr-x 3     root root     60 Jan 5 12:19 cron
-rw-r--r-- 1     root root     0 Jan 5 12:19 dnsmasq.leases
-rw-r--r-- 1     root root     88731 Jan 5 17:03 messages
-rw-r--r-- 1     root root     5129 Jan 5 15:40 permissions
-rw-r--r-- 1     root root     55 Jan 5 17:15 resolv.conf
-rw-r--r-- 1     root root     27000832 Jan 5 10:06 rootfs.ubi
drwxr-xr-x 5     root root     100 Jan 5 12:19 SMS
-rw-r----- 1     root root     440 Jan 5 12:20 smsd.log
-rw------- 1     root root     0 Jan 5 12:19 sshd
-rw-r--r-- 1     root root    4060544 Dec 20 09:32 zImage

Do you want to delete all user data before recovering from backup? [y/N]:

Select Yes if you want to go back to a given state of the system.
Select No if you want to merge the current user data with the data from the backup. If there is a conflict between files, the backup file is applied.
It is strongly recommended to do a reboot.

root@buildroot:~# reboot


Restore customer application

The user application is running on the device immediately when you begin. If you perform an unwanted change and the need to return to the state after purchase, use this option.


Contact: support@metel.eu


In /home/ there are two files with backup of the customer application:

/home/backup_customer_app.tar
/home/permissions_customer_app

Copy and rename these files:

root@buildroot:~# cp /home/backup_customer_app.tar /tmp/backup.tar
root@buildroot:~# cp /home/permissions_customer_app/tmp/ permissions

Then run:

root@buildroot:~# metel-restore
Do you want to delete all user data before recovering from backup? [y/N]: y

It is strongly recommended to do a reboot.

root@buildroot:~# reboot