Project

General

Profile

BackupsResearch » History » Version 15

doak complex, 01/20/2020 09:55 AM
TODO: Provide working generic 'adb pull' command.

1 1 Denis 'GNUtoo' Carikli
h1. BackupsResearch
2
3
{{>toc}}
4
5 8 Denis 'GNUtoo' Carikli
h2. Introduction
6
7
The [[BackupTheEFS]] page has instructions to backup the EFS. This page instead tries to document why it is done in that way, and what are the advantages and disadvantages of various other backups methods.
8
9 9 Denis 'GNUtoo' Carikli
This can also be useful to write more generic backup instructions to do a more complete backup.
10
11 1 Denis 'GNUtoo' Carikli
h2. Doing the backup of partitions or other block devices
12
13
h3. adb shell cat pipe
14
15 13 doak complex
Old versions of the "EFS backup instructions":https://redmine.replicant.us/projects/replicant/wiki/BackupTheEFS (revision 17) used the following command:
16 1 Denis 'GNUtoo' Carikli
<pre>
17
adb shell "cat /dev/block/platform/*/by-name/EFS > /EFS.img"
18
</pre>
19
20
At some point or under some condition, this stopped working and the backup were corrupted.
21 2 Denis 'GNUtoo' Carikli
22
h3. adb shell cat adb pull
23
24 14 Denis 'GNUtoo' Carikli
With something like that:
25 1 Denis 'GNUtoo' Carikli
<pre>
26 14 Denis 'GNUtoo' Carikli
adb shell "cat /dev/block/platform/*/by-name/EFS > /EFS.img"
27 2 Denis 'GNUtoo' Carikli
adb pull /EFS.img ./
28 1 Denis 'GNUtoo' Carikli
</pre> 
29 2 Denis 'GNUtoo' Carikli
30 14 Denis 'GNUtoo' Carikli
doing it in two stages like that seem to be widely used in other instructions (like the ones found in XDA forums).
31 2 Denis 'GNUtoo' Carikli
32
Normally cat should produce a valid backup, however it might be better to use dd for extra safety.
33
34 10 Denis 'GNUtoo' Carikli
On Replicant 6.0 0004, at least the recoveries for the following devices have 'dd':
35 2 Denis 'GNUtoo' Carikli
* Galaxy Nexus
36
* Galaxy SIII
37
38
h3. adb pull the block device
39
40
The following should also work:
41
<pre>
42
adb pull /dev/block/mmcblk0p3 ./EFS.img
43
</pre>
44 3 Denis 'GNUtoo' Carikli
45 1 Denis 'GNUtoo' Carikli
The advantage is that it can also backup huge partitions like the user data partition or Replicant system partition.
46 10 Denis 'GNUtoo' Carikli
47
TODO:
48
* Validate if doing "adb pull /dev/block/platform/*/by-name/EFS ./EFS.img" work, and if so, validate it for all the devices.
49 15 doak complex
* [by doak] No, it does not (expansion of @*@ fails), but this would do:
50
  <pre>
51
  part="`adb shell "ls /dev/block/platform/*/by-name/EFS" | head --bytes=-2`"
52
  adb pull "$part" ./EFS.img
53
  </pre>
54
  Be aware of the @head --bytes=-2@ which is needed to get rid of the nasty @0x0d 0x0a@ line ending returned by @adb@.
55
  (Tested on Recovery of Replicant 6.0 0003.)
56 5 Kurtis Hanna
57 11 Denis 'GNUtoo' Carikli
h2. Backup applications.
58
59
It might be a good idea to have a list of backup applications and/or to ship one with Replicant.
60 5 Kurtis Hanna
61
* This backup app might be a good option for Replicant 9 or 10: https://github.com/stevesoltys/backup
62 12 Denis 'GNUtoo' Carikli
* F-droid might also has applications. As F-droid packages are not all FSDG compliant, we would need to make sure that the backup application we recommend or ship are FSDG compliant.
63
64
It might also be a good idea to understand if the backup solution chosen is sustainable in the long term: If the development stop or upstream decide to make the new version proprietary some users might have a hard time adapting to new backup applications or systems.