Backup and restore

From IPLOG
Jump to: navigation, search

In this document, we will focus on the system backup and restoration of the system, including user applications.

Backup User Data

All user data and changes are stored in /mnt/userfs. This partition can be backed up by using the following 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 a temporary. After reboot, the content will be empty. If you require a backup, move the files to a permanent storage or some other destination than /tmp/.


Restore User Data

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

/tmp/backup.tar
/tmp/permissions

Now it is possible to start the 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 files. If there is a conflict between files, the backup file will be applied.
It is strongly recommended to do a reboot.

root@buildroot:~# reboot


Restore User Data to Factory

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


Contact: support@metel.eu


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

/home/backup/backup.tar
/home/backup/permissions

Copy these files to tmp/:

root@buildroot:~# cp /home/backup/backup.tar /tmp/backup.tar
root@buildroot:~# cp /home/backup/permissions /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