Difference between revisions of "Backup and restore"
Line 69: | Line 69: | ||
− | In '''/home/''' there are two files with backup of customer application: | + | In '''/home/backup''' there are two files with backup of customer application: |
{{NotePre | {{NotePre | ||
− | |text=/home/ | + | |text=/home/backup/backup.tar |
− | /home/ | + | /home/backup/permissions |
}} | }} | ||
− | Copy | + | Copy these files to tmp/: |
{{NotePre | {{NotePre | ||
− | |text=root@buildroot:~# cp /home/ | + | |text=root@buildroot:~# cp /home/backup/backup.tar /tmp/backup.tar |
− | root@buildroot:~# cp /home/ | + | root@buildroot:~# cp /home/backup/permissions /tmp/permissions |
}} | }} | ||
Revision as of 13:50, 4 June 2018
How to backup and restore your system. 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 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 temporary. After reboot, the content is empty. If you want to keep a backup, move the files to a permanent storage.
Restore user data
Data to restore must be placed in the root temporary directory(/tmp). Copy the backup files to that location.
/tmp/backup.tar /tmp/permissions
Then 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 customer application
The user application is running on the device immediately when 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 application:
/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