Open Benjamin-Loison opened 5 months ago
https://docs.waydro.id/faq/backup-restore-apps-and-data may help to some extent.
Related to Benjamin_Loison/WhatsApp/issues/15.
See:
-----BEGIN PGP MESSAGE-----
hF4DTQa9Wom5MBgSAQdAii+8J/IYAcFRl6hPNm1UMh9dnrkayDtSui/D6NjnQSow
xTnuG+DauWcbPZwfwtzrNuf+qfe9v++e7Toq+qre+1B7u0eC22TXJMSIqosC26eg
0nABDHaXdNTSxqw7zDhQThi7vkknxJAqlg6E8jqj42Vwwm1M40bRDOLx0PjNicF5
fpy0CkIMKcGb2jILhSK3XTom45wmHJKoy3fhNCip8OT5ba0/zbqTXrc7n5+KL/CP
x8KoToTUUCEBLAh/Y/zS4LjW
=mLU5
-----END PGP MESSAGE-----
on my Linux Mint 22 Cinnamon Framework 13.
The Android Stack Exchange answer 120158 helps us know when an app was first installed. The Android Stack Exchange answer 116633 helps us know when an app was last used.
Is not there an app to copy everything from a phone to another and temporarily store them if same phone? Like Samsung swap or similar if I remember correctly.
Tracked at Benjamin_Loison/seedvault/issues/6.
Settings > System > Backup > Seedvault Backup.
Note Backup status and ⋮
> Expert settings > Device-to-device backups.
See Benjamin_Loison/seedvault/issues/7.
Related to Benjamin_Loison/seedvault/issues/1 and Benjamin_Loison/WhatsApp/issues/6.
Probably have to disable App backup if restore on Waydroid as by default CPU architecture differs.
Could test SeedVault backup by having in addition an sda
dd
copy (that way can extract sda11
, then use sda
if still failing) and app by app backup. To verify the backup can either uninstall apps and their data or even factory reset from LineageOS which would be a more correct test. Note that if I buy a Fairphone 5 restoring user data partition not be a good idea anyway, so in such case would leverage SeedVault or app by app. However, note that factory reset may reset some device specific constant and restoring user-data could break some stuff.
Could even factory reset from recovery to make it in theory stronger, to potentially restore Fairphone OS and have to re-install LineageOS.
Take screenshots of my Special boot modes, see https://wiki.lineageos.org/devices/FP4/.
Note the UNKONW typo.
"Press volume key to select, and press power" LineageOS
does not seem to return any source code on both DuckDuckGo and Google.
So seems to be able to start ADB without booting LineageOS.
Maybe this meta menu is only working within memory, hence with dd
maybe can save and change it too, hence modify the whole phone.
Can verify that able to restore backed up data correctly with Waydroid, see https://xdaforums.com/t/guide-running-your-android-device-on-a-virtual-machine.2084016/. However, note that Waydroid does not have dialer and messaging apps as far as I remember.
Maybe a dd
backup works fine on the given phone but on another one with same specs may not work. Should test modifying an app, an app state and a system setting to see if they are restored well. Note that for some apps such as Signal it may be possible that such a backup break them somehow.
From recovery:
adb shell whoami
root
adb shell df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 3.5G 34M 3.4G 1% /
tmpfs 3.6G 3.7M 3.6G 1% /dev
tmpfs 3.6G 0 3.6G 0% /mnt
tmpfs 3.6G 0 3.6G 0% /apex
tmpfs 3.6G 4.0K 3.6G 1% /linkerconfig
tmpfs 3.6G 32K 3.6G 1% /tmp
tmpfs 3.6G 0 3.6G 0% /storage
After Mount/unmount system:
adb shell df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 3.5G 34M 3.4G 1% /
tmpfs 3.6G 3.7M 3.6G 1% /dev
tmpfs 3.6G 0 3.6G 0% /mnt
tmpfs 3.6G 0 3.6G 0% /apex
tmpfs 3.6G 4.0K 3.6G 1% /linkerconfig
tmpfs 3.6G 32K 3.6G 1% /tmp
tmpfs 3.6G 0 3.6G 0% /storage
/dev/block/dm-2 999M 907M 91M 91% /mnt/system
adb shell ls -lh /dev/block/
Source: the Stack Overflow answer 41422730
After Mount/umount system:
diff a b
52c52
< brw------- 1 root root 8, 4 1970-12-19 23:28 sda4
---
> brw------- 1 root root 8, 4 1970-12-19 23:25 sda4
147c147
< brw------- 1 root root 254, 0 1970-12-19 23:23 zram0
---
> brw------- 1 root root 254, 0 1970-12-19 23:23 zram0
\ No newline at end of file
Added After dd.
to Add text on lock screen. touch after_dd
on Termux. New folder after_dd in Files. Installed ProtonVPN app.
The Stack Overflow comment 47115600:
mount
rootfs on / type rootfs (rw,seclabel,size=3685400k,nr_inodes=921350)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,size=3825520k,nr_inodes=956380,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600,ptmxmode=000)
proc on /proc type proc (rw,relatime,gid=3009,hidepid=2)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
tmpfs on /mnt type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=3825520k,nr_inodes=956380,mode=755,gid=1000)
tmpfs on /apex type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=3825520k,nr_inodes=956380,mode=755)
tmpfs on /linkerconfig type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=3825520k,nr_inodes=956380,mode=755)
tmpfs on /mnt/installer type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=3825520k,nr_inodes=956380,mode=755,gid=1000)
tmpfs on /mnt/androidwritable type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=3825520k,nr_inodes=956380,mode=755,gid=1000)
none on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,seclabel,relatime,size=3825520k,nr_inodes=956380)
tmpfs on /storage type tmpfs (rw,seclabel,relatime,size=3825520k,nr_inodes=956380,mode=050,gid=1028)
binder on /dev/binderfs type binder (rw,relatime,max=1048576,stats=global)
none on /config type configfs (rw,relatime)
adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
fastboot on /dev/usb-ffs/fastboot type functionfs (rw,relatime)
ls -l /dev/block/bootdevice/by-name/userdata
lrwxrwxrwx 1 root root 16 1970-12-22 07:42 /dev/block/bootdevice/by-name/userdata -> /dev/block/sda11
ls -l /dev/block/sda11
brw------- 1 root root 8, 11 1970-12-22 07:42 /dev/block/sda11
ls /dev/block/mmcblk0
ls: /dev/block/mmcblk0: No such file or directory
adb pull /dev/block/sda11; matrix-commander -m 'adb copy finished!'
[ ?] /dev/block/sda11: 660799488/?
adb help
file transfer:
push [--sync] [-z ALGORITHM] [-Z] LOCAL... REMOTE
copy local files/directories to device
--sync: only push files that are newer on the host than the device
-n: dry run: push files to device without storing to the filesystem
-z: enable compression with a specified algorithm (any/none/brotli/lz4/zstd)
-Z: disable compression
pull [-a] [-z ALGORITHM] [-Z] REMOTE... LOCAL
copy files/dirs from device
-a: preserve file timestamp and mode
-z: enable compression with a specified algorithm (any/none/brotli/lz4/zstd)
-Z: disable compression
sync [-l] [-z ALGORITHM] [-Z] [all|data|odm|oem|product|system|system_ext|vendor]
sync a local build from $ANDROID_PRODUCT_OUT to the device (default all)
-n: dry run: push files to device without storing to the filesystem
-l: list files that would be copied, but don't copy them
-z: enable compression with a specified algorithm (any/none/brotli/lz4/zstd)
-Z: disable compression
adb shell cat /dev/block/sda11 | pv -s 256G > sda11; matrix-commander -m 'adb copy finished!'
470MiB 0:00:14 [34.7MiB/s] [> ] 0% ETA 2:09:55
Ongoing:
ls -lh
total 2.4G
-rw-rw-r-- 1 benjamin benjamin 2.4G Aug 13 12:02 sda11
adb shell cat /dev/block/sda11 | pv -s 256G > sda11
175GiB 1:28:52 [33.7MiB/s] [=============================================================> ] 68%
ls -l sda11
-rw-rw-r-- 1 benjamin benjamin 188195950592 Aug 13 13:34 sda11
Once rebooted:
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/block/dm-2 999M 907M 75M 93% /
tmpfs 3.6G 3.9M 3.6G 1% /dev
tmpfs 3.6G 0 3.6G 0% /mnt
/dev/block/dm-3 476M 388M 78M 84% /system_ext
/dev/block/dm-1 1.5G 474M 1.0G 30% /product
/dev/block/dm-4 656M 654M 0 100% /vendor
/dev/block/dm-0 1.3M 1.3M 0 100% /odm
tmpfs 3.6G 12K 3.6G 1% /apex
/dev/block/loop4 1.1M 1.1M 8.0K 100% /apex/com.android.rkpd@350090000
/dev/block/loop3 3.6M 3.6M 0 100% /apex/com.android.os.statsd@350090000
/dev/block/loop5 11M 11M 0 100% /apex/com.android.healthfitness@350090000
/dev/block/loop6 22M 22M 0 100% /apex/com.android.btservices@350090000
/dev/block/loop7 328K 296K 28K 92% /apex/com.android.virt@2
/dev/block/loop8 760K 732K 16K 98% /apex/com.android.tzdata@350090000
/dev/block/loop10 5.5M 5.4M 0 100% /apex/com.android.devicelock@1
/dev/block/loop11 232K 96K 132K 43% /apex/com.android.apex.cts.shim@1
/dev/block/loop9 10M 10M 0 100% /apex/com.android.runtime@1
/dev/block/loop12 232K 152K 76K 67% /apex/com.android.hardware.cas@1
/dev/block/loop14 38M 38M 0 100% /apex/com.android.i18n@1
/dev/block/loop13 716K 688K 16K 98% /apex/com.android.sdkext@350090000
/dev/block/dm-38 22M 22M 0 100% /apex/com.android.permission@350090000
/dev/block/dm-39 41M 41M 0 100% /apex/com.android.art@350090000
/dev/block/dm-37 3.9M 3.9M 0 100% /apex/com.android.uwb@350090000
/dev/block/dm-36 23M 23M 0 100% /apex/com.android.extservices@350090000
/dev/block/dm-35 23M 23M 0 100% /apex/com.android.mediaprovider@350090000
/dev/block/dm-31 13M 13M 0 100% /apex/com.android.ondevicepersonalization@350090000
/dev/block/dm-34 6.2M 6.2M 0 100% /apex/com.android.media@350090000
/dev/block/dm-29 8.6M 8.6M 0 100% /apex/com.android.wifi@350090000
/dev/block/dm-27 232K 104K 124K 46% /apex/com.android.scheduling@350090000
/dev/block/dm-25 5.7M 5.7M 0 100% /apex/com.android.conscrypt@350090000
/dev/block/dm-21 756K 728K 16K 98% /apex/com.android.ipsec@350090000
/dev/block/dm-23 3.7M 3.7M 0 100% /apex/com.android.appsearch@350090000
/dev/block/dm-19 17M 17M 0 100% /apex/com.android.cellbroadcast@350090000
/dev/block/dm-18 7.4M 7.4M 0 100% /apex/com.android.neuralnetworks@350090000
/dev/block/dm-17 21M 21M 0 100% /apex/com.android.adservices@350090000
/dev/block/dm-14 7.9M 7.8M 0 100% /apex/com.android.adbd@350090000
/dev/block/dm-15 29M 29M 0 100% /apex/com.android.media.swcodec@350090000
/dev/block/dm-12 4.1M 4.0M 0 100% /apex/com.android.resolv@350090000
/dev/block/dm-11 552K 524K 20K 97% /apex/com.android.configinfrastructure@350090000
/dev/block/dm-9 20M 20M 0 100% /apex/com.android.tethering@350090000
tmpfs 3.6G 4.0K 3.6G 1% /bootstrap-apex
/dev/block/loop2 760K 732K 16K 98% /bootstrap-apex/com.android.tzdata@350090000
/dev/block/loop1 10M 10M 0 100% /bootstrap-apex/com.android.runtime@1
/dev/block/loop0 38M 38M 0 100% /bootstrap-apex/com.android.i18n@1
tmpfs 3.6G 0 3.6G 0% /tmp
/dev/block/dm-40 222G 165G 57G 75% /data
/dev/fuse 222G 165G 57G 75% /storage/emulated
Fairphone 4 is advertized as with 256 GB of storage, source: https://shop.fairphone.com/shop/buy-fairphone-4#attr=1,5.
Let us verify that the connection has not broke just at this time.
adb shell cat /dev/block/sda11 | pv -s 256G | diff sda11 -; echo $?; matrix-commander -m 'diff finished!'
On Debian 12 GNOME Pegasus having a more stable physical setup.
adb shell cat /dev/block/sda11 | pv -s 256G > sda11; matrix-commander-rs -m 'adb copy finished!'
221GiB 1:34:43 [40.0MiB/s] [============================> ] 86%
ls -l sda11
-rw-r--r-- 1 benjamin_loison benjamin_loison 238344658944 Aug 14 01:35 sda11
Now differing without having interacted with the phone.
adb shell cat /dev/block/sda11 | pv -s 256G | diff sda11 -; echo $?; matrix-commander -m 'diff finished!'
221GiB 1:36:32 [39.2MiB/s] [============================> ] 86%
0
man df
...
The SIZE argument is an integer and optional unit (example: 10K is
10*1024). Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,...
(powers of 1000). Binary prefixes can be used, too: KiB=K, MiB=M, and
so on.
...
221GiB = 221 * (1,024 ^ 3) = 237,296,943,104 which is very near to above ls -l
. Due to number of GiB approximation it looks correct.
man diff
...
[...] If a FILE is '-', read standard input. Exit status
is 0 if inputs are the same, 1 if different, 2 if trouble.
...
So so far so good.
Should df
without -h
, when system running, to be precise and compare with above.
adb shell df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/block/dm-2 1022496 929232 76880 93% /
tmpfs 3825520 4004 3821516 1% /dev
tmpfs 3825520 0 3825520 0% /mnt
/dev/block/dm-3 487432 397652 79380 84% /system_ext
/dev/block/dm-1 1645804 485300 1144120 30% /product
/dev/block/dm-4 671284 669224 0 100% /vendor
/dev/block/dm-0 1420 1412 0 100% /odm
tmpfs 3825520 12 3825508 1% /apex
tmpfs 3825520 4 3825516 1% /bootstrap-apex
/dev/block/loop0 38504 38476 0 100% /bootstrap-apex/com.android.i18n@1
/dev/block/loop2 760 732 16 98% /bootstrap-apex/com.android.tzdata@350090000
/dev/block/loop1 10484 10444 0 100% /bootstrap-apex/com.android.runtime@1
tmpfs 3825520 0 3825520 0% /tmp
/dev/block/dm-40 232756408 174750432 57874904 76% /data
/dev/block/loop4 232 152 76 67% /apex/com.android.hardware.cas@1
/dev/block/loop3 3744 3716 0 100% /apex/com.android.os.statsd@350090000
/dev/block/loop5 1228 1196 8 100% /apex/com.android.rkpd@350090000
/dev/block/loop6 328 296 28 92% /apex/com.android.virt@2
/dev/block/loop8 5656 5628 0 100% /apex/com.android.devicelock@1
/dev/block/loop7 10484 10444 0 100% /apex/com.android.runtime@1
/dev/block/loop9 22100 22072 0 100% /apex/com.android.btservices@350090000
/dev/block/loop10 760 732 16 98% /apex/com.android.tzdata@350090000
/dev/block/dm-37 4076 4048 0 100% /apex/com.android.uwb@350090000
/dev/block/dm-29 8864 8836 0 100% /apex/com.android.wifi@350090000
/dev/block/dm-38 22268 22240 0 100% /apex/com.android.permission@350090000
/dev/block/dm-39 42064 42032 0 100% /apex/com.android.art@350090000
/dev/block/dm-34 6440 6408 0 100% /apex/com.android.media@350090000
/dev/block/dm-35 23892 23860 0 100% /apex/com.android.mediaprovider@350090000
/dev/block/dm-36 23920 23888 0 100% /apex/com.android.extservices@350090000
/dev/block/loop20 38504 38476 0 100% /apex/com.android.i18n@1
/dev/block/loop19 11148 11120 0 100% /apex/com.android.healthfitness@350090000
/dev/block/dm-31 13440 13408 0 100% /apex/com.android.ondevicepersonalization@350090000
/dev/block/loop22 716 688 16 98% /apex/com.android.sdkext@350090000
/dev/block/loop21 232 96 132 43% /apex/com.android.apex.cts.shim@1
/dev/block/dm-27 232 104 124 46% /apex/com.android.scheduling@350090000
/dev/block/dm-9 20760 20728 0 100% /apex/com.android.tethering@350090000
/dev/block/dm-23 3872 3844 0 100% /apex/com.android.appsearch@350090000
/dev/block/dm-21 756 728 16 98% /apex/com.android.ipsec@350090000
/dev/block/dm-18 7632 7604 0 100% /apex/com.android.neuralnetworks@350090000
/dev/block/dm-19 17076 17048 0 100% /apex/com.android.cellbroadcast@350090000
/dev/block/dm-17 21712 21660 0 100% /apex/com.android.adservices@350090000
/dev/block/dm-14 8112 8084 0 100% /apex/com.android.adbd@350090000
/dev/block/dm-15 29272 29244 0 100% /apex/com.android.media.swcodec@350090000
/dev/block/dm-12 4212 4180 0 100% /apex/com.android.resolv@350090000
/dev/block/dm-11 552 524 20 97% /apex/com.android.configinfrastructure@350090000
/dev/block/dm-25 5936 5908 0 100% /apex/com.android.conscrypt@350090000
/dev/fuse 232756408 174750480 57874856 76% /storage/emulated
So it seems that /data/
has 6 GB less so seems to make quite sense as there is maybe more data/metadata for the phone to work well.
From recovery:
adb shell df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 3685400 34976 3650424 1% /
tmpfs 3825520 3812 3821708 1% /dev
tmpfs 3825520 0 3825520 0% /mnt
tmpfs 3825520 0 3825520 0% /apex
tmpfs 3825520 4 3825516 1% /linkerconfig
tmpfs 3825520 32 3825488 1% /tmp
tmpfs 3825520 0 3825520 0% /storage
Should try diff after:
adb shell cat /dev/block/sda11 | pv -s 256G | diff sda11 -; echo $?; matrix-commander-rs -m 'diff finished!'
221GiB 1:36:19 [39.3MiB/s] [============================================================================================================================================> ] 86%
0
adb shell ls -l /dev/block/bootdevice/by-name/userdata
lrwxrwxrwx 1 root root 16 1970-12-23 10:58 /dev/block/bootdevice/by-name/userdata -> /dev/block/sda11
adb shell cat /dev/block/sda11 | pv -s 256G | diff sda11 -; echo $?; matrix-commander-rs -m 'diff finished!'
Binary files sda11 and - differ
2.07MiB 0:00:00 [23.7MiB/s] [> ] 0%
So I did again:
Then can try restoring image after having modified an app, an app state and a system setting.
Added
After dd.
to Add text on lock screen.touch after_dd
on Termux. New folder after_dd in Files. Installed ProtonVPN app.
Can verify total length if fail, that is what is we expect. Not writing to disk but just having byte precision with pv
would be nice. See Benjamin_Loison/pv/issues/3.
adb shell cat /dev/block/sda11 | pv -s 256G > /dev/null
117MiB 0:00:03 [39.7MiB/s] [> ] 0% ETA 1:51:32
man pv
...
-b, --bytes
Turn the total byte counter on. This will display the total amount of data transferred so far.
...
-A, --last-written NUM
Show the last NUM bytes written - but see the caveat under %nA in the FORMATTING section below. Implies -C.
...
-n, --numeric
Numeric output. Instead of giving a visual indication of progress, pv will give an integer percentage, one per line, on
standard error, suitable for piping (via convoluted redirection) into dialog(1). Note that -f is not required if -n is
being used.
Note that if --numeric is in use, then adding --bytes will cause the number of bytes processed so far to be output in‐
stead of a percentage; if --line-mode is also in use, then instead of bytes or a percentage, the number of lines so far
is output. And finally, if --timer is also in use, then each output line is prefixed with the elapsed time so far, as a
decimal number of seconds.
...
-s SIZE, --size SIZE
Assume the total amount of data to be transferred is SIZE bytes when calculating percentages and ETAs. The same suffixes
of "k", "m" etc can be used as with -L.
...
All above settings do not seem to help.
man pv
...
-F, --format FORMAT
Ignore the options -p, -t, -e, -r, -a, -b, -T, and -A, and instead use the format string FORMAT to determine the output
format. See the FORMATTING section below.
...
FORMATTING
If the -F option is given, then the output format is determined by the given format string. Within that string, the following
sequences can be used:
%p Progress bar. Expands to fill the remaining space. Should only be specified once. Equivalent to -p.
%t Elapsed time. Equivalent to -t.
%e ETA as time remaining. Equivalent to -e.
%I ETA as local time of completion. Equivalent to -I.
%r Current data transfer rate. Equivalent to -r.
%a Average data transfer rate. Equivalent to -a.
%b Bytes transferred so far (or lines if -l was specified). Equivalent to -b.
%T Percentage of the transfer buffer in use. Equivalent to -T. Shows "{----}" if the transfer is being done with
splice(2), since splicing to or from pipes does not use the buffer.
%nA Show the last n bytes written (e.g. %16A for the last 16 bytes). Shows only dots if the transfer is being done with
splice(2), since splicing to or from pipes does not use the buffer.
%N Name prefix given by -N. Padded to 9 characters with spaces, and suffixed with :.
%% A single %.
The format string equivalent of turning on all display switches is `%N %b %T %t %r %a %p %e'.
COMMON SWITCHES
Some suggested common switch combinations:
pv -ptebar
Show a progress bar, elapsed time, estimated completion time, byte counter, average rate, and current rate.
pv -betlap
Show a progress bar, elapsed time, estimated completion time, line counter, and average rate, counting lines instead of
bytes.
pv -t Show only the elapsed time - useful as a simple timer, e.g. sleep 10m | pv -t.
pv -pterb
The default behaviour: progress bar, elapsed time, estimated completion time, current rate, and byte counter.
On MacOS, it may be useful to specify -B 1024 in a pipeline, as this may improve performance.
...
unclear how to leverage it --format
.
COMMON SWITCHES does not seem to help.
Search on first pages of results of DuckDuckGo and Google Linux "pv" byte precision
only bring the following result:
The SuperUser answer 568567 may help.
echo 'test' | ls -
ls: cannot access '-': No such file or directory
echo 'test' | wc -c
5
adb shell cat /dev/block/sda11 | pv -s 256G | wc -c; matrix-commander-rs -m 'wc finished!'
193GiB 1:37:28 [38.9MiB/s] [===================================================================> ] 86%
238344658944
So size is identical with above but not content, so it makes sense.
adb push
adb: push requires an argument
adb push sda11 /dev/block/sda11; matrix-commander-rs -m 'push finished!'
[ 2%] /dev/block/sda11
A more precise progress would be nice.
Then got:
adb: error: failed to copy 'sda11' to '/dev/block/sda11': no response: Success
without knowing the progress before the error.
Furthermore I get:
* daemon not running; starting now at tcp:5037
* daemon started successfully
afterwards when running an adb command, maybe it shows that adb server died on the computer side? I don't know if what I am writing makes sense.
Related to Benjamin_Loison/time/issues/1.
I executed again and it seems that it went fine as there was no output it seems.
So running:
time adb push sda11 /dev/block/sda11; echo $?; matrix-commander-rs -m 'push finished!'
adb: error: failed to copy 'sda11' to '/dev/block/sda11': no response: Success
real 15m16.995s
user 0m6.042s
sys 1m40.399s
1
to make sure, can diff
afterwards to make sure.
adb shell cat /dev/block/sda11 | pv -s 256G | diff sda11 -; echo $?; matrix-commander-rs -m 'diff finished!'
1
So it confirms my suspicion, let us push again (does not used to have previous precise output).
error: device offline seems to happen when try an adb command while the phone screen is off due to idle, maybe replugging helps to. Maybe no response: Success has the same issue origin. Let us monitor closely when the phone has its screen off due to idling or at least when I am notified is the screen off. Let us also try to regularly turn back on the screen, as it seems that when it goes off it does not directly break the push, so maybe there is an additional timing like on computers before actually going to sleep.
When the push broke again the screen was off.
time adb push sda11 /dev/block/sda11; echo $?; matrix-commander-rs -m 'push finished!'
adb: error: failed to copy 'sda11' to '/dev/block/sda11': no response: Success
real 14m39.793s
user 0m5.990s
sys 1m29.839s
1
Let us run with tee
this time:
time adb push sda11 /dev/block/sda11 | tee logs.txt; echo $?; matrix-commander-rs -m 'push finished!'
real 15m3.428s
user 0m3.817s
sys 1m30.173s
0
The tee
purpose is to keep what percentage was reached.
Sometimes as this time I noticed nothing graphically before this output, and nothing in logs.txt
.
"adb push" "pv"
first page of results on DuckDuckGo and Google are not relevant.
Related to Benjamin-Loison/obs-studio/issues/15.
time adb push sda11 /dev/block/sda11 | tee logs.txt; echo $?; matrix-commander-rs -m 'push finished!'
real 15m18.672s
user 0m4.464s
sys 1m38.401s
0
There is really something going on with this 15 minutes delay.
Should search directly my adb error on the Internet. The only relevant results of DuckDuckGo and Google are:
Can try to use latest adb version.
adb --version
Android Debug Bridge version 1.0.41
Version 29.0.6-debian
Installed as /usr/lib/android-sdk/platform-tools/adb
On Debian 12 GNOME Pegasus.
https://en.wikipedia.org/w/index.php?title=Android_Debug_Bridge&oldid=1235449153 states that the last version is 34.0.1 (March 2023).
Source: Wikipedia: Android Debug Bridge (1235449153)
https://android.googlesource.com/platform/packages/modules/adb/ https://android.googlesource.com/platform/packages/modules/adb/+/HEAD/docs/user/adb.1.md https://android.googlesource.com/platform/packages/modules/adb/+/HEAD/docs/dev/README.md https://developer.android.com/tools/adb
do not seem to give directly the most recent version label.
adb
is included in the Android SDK Platform Tools package. Download this package with the SDK Manager, which installs it atandroid_sdk/platform-tools/
. If you want the standalone Android SDK Platform Tools package, download it here.
Source: https://developer.android.com/tools/adb
https://developer.android.com/studio/intro/update#sdk-manager
sdkmanager
Command 'sdkmanager' not found, but can be installed with:
sudo apt install sdkmanager
sudo apt install -y sdkmanager
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
sdkmanager
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 33.2 kB of archives.
After this operation, 100 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bookworm/main amd64 sdkmanager all 0.6.4-1 [33.2 kB]
Fetched 33.2 kB in 0s (957 kB/s)
Selecting previously unselected package sdkmanager.
(Reading database ... 408580 files and directories currently installed.)
Preparing to unpack .../sdkmanager_0.6.4-1_all.deb ...
Unpacking sdkmanager (0.6.4-1) ...
Setting up sdkmanager (0.6.4-1) ...
sdkmanager
Downloading https://f-droid.github.io/android-sdk-transparency-log/signed/checksums.json.asc into /home/benjamin_loison/.cache/sdkmanager/checksums.json.asc
Downloading https://f-droid.github.io/android-sdk-transparency-log/signed/checksums.json into /home/benjamin_loison/.cache/sdkmanager/checksums.json
Traceback (most recent call last):
File "/usr/bin/sdkmanager", line 33, in <module>
sys.exit(load_entry_point('sdkmanager==0.6.4', 'console_scripts', 'sdkmanager')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/sdkmanager.py", line 1180, in main
method(args.packages)
File "/usr/lib/python3/dist-packages/sdkmanager.py", line 991, in install
android_home = get_android_home()
^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/sdkmanager.py", line 541, in get_android_home
android_home.mkdir(exist_ok=True)
File "/usr/lib/python3.11/pathlib.py", line 1117, in mkdir
os.mkdir(self, mode)
PermissionError: [Errno 13] Permission denied: '/opt/android-sdk'
sudo sdkmanager
Downloading https://f-droid.github.io/android-sdk-transparency-log/signed/checksums.json.asc into /root/.cache/sdkmanager/checksums.json.asc
Downloading https://f-droid.github.io/android-sdk-transparency-log/signed/checksums.json into /root/.cache/sdkmanager/checksums.json
Then {,sudo }sdkmanager
do not return anything.
apt show sdkmanager
Package: sdkmanager
Version: 0.6.4-1
Priority: optional
Section: devel
Maintainer: Hans-Christoph Steiner <hans@eds.org>
Installed-Size: 100 kB
Depends: python3-requests, python3:any
Recommends: python3-argcomplete
Homepage: https://f-droid.org
Download-Size: 33.2 kB
APT-Manual-Installed: yes
APT-Sources: http://deb.debian.org/debian bookworm/main amd64 Packages
Description: Package manager for Android SDK packages
A drop-in replacement for sdkmanager from the Android SDK written in
Python. It implements the exact API of the sdkmanager
(https://developer.android.com/studio/command-line/sdkmanager)
command line. It only deviates from that API if it can be done while
being 100% compatible.
.
The project also attempts to maintain the same terminal output so it
can be compatible with things that scrape sdkmanager output.
sudo apt install adb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
adb is already the newest version (1:29.0.6-28).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
https://developer.android.com/tools/releases/platform-tools
wget 'https://dl.google.com/android/repository/platform-tools-latest-linux.zip'
--2024-08-15 03:41:31-- https://dl.google.com/android/repository/platform-tools-latest-linux.zip
Resolving dl.google.com (dl.google.com)... 2a00:1450:4007:819::200e, 142.250.178.142
Connecting to dl.google.com (dl.google.com)|2a00:1450:4007:819::200e|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7472902 (7.1M) [application/zip]
Saving to: ‘platform-tools-latest-linux.zip’
platform-tools-latest-linu 100%[======================================>] 7.13M 34.7MB/s in 0.2s
2024-08-15 03:41:31 (34.7 MB/s) - ‘platform-tools-latest-linux.zip’ saved [7472902/7472902]
unzip platform-tools-latest-linux.zip
Archive: platform-tools-latest-linux.zip
inflating: platform-tools/NOTICE.txt
inflating: platform-tools/adb
inflating: platform-tools/etc1tool
inflating: platform-tools/fastboot
inflating: platform-tools/hprof-conv
inflating: platform-tools/make_f2fs
inflating: platform-tools/make_f2fs_casefold
inflating: platform-tools/mke2fs
inflating: platform-tools/mke2fs.conf
extracting: platform-tools/source.properties
inflating: platform-tools/sqlite3
inflating: platform-tools/lib64/libc++.so
rm platform-tools-latest-linux.zip
./platform-tools/adb --version
Android Debug Bridge version 1.0.41
Version 35.0.2-12147458
Installed as /media/benjamin_loison/6a7096c1-4c43-4ce6-8b84-56baa29f35fb/platform-tools/adb
Running on Linux 6.1.0-23-amd64 (x86_64)
./platform-tools/adb push sda11 /dev/block/sda11
adb: error: 65544-byte write failed: Success
./platform-tools/adb help
file transfer:
push [--sync] [-z ALGORITHM] [-Z] LOCAL... REMOTE
copy local files/directories to device
-n: dry run: push files to device without storing to the filesystem
-q: suppress progress messages
-Z: disable compression
-z: enable compression with a specified algorithm (any/none/brotli/lz4/zstd)
--sync: only push files that have different timestamps on the host than the device
pull [-a] [-z ALGORITHM] [-Z] REMOTE... LOCAL
copy files/dirs from device
-a: preserve file timestamp and mode
-q: suppress progress messages
-Z: disable compression
-z: enable compression with a specified algorithm (any/none/brotli/lz4/zstd)
sync [-l] [-z ALGORITHM] [-Z] [all|data|odm|oem|product|system|system_ext|vendor]
sync a local build from $ANDROID_PRODUCT_OUT to the device (default all)
-l: list files that would be copied, but don't copy them
-n: dry run: push files to device without storing to the filesystem
-q: suppress progress messages
-Z: disable compression
-z: enable compression with a specified algorithm (any/none/brotli/lz4/zstd)
Maybe should use sync
.
"adb: error: 65544-byte write failed: Success"
on DuckDuckGo and Google only return:
You're going to wipe out the serial number, IMEI, MAC addresses of the 2nd phone. There's no way to restore that. Also, since userdata on the 2nd device is using different decryption keys it won't be able to decrypt the data from the 1st device. That will leave you with the whole /data directory being garbage. It won't be able to boot until you wipe the data.
Should maybe investigate the Stack Exchange contribution I found my command to pull it may give details about pushing:
So Disks does not seem to help contrarily to what stated in the Stack Overflow answer 41397418.
adb shell cat /proc/partitions
major minor #blocks name
1 0 8192 ram0
1 1 8192 ram1
1 2 8192 ram2
1 3 8192 ram3
1 4 8192 ram4
1 5 8192 ram5
1 6 8192 ram6
1 7 8192 ram7
1 8 8192 ram8
1 9 8192 ram9
1 10 8192 ram10
1 11 8192 ram11
1 12 8192 ram12
1 13 8192 ram13
1 14 8192 ram14
1 15 8192 ram15
8 16 8192 sdb
8 17 3584 sdb1
8 18 128 sdb2
8 32 8192 sdc
8 33 3584 sdc1
8 34 128 sdc2
8 48 131072 sdd
8 49 104 sdd1
8 50 128 sdd2
8 51 1024 sdd3
8 64 1703936 sde
8 65 104 sde1
8 66 512 sde2
8 67 4096 sde3
8 68 32 sde4
8 69 512 sde5
8 70 199680 sde6
8 71 2048 sde7
8 72 4096 sde8
8 73 32768 sde9
8 74 1024 sde10
8 75 65536 sde11
8 76 512 sde12
8 77 98304 sde13
8 78 128 sde14
8 79 80 sde15
259 0 98304 sde16
259 1 64 sde17
259 2 64 sde18
259 3 24576 sde19
259 4 2048 sde20
259 5 2048 sde21
259 6 174080 sde22
259 7 128 sde23
259 8 2560 sde24
259 9 16384 sde25
259 10 512 sde26
259 11 4096 sde27
259 12 32 sde28
259 13 512 sde29
259 14 199680 sde30
259 15 2048 sde31
259 16 4096 sde32
259 17 32768 sde33
259 18 1024 sde34
259 19 65536 sde35
259 20 512 sde36
259 21 98304 sde37
259 22 128 sde38
259 23 80 sde39
259 24 98304 sde40
259 25 64 sde41
259 26 64 sde42
259 27 24576 sde43
259 28 128 sde44
259 29 2048 sde45
259 30 2048 sde46
259 31 174080 sde47
259 32 2560 sde48
259 33 4 sde49
259 34 1024 sde50
259 35 256 sde51
259 36 8192 sde52
259 37 33424 sde53
259 38 4 sde54
259 39 4 sde55
259 40 1024 sde56
259 41 8192 sde57
259 42 2048 sde58
259 43 65536 sde59
259 44 128 sde60
259 45 512 sde61
259 46 28 sde62
259 47 512 sde63
259 48 1024 sde64
259 49 4096 sde65
259 50 128 sde66
8 80 131072 sdf
8 81 104 sdf1
8 82 1024 sdf2
8 83 128 sdf3
8 84 128 sdf4
8 85 2560 sdf5
8 86 128 sdf6
8 87 6144 sdf7
8 88 6144 sdf8
8 89 6144 sdf9
8 96 12288 sdg
8 0 247918592 sda
8 1 96 sda1
8 2 8 sda2
8 3 32768 sda3
8 4 1024 sda4
8 5 512 sda5
8 6 512 sda6
8 7 30592 sda7
8 8 204800 sda8
8 9 8598324 sda9
8 10 6291456 sda10
8 11 232758456 sda11
So in theory could maybe more work with sda
than sda11
.
So the initial pull Stack Overflow contributions do not help me much.
https://xdaforums.com/t/guide-how-to-make-a-nandroid-backup-directly-to-your-computer-without-using-sdcard.1818321/ original post does not mention how to restore.
adb wireless does not seem possible in my case as the phone is not connected to a wifi at this stage, source: the Stack Overflow question 42411473.
"adb push" "15 minutes"
brings many unrelevant results on DuckDuckGo and Google.
What about writing part by part? Being able to track where it stopped and continue would maybe solve the issue. Can verify afterwards with diff. Can keep track of where we restarted to maybe be less precise if diff raises an issue near such locations. However, adb push
does not seem to support range writing, so should find an alternative and maybe the alternative on its own solve the issue without range writing. I have in mind dd
.
echo test | adb shell echo
does not return anything, so it is unclear how to give commands within adb access somehow to my backup.
adb shell ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope: Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:0
A dirty approach could be to write at the beginning everything we are able to, then from adb move this beginning data to the appropriate location.
Should first verify that not complete adb push
actually push some data, hence is not atomic.
I doubt having to do so, there must be alternatives to adb push, potentially relying on wifi/ethernet (tethering). Note that Pegasus does not have wifi capabilities.
Could maybe leverage the answers to the Stack Overflow question 8708886.
alternatives to adb push DuckDuckGo and Google first page of results do not seem interesting.
Trying to pass stdin
to adb
with the Stack Overflow answer 16028414:
adb shell nc --version
toybox 0.8.10-android
adb shell nc --help
Toybox 0.8.10-android multicall binary (see toybox --help)
usage: netcat [-46ELlntUu] [-pqWw #] [-s addr] {IPADDR PORTNUM|-f FILENAME|COMMAND...}
Forward stdin/stdout to a file or network connection.
-4 Force IPv4
-6 Force IPv6
-E Forward stderr
-f Use FILENAME (ala /dev/ttyS0) instead of network
-L Listen and background each incoming connection (server mode)
-l Listen for one incoming connection, then exit
-n No DNS lookup
-p Local port number
-q Quit SECONDS after EOF on stdin, even if stdout hasn't closed yet
-s Local source address
-t Allocate tty
-v Verbose
-u Use UDP
-U Use a UNIX domain socket
-W SECONDS timeout for more data on an idle connection
-w SECONDS timeout to establish connection
-z zero-I/O mode [used for scanning]
When listening the COMMAND line is executed as a child process to handle
an incoming connection. With no COMMAND -l forwards the connection
to stdin/stdout. If no -p specified, -l prints the port it bound to and
backgrounds itself (returning immediately).
For a quick-and-dirty server, try something like:
netcat -s 127.0.0.1 -p 1234 -tL sh -l
Or use "stty 115200 -F /dev/ttyS0 && stty raw -echo -ctlecho" with
netcat -f to connect to a serial port.
nc -h
OpenBSD netcat (Debian patchlevel 1.219-1)
usage: nc [-46CDdFhklNnrStUuvZz] [-I length] [-i interval] [-M ttl]
[-m minttl] [-O length] [-P proxy_username] [-p source_port]
[-q seconds] [-s sourceaddr] [-T keyword] [-V rtable] [-W recvlimit]
[-w timeout] [-X proxy_protocol] [-x proxy_address[:port]]
[destination] [port]
Command Summary:
-4 Use IPv4
-6 Use IPv6
-b Allow broadcast
-C Send CRLF as line-ending
-D Enable the debug socket option
-d Detach from stdin
-F Pass socket fd
-h This help text
-I length TCP receive buffer length
-i interval Delay interval for lines sent, ports scanned
-k Keep inbound sockets open for multiple connects
-l Listen mode, for inbound connects
-M ttl Outgoing TTL / Hop Limit
-m minttl Minimum incoming TTL / Hop Limit
-N Shutdown the network socket after EOF on stdin
-n Suppress name/port resolutions
-O length TCP send buffer length
-P proxyuser Username for proxy authentication
-p port Specify local port for remote connects
-q secs quit after EOF on stdin and delay of secs
-r Randomize remote ports
-S Enable the TCP MD5 signature option
-s sourceaddr Local source address
-T keyword TOS value
-t Answer TELNET negotiation
-U Use UNIX domain socket
-u UDP mode
-V rtable Specify alternate routing table
-v Verbose
-W recvlimit Terminate after receiving a number of packets
-w timeout Timeout for connects and final net reads
-X proto Proxy protocol: "4", "5" (SOCKS) or "connect"
-x addr[:port] Specify proxy address and port
-Z DCCP mode
-z Zero-I/O mode [used for scanning]
Port numbers can be individual or ranges: lo-hi [inclusive]
In adb:
pv
/system/bin/sh: pv: inaccessible or not found
time nc -lp 5555 > /dev/block/sda11
266m48.82s real 1m03.94s user 49m10.98s system
Had to manually interrupt when woke up. Firstly interrupt the reception over the emission seems more meaningful to avoid writing to the destination file a connection error, even if I believe that it would not happen. Is 2:51:48 and 22.0MiB/s evolving once done? As it is unclear when it is finished with a GiB precision.
adb forward tcp:4444 tcp:5555
cat sda11 | pv -s 256G | nc localhost 4444; matrix-commander-rs -m 'nc finished!'
221GiB 2:51:48 [22.0MiB/s] [============================================================================================================================================> ] 86%
By the way if the disk is a bit larger than 256 GB it may stop, so should state 256 GB but verify that it exceeds if necessary.
I was about to state that this process is slower but as compare a whole copy and partial one it does not seem to be a fair comparison.
adb shell cat /dev/block/sda11 | pv -s 256G | diff sda11 -; echo $?; matrix-commander-rs -m 'diff finished!'
221GiB 1:37:03 [39.0MiB/s] [============================================================================================================================================> ] 86%
0
Maybe paying attention to disable Internet access can avoid Signal and WhatsApp issues but let us try anyway as I have backups.
My phone has been restored to the state I had saved (I no longer have a file after_dd
in Termux, a folder after_dd
in Files, a Proton VPN application installed and a message on my lock screen ending with after_dd
, dd
being the name of the tool for bit-to-bit backup). Fingerprint, password and SIM code, GSM (call and SMS), Signal, WhatsApp and Element seem to work correctly from my phone.
Note that if perform regularly such huge backups it may reduce the lifespan of the storage, hence the phone motherboard and notice that it is not sold as such, see https://shop.fairphone.com/fr/shop/category/spare-parts-4?category=4&filters=33.
I have just updated my phone with the weekly LineageOS update and will try again to restore my phone and check this restoration before testing it, this should make my phone not usable for about 6 hours. So I will know that even after several weeks (and so update my phone) restore a bit-to-bit backup as I do always works. As far as my phone is concerned, this is the last test I have in mind.
date && getprop ro.modversion
Thu Aug 15 12:03:59 CEST 2024
21.0-20240807-NIGHTLY-FP4
date && getprop ro.modversion
Thu Aug 15 12:10:46 CEST 2024
21.0-20240814-NIGHTLY-FP4
time nc -lp 5555 > /dev/block/sda11
^C 112m56.78s real 0m34.46s user 11m52.85s system
adb forward tcp:4444 tcp:5555
cat sda11 | pv -s 256G | nc localhost 4444; matrix-commander-rs -m 'nc finished!'
Not notified as have to interrupt both above commands, it seems that interrupting one end stops the other one. So how to stop when no more data is coming up?
Lost output because I Maximized a Restored window, see Benjamin_Loison/pv/issues/1.
adb shell cat /dev/block/sda11 | pv -s 256G | diff sda11 -; echo $?; matrix-commander-rs -m 'diff finished!'
221GiB 1:36:36 [39.2MiB/s] [================================================> ] 86%
0
So it seems that the partition I used is only user data related as I have the same state as previous restoration but already have the update (I verified that are missing after_dd
in Termux, Files and lock screen text and Proton VPN). Should investigate other partitions on a new update. Can set myself a reminder based on web-scraping or similar. Somehow this maybe used to restore a phone without having to redo the updates, however for whole OS backup it does not seem fine.
date && getprop ro.modversion
Thu Aug 15 16:41:41 CEST 2024
21.0-20240814-NIGHTLY-FP4
adb shell ls -l /dev/block/bootdevice/by-name/
total 0
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 ALIGN_TO_128K_1 -> /dev/block/sdd1
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 ALIGN_TO_128K_2 -> /dev/block/sdf1
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 ALIGN_TO_128K_3 -> /dev/block/sda1
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 ALIGN_TO_128K_4 -> /dev/block/sde1
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 abl_a -> /dev/block/sde10
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 abl_b -> /dev/block/sde34
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 aop_a -> /dev/block/sde2
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 aop_b -> /dev/block/sde26
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 apdp -> /dev/block/sde51
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 bluetooth_a -> /dev/block/sde7
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 bluetooth_b -> /dev/block/sde31
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 boot_a -> /dev/block/sde13
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 boot_b -> /dev/block/sde37
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 catecontentfv -> /dev/block/sde64
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 catefv -> /dev/block/sde63
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 cateloader -> /dev/block/sde58
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 cdt -> /dev/block/sdd2
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 core_nhlos_a -> /dev/block/sde22
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 core_nhlos_b -> /dev/block/sde47
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 ddr -> /dev/block/sdd3
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 devcfg_a -> /dev/block/sde14
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 devcfg_b -> /dev/block/sde38
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 devinfo -> /dev/block/sde49
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 dip -> /dev/block/sde50
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 dsp_a -> /dev/block/sde11
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 dsp_b -> /dev/block/sde35
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 dtbo_a -> /dev/block/sde19
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 dtbo_b -> /dev/block/sde43
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 featenabler_a -> /dev/block/sde23
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 featenabler_b -> /dev/block/sde44
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 fpconfig -> /dev/block/sdf4
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 fpconfig_persist -> /dev/block/sdf3
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 frp -> /dev/block/sda6
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 fsc -> /dev/block/sdf6
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 fsg -> /dev/block/sdf5
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 fsgbk_a -> /dev/block/sde24
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 fsgbk_b -> /dev/block/sde48
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 hyp_a -> /dev/block/sde5
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 hyp_b -> /dev/block/sde29
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 imagefv_a -> /dev/block/sde20
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 imagefv_b -> /dev/block/sde45
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 keymaster_a -> /dev/block/sde12
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 keymaster_b -> /dev/block/sde36
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 keystore -> /dev/block/sda5
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 limits -> /dev/block/sde54
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 limits-cdsp -> /dev/block/sde55
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 logdump -> /dev/block/sde59
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 logfs -> /dev/block/sde57
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 mdtp_a -> /dev/block/sde9
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 mdtp_b -> /dev/block/sde33
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 mdtpsecapp_a -> /dev/block/sde8
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 mdtpsecapp_b -> /dev/block/sde32
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 metadata -> /dev/block/sda7
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 misc -> /dev/block/sda4
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 modem_a -> /dev/block/sde6
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 modem_b -> /dev/block/sde30
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 modemst1 -> /dev/block/sdf8
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 modemst2 -> /dev/block/sdf9
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 multiimgoem_a -> /dev/block/sde4
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 multiimgoem_b -> /dev/block/sde28
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 oembin -> /dev/block/sde65
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 oempersist -> /dev/block/sda8
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 persist -> /dev/block/sda3
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 questdatafv -> /dev/block/sde25
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 qupfw_a -> /dev/block/sde15
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 qupfw_b -> /dev/block/sde39
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 rawdump -> /dev/block/sda9
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 recovery_a -> /dev/block/sde16
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 recovery_b -> /dev/block/sde40
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 secdata -> /dev/block/sde62
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 splash -> /dev/block/sde53
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 spunvm -> /dev/block/sde52
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 ssd -> /dev/block/sda2
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 storsec -> /dev/block/sde60
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 super -> /dev/block/sda10
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 swversion -> /dev/block/sde66
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 toolsfv -> /dev/block/sde56
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 traceability -> /dev/block/sdf2
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 tunning -> /dev/block/sdf7
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 tz_a -> /dev/block/sde3
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 tz_b -> /dev/block/sde27
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 uefisecapp_a -> /dev/block/sde21
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 uefisecapp_b -> /dev/block/sde46
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 uefivarstore -> /dev/block/sde61
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 userdata -> /dev/block/sda11
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 vbmeta_a -> /dev/block/sde18
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 vbmeta_b -> /dev/block/sde42
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 vbmeta_system_a -> /dev/block/sde17
lrwxrwxrwx 1 root root 16 1970-12-24 14:05 vbmeta_system_b -> /dev/block/sde41
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 xbl_a -> /dev/block/sdb1
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 xbl_b -> /dev/block/sdc1
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 xbl_config_a -> /dev/block/sdb2
lrwxrwxrwx 1 root root 15 1970-12-24 14:05 xbl_config_b -> /dev/block/sdc2
adb shell ls -l /dev/block/bootdevice/by-name/ | wc -l
94
adb shell ls -l /dev/block/bootdevice/by-name/ | grep ' -> /dev/block/' | wc -l
93
adb shell ls -l /dev/block/bootdevice/by-name/ | grep -E ' -> /dev/block/sd(a|b|c|d|e|f)' | wc -l
93
adb shell ls -l /dev/block/bootdevice/by-name/ | grep -E ' -> /dev/block/sd[a-f]' | wc -l
93
So maybe just writing each /dev/block/sd[a-f]
or /dev/block/
in general may achieve my goal. Let us wait the update to proceed to such backup to not lose much data.
I added to OverClock3000 /home/benjamin/notifyOnWebpageChange.py
:
{
'url': 'https://download.lineageos.org/api/v2/devices/FP4/builds',
'message': 'Make a wider backup than previously and try leveraging it to restore previous to update state (notably from the OS update point of view), see [Benjamin-Loison/android/issues/46#issuecomment-2282294748](https://github.com/Benjamin-Loison/android/issues/46#issuecomment-2282294748)',
},
According to above:
adb shell cat /proc/partitions
instead of ̀sda11
(232758456 blocks) should focus on sda
(247918592 blocks), then also sde
(1703936 blocks), then also sdd
and sdf
(131072 blocks each) but I doubt that in the latter the system fits. Maybe other partitions are also useful as metadata. However, maybe should not alterate ramN
. The question is if backup sda
, are we able to just extract sda11
? Linux tools to list partitions may help.
According to Benjamin-Loison/android/issues/77, the system size is about 26 GB, 256 - 232 = 24 but I am a bit doubtful of this calculus.
Maybe will investigate further before an update in the context of #25.
If I solve this issue, I should report my solution in the links I mentioned.
An interesting thing to try is to restore bit to bit backup after upgrading OS or installing a new OS to see if it works fine. The former in addition to bring safety itself, would be promising for the latter, see #25.
adb shell cat /dev/block/sda | pv -s 256G > sda; matrix-commander-rs -m 'adb copy finished!'
236GiB 1:44:31 [38.6MiB/s] [==========================> ] 92%
ls -l sda
-rw-r--r-- 1 benjamin_loison benjamin_loison 253868638208 Aug 22 01:23 sda
adb shell cat /dev/block/sda | pv -s 256G | diff sda -; echo $?; matrix-commander-rs -m 'diff finished!'
Disks, df -h ./sda
and sudo fdisk -l ./sda
do not seem interesting to export sda11
. Could may get its precise offset, try to extract it and compare it with the actual value on the phone.
DuckDuckGo and Google results for Linux list partitions in iso were quickly not looking promising.
adb shell cat /sys/block/sda/sda11/start
30320232
adb shell cat /sys/block/sda/sda11/end
cat: /sys/block/sda/sda11/end: No such file or directory
adb shell cat /sys/block/sda/sda11/size
465516912
Source: the Stack Overflow answer 2625876
dd --help
Usage: dd [OPERAND]...
or: dd OPTION
Copy a file, converting and formatting according to the operands.
bs=BYTES read and write up to BYTES bytes at a time (default: 512);
overrides ibs and obs
cbs=BYTES convert BYTES bytes at a time
conv=CONVS convert the file as per the comma separated symbol list
count=N copy only N input blocks
ibs=BYTES read up to BYTES bytes at a time (default: 512)
if=FILE read from FILE instead of stdin
iflag=FLAGS read as per the comma separated symbol list
obs=BYTES write BYTES bytes at a time (default: 512)
of=FILE write to FILE instead of stdout
oflag=FLAGS write as per the comma separated symbol list
seek=N (or oseek=N) skip N obs-sized output blocks
skip=N (or iseek=N) skip N ibs-sized input blocks
status=LEVEL The LEVEL of information to print to stderr;
'none' suppresses everything but error messages,
'noxfer' suppresses the final transfer statistics,
'progress' shows periodic transfer statistics
N and BYTES may be followed by the following multiplicative suffixes:
c=1, w=2, b=512, kB=1000, K=1024, MB=1000*1000, M=1024*1024, xM=M,
GB=1000*1000*1000, G=1024*1024*1024, and so on for T, P, E, Z, Y, R, Q.
Binary prefixes can be used, too: KiB=K, MiB=M, and so on.
If N ends in 'B', it counts bytes not blocks.
Each CONV symbol may be:
ascii from EBCDIC to ASCII
ebcdic from ASCII to EBCDIC
ibm from ASCII to alternate EBCDIC
block pad newline-terminated records with spaces to cbs-size
unblock replace trailing spaces in cbs-size records with newline
lcase change upper case to lower case
ucase change lower case to upper case
sparse try to seek rather than write all-NUL output blocks
swab swap every pair of input bytes
sync pad every input block with NULs to ibs-size; when used
with block or unblock, pad with spaces rather than NULs
excl fail if the output file already exists
nocreat do not create the output file
notrunc do not truncate the output file
noerror continue after read errors
fdatasync physically write output file data before finishing
fsync likewise, but also write metadata
Each FLAG symbol may be:
append append mode (makes sense only for output; conv=notrunc suggested)
direct use direct I/O for data
directory fail unless a directory
dsync use synchronized I/O for data
sync likewise, but also for metadata
fullblock accumulate full blocks of input (iflag only)
nonblock use non-blocking I/O
noatime do not update access time
nocache Request to drop cache. See also oflag=sync
noctty do not assign controlling terminal from file
nofollow do not follow symlinks
Sending a USR1 signal to a running 'dd' process makes it
print I/O statistics to standard error and then resume copying.
Options are:
--help display this help and exit
--version output version information and exit
GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Full documentation <https://www.gnu.org/software/coreutils/dd>
or available locally via: info '(coreutils) dd invocation'
Searching DuckDuckGo and Google for Linux get start and end location of partition.
adb shell cat /dev/block/sda | pv -s 256G | diff sda -; echo $?; matrix-commander-rs -m 'diff finished!'
236GiB 1:43:51 [38.9MiB/s] [==========================> ] 92%
0
Let us try to reboot to recovery using Power off and test again.
time adb shell cat /dev/block/sda | pv -s 256G | diff sda -; echo $?; matrix-commander-rs -m 'diff finished!'
Binary files sda and - differ
196KiB 0:00:00 [5.48MiB/s] [> ] 0%
While previously when focused on sda11
this test results in identical state. I was thinking about an alternative about being able to extract sda11
by just saving sda
again but just rebooting to recovery changes it so it seems a bit dangerous.
I would say that blocks of /proc/partitions
are about 1,000 bytes or 1,024 bytes. Note that /proc/partitions
also exists on Debian 12 GNOME Pegasus.
adb shell cat /proc/devices
Character devices:
1 mem
5 /dev/tty
5 /dev/console
5 /dev/ptmx
5 ttyprintk
10 misc
13 input
21 sg
81 video4linux
86 ch
89 i2c
108 ppp
116 alsa
128 ptm
136 pts
153 spi
180 usb
189 usb_device
212 DVB
226 drm
234 qseecom
235 msm_hdcp
236 kgsl
237 diag
238 ttyHS
239 glinkpkt
240 smcinvoke
241 subsys
242 ramdump
243 iio
244 ipa_odl_ctl
245 ipa_adpl
246 ipa
247 ptp
248 pps
249 media
250 rtc
251 msm_sps
252 dcc_sram
253 rpmsg
254 gpiochip
256 msm_rng
498 adsprpc-smd
499 6002000.stm
500 byte-cntr
501 qg
502 qg_battery
503 OISCDEV
504 binder
505 rpmb
506 bt
507 msm_npu
508 gsi_usb
509 uio
510 qce
511 fpsensor
Block devices:
1 ramdisk
7 loop
8 sd
65 sd
66 sd
67 sd
68 sd
69 sd
70 sd
71 sd
128 sd
129 sd
130 sd
131 sd
132 sd
133 sd
134 sd
135 sd
179 mmc
253 device-mapper
254 zram
DuckDuckGo and Google results for Linux get physical disk block size are quite unclear.
Searching "/proc/partitions" "dd"
.
https://linux-training.be/storage/ch06.html#idp53611328 does not help.
If do not verify that able to extract sda11
will not be able to verify it afterwards.
https://doc.ubuntu-fr.org/dd?rev=1718787652#partitions_et_tailles_en_ko:
dd if=/proc/partitions | hexdump -C
1+1 records in
1+1 records out
525 bytes copied, 0.000122966 s, 4.3 MB/s
00000000 6d 61 6a 6f 72 20 6d 69 6e 6f 72 20 20 23 62 6c |major minor #bl|
00000010 6f 63 6b 73 20 20 6e 61 6d 65 0a 0a 20 32 35 39 |ocks name.. 259|
00000020 20 20 20 20 20 20 20 20 30 20 20 37 38 31 34 31 | 0 78141|
00000030 32 31 38 34 20 6e 76 6d 65 30 6e 31 0a 20 32 35 |2184 nvme0n1. 25|
00000040 39 20 20 20 20 20 20 20 20 31 20 20 20 20 20 34 |9 1 4|
00000050 39 38 36 38 38 20 6e 76 6d 65 30 6e 31 70 31 0a |98688 nvme0n1p1.|
00000060 20 32 35 39 20 20 20 20 20 20 20 20 32 20 20 20 | 259 2 |
00000070 20 20 20 20 20 20 20 31 20 6e 76 6d 65 30 6e 31 | 1 nvme0n1|
00000080 70 32 0a 20 32 35 39 20 20 20 20 20 20 20 20 33 |p2. 259 3|
00000090 20 20 37 38 30 39 31 30 35 39 32 20 6e 76 6d 65 | 780910592 nvme|
000000a0 30 6e 31 70 35 0a 20 20 20 38 20 20 20 20 20 20 |0n1p5. 8 |
000000b0 20 20 30 20 20 39 37 36 37 36 32 35 38 34 20 73 | 0 976762584 s|
000000c0 64 61 0a 20 20 20 38 20 20 20 20 20 20 20 20 31 |da. 8 1|
000000d0 20 20 20 20 20 35 32 34 32 38 38 20 73 64 61 31 | 524288 sda1|
000000e0 0a 20 20 20 38 20 20 20 20 20 20 20 20 32 20 20 |. 8 2 |
000000f0 39 37 35 32 33 36 30 39 36 20 73 64 61 32 0a 20 |975236096 sda2. |
00000100 20 20 38 20 20 20 20 20 20 20 20 33 20 20 20 20 | 8 3 |
00000110 31 30 30 30 34 34 38 20 73 64 61 33 0a 20 20 20 |1000448 sda3. |
00000120 38 20 20 20 20 20 20 20 31 36 20 20 32 35 30 30 |8 16 2500|
00000130 35 39 30 39 36 20 73 64 62 0a 20 20 20 38 20 20 |59096 sdb. 8 |
00000140 20 20 20 20 20 31 37 20 20 32 34 34 31 34 30 30 | 17 2441400|
00000150 33 32 20 73 64 62 31 0a 20 20 20 38 20 20 20 20 |32 sdb1. 8 |
00000160 20 20 20 31 38 20 20 20 20 20 20 20 20 20 20 31 | 18 1|
00000170 20 73 64 62 32 0a 20 20 20 38 20 20 20 20 20 20 | sdb2. 8 |
00000180 20 32 31 20 20 20 20 35 39 31 36 36 37 32 20 73 | 21 5916672 s|
00000190 64 62 35 0a 20 32 35 33 20 20 20 20 20 20 20 20 |db5. 253 |
000001a0 30 20 20 37 38 30 38 39 34 32 30 38 20 64 6d 2d |0 780894208 dm-|
000001b0 30 0a 20 32 35 33 20 20 20 20 20 20 20 20 31 20 |0. 253 1 |
000001c0 20 37 37 39 38 35 37 39 32 30 20 64 6d 2d 31 0a | 779857920 dm-1.|
000001d0 20 32 35 33 20 20 20 20 20 20 20 20 32 20 20 20 | 253 2 |
000001e0 20 20 39 39 39 34 32 34 20 64 6d 2d 32 0a 20 20 | 999424 dm-2. |
000001f0 20 37 20 20 20 20 20 20 20 20 30 20 20 32 34 37 | 7 0 247|
00000200 39 31 38 35 39 32 20 6c 6f 6f 70 30 0a |918592 loop0.|
0000020d
is unclear.
Without being sure can assume a value like the Unix Stack Exchange answer 512959.
man proc
...
/proc/partitions
Contains the major and minor numbers of each partition as well
as the number of 1024-byte blocks and the partition name.
...
https://askubuntu.com/a/229450 and the other answers not mention the following error.
adb shell diff <(dd if=/dev/block/sda11 | pv -s 256G) <(dd if=/dev/block/sda11 | pv -s 256G); echo $?
dd: failed to open '/dev/block/sda11': No such file or directory
dd: failed to open '/dev/block/sda11': No such file or directory
diff: Can't stat /dev/fd/63: No such file or directory
2
adb shell 'diff <(dd if=/dev/block/sda11 | pv -s 256G) <(dd if=/dev/block/sda11 | pv -s 256G); echo $?'
/system/bin/sh: syntax error: unexpected '('
adb shell "diff <(dd if=/dev/block/sda11 | pv -s 256G) <(dd if=/dev/block/sda11 | pv -s 256G); echo $?"
/system/bin/sh: syntax error: unexpected '('
adb shell echo $0
bash
adb shell bash
/system/bin/sh: bash: inaccessible or not found
adb shell sh -h
^C
adb shell sh --help
sh: sh: --: unknown option
adb shell sh --version
sh: sh: --: unknown option
adb shell sh -v
^C
diff <(adb shell cat /dev/block/sda11 | pv -s 256G) <(adb shell cat /dev/block/sda11 | pv -s 256G); echo $?
diff <(adb shell cat /dev/block/sda11 | pv -N 'Source 1' -s 256G) <(adb shell cat /dev/block/sda11 | pv -N 'Source 2' -s 256G); echo $?
diff <(adb shell cat /dev/block/sda11 | pv -N 'Source 1' -s 256G 2> source_1_stderr.txt) <(adb shell cat /dev/block/sda11 | pv -N 'Source 2' -s 256G 2> source_2_stderr.txt); echo $?
does not populate source_{1,2}_stderr.txt
.
adb shell cat /dev/block/sda11 | pv -s 256G > sda11; matrix-commander-rs -m 'adb copy finished!'
alternatively otherwise do not have progress.
adb shell dd if=/dev/block/sda11 | pv -s 256G | diff sda11 -; echo $?; matrix-commander-rs -m 'diff finished!'
465516912+0 records iniB/s] [============================================================================================================================================> ] 86% ETA 0:26:07
465516912+0 records out
238344658944 bytes (222 G) copied, 10220.358 s, 22 M/s
221GiB 2:50:24 [22.2MiB/s] [============================================================================================================================================> ] 86%
0
Related to Benjamin_Loison/bash/issues/6.
Searching "/sys/block/sda/sda" "/start" unit
does not seem to help to know /sys/block/sda/sda11/start
unit.
However, it should be guessable from:
adb shell cat /proc/partitions
major minor #blocks name
...
8 0 247918592 sda
8 1 96 sda1
8 2 8 sda2
8 3 32768 sda3
8 4 1024 sda4
8 5 512 sda5
8 6 512 sda6
8 7 30592 sda7
8 8 204800 sda8
8 9 8598324 sda9
8 10 6291456 sda10
8 11 232758456 sda11
247,918,592 (sda
) - 232,758,456 (sda11
) = 15,160,136 with unit being 1,024 bytes. While 247,918,592 is a multiple of 512, 232,758,456 is not.
If sda11
was equivalent to sda
above formula would be correct, there is no + 1 needed or similar it seems.
ibs-size being 512 bytes (so 15,160,136 * 2 = 30,320,272 with unit being 512 bytes) and as sda11
is the last part of sda
:
dd if=sda skip=30320272 | pv -s 256G | diff sda11 -; echo $?; matrix-commander -m 'diff finished!'
Binary files sda11 and - differ
4.00KiB 0:00:00 [2.81MiB/s] [> ] 0%
1
Could test all locations but in this case it seems that it would take too much time.
15160136
does not work too.
dd if=sda skip=30320232 | pv -s 256G | diff sda11 -; echo $?; matrix-commander-rs -m 'diff finished!'
Binary files sda11 and - differ==============================================> ] 86% ETA 0:03:12
465516952+0 records in
465516952+0 records out
238344679424 bytes (238 GB, 222 GiB) copied, 1251.53 s, 190 MB/s
221GiB 0:20:51 [ 181MiB/s] [================================================> ] 86%
1
Source: above
So identical on 221 GiB so seems quite good. The difference between ls -l sda11
and above is about 20,480 bytes so it seems quite good indeed.
date && getprop ro.modversion
Thu Aug 22 18:41:18 CEST 2024
21.0-20240814-NIGHTLY-FP4
date && getprop ro.modversion
Thu Aug 22 18:44:08 CEST 2024
21.0-20240821-NIGHTLY-FP4
In theory writing the whole system contrarily to user data can involve an Android version rollback (within or across versions) which is forbidden as far as I remember so it may brick the phone. However, here it is within the Android version so should be fine. Anyway how can the phone notices that it is a downgrade if I overwrite all its memory? Maybe here I do not overwrite all its memory if even all is accessible, may it is on an inaccessible register that only accepts being increment/set with increasing values. Maybe not a great idea to overwrite user data when have updated the phone as the system and user data are compatible for a given system version (maybe not even in this case).
time nc -lp 5555 > /dev/block/sda
^C 109m12.43s real 0m37.45s user 12m01.09s system
adb forward tcp:4444 tcp:5555
cat sda | pv -s 256G | nc localhost 4444; matrix-commander-rs -m 'nc finished!'
4444
236GiB 1:43:49 [38.9MiB/s] [===> ] 92%
adb shell dd if=/dev/block/sda | pv -s 256G | diff sda -; echo $?; matrix-commander-rs -m 'diff finished!'
495837184+0 records iniB/s] [==========> ] 92% ETA 0:09:09
495837184+0 records out
253868638208 bytes (236 G) copied, 6630.786 s, 37 M/s
236GiB 1:50:32 [36.5MiB/s] [==========> ] 92%
0
date && getprop ro.modversion
Thu Aug 22 23:10:01 CEST 2024
21.0-20240814-NIGHTLY-FP4
So 5G works fine but not wifi...
https://wiki.termux.com/wiki/Termux:API
termux-wifi-connectioninfo
{
"bssid": null,
"frequency_mhz": -1,
"ip": "0.0.0.0",
"link_speed_mbps": -1,
"mac_address": "02:00:00:00:00:00",
"network_id": -1,
"rssi": -127,
"ssid": "<unknown ssid>",
"ssid_hidden": false,
"supplicant_state": "UNINITIALIZED"
}
termux-wifi-enable -h
Usage: termux-wifi-enable [true | false]
Toggle Wi-Fi On/Off
termux-wifi-enable true
termux-wifi-scaninfo
[]
Recorder also stops when try recording. There is also no sound when playing a YouTube video.
Reboot does not help.
Making a backup of sda
after the update to try to overwrite it if things go wrong would have been a good idea. Maybe somehow the update updated drivers and the versions are incompatible, so updating again will solve the issue. I had the feeling that the update download was quite fast. Maybe because it was cached somewhere?
Updating solved the 3 mentioned issues.
Does restoring a previous update user-data have the same issues? Well as I was running the restored user-data state until this update so about a week, there was quite no issue at least for wifi and YouTube.
If from a BIOS like boot to the other I have an identical retrievable disk it may make sense to be confident enough to just copy it as a backup. So dd
once and then use diff
if possible.
So concerning my Fairphone 4 (System updates shows LineageOS 21 Android 14 August 7, 2024) to backup:
⋮
> Share all tabs, it considers correctly Inactive tabs (Termux seems to require to provide a correct file name or Copy to clipboard and then write a file with it seems the most appropriate). Firefox Sync feature with Mozilla account states that support Bookmarks, History, Open tabs, Passwords, Addresses, Payment methods, Add-ons (also their data? See Benjamin-Loison/uBlock-issues/issues/10 and Benjamin-Loison/darkreader/issues/13) and Settings.termux-sms-list -f
both +33 6 and 06 phone numbers without spaces return []
and with spaces respectively not matching SMS and none are returned. Related to Benjamin-Loison/termux-api/issues/21.adb shell cmd package list packages -3
Source: the Stack Overflow answer 53634311
I was thinking maybe should write down what store of applications installed what app but my rule is F-Droid and if not available then Aurora Store. The question is how to automate installing multiple apps on these store of applications?
Related to Benjamin_Loison/fdroidclient/issues/13 and Benjamin_Loison/AuroraStore/issues/24.
In fact backing up APKs would be interesting too for some edge cases such as Termux GitHub releases being far more up-to-date. SeedVault does so but redundancy would be nice.
SeedVault may help.
Now that proceeded once, automate this would be nice. Could also add later support for other apps (not bold ones).
alias fp4ssht='ssh -p 8022 fairphone-4-5g -t'
adb shell cmd package list packages -3 > apps.txt
fp4ssht termux-contact-list > termux-contact-list.json
fp4ssht termux-sms-list -l -1 > termux-sms-list.json
fp4ssht termux-call-log -l -1 > termux-call-log.json
# https://codeberg.org/Benjamin_Loison/android_packages_apps_Recorder/issues/{4,5}
# TODO: implement incremental snapshot
fp4ssht tar -zcf /sdcard/termux-backup.tar.gz -C /data/data/com.termux/files ./home ./usr
# TODO: https://adbshell.com/commands/adb-pull does not have a `--sync` like https://adbshell.com/commands/adb-push one which *only push files that are newer on the host than the Android device*
# adb pull -a /sdcard/termux-backup.tar.gz
# TODO: implement incremental snapshot
# Pay attention to be root to have all files?
adb pull -a /sdcard/
Also note that incremental snapshot in addition to being faster, can be interesting to easily keep old snapshots, such that even if the last snapshot does not work fine, the previous one should (except if the last one failed for the same reason).
Missing:
/sdcard/
and files and folders in /sdcard/Download/
Concerning automating SeedVault, see Benjamin_Loison/seedvault/issues/{15,9}.
So what SeedVault cannot backup automatically:
jq '.messages | length'
returns 2,783, https://matrix.to/#/!CfruMwPkkwKnJDNwsn:matrix.org/$ZLbHYgTRHpQhNr6BSG0SUH4ZjmyMaHzZqO5I4Zd2hMI (Mon Apr 25 12:34:34 PM CEST 2022)) and Benjamin Loison's bot (25,562, https://matrix.to/#/!sNARMdEsFZERaQAJzl:matrix.org/$EbJb9_frgG-BgXks97W3xid6nK27ZnmkyQ00F0qhCIw
(Thu Jan 26 04:40:16 PM CET 2023)) on both Fairphone 4 LineageOS and Linux Mint 22 Cinnamon Framework 13 while being offline to avoid any potential interactivity. Note that right now the test may be biased as I restored from SeedVault already but may be interesting anyway for the future. On Linux Mint 22 Cinnamon Framework 13 can use Export chat and get first message id and create a link to this message that the phone can try to access. Maybe Matrix.org save encrypted discussons, could keep Internet access on laptop and beforehands stop Internet access on phone. Can use qrencode -l H -t ansiutf8 'URL
to easily share an URL to the phone. Faced Benjamin-Loison/element-android/issues/31. As able to load first messages in plaintext (from direct links obtained with Export Chat) of both discussions on Linux Mint 22 Cinnamon Framework 13 with phone in airplane mode so it seems fine enough). https://www.reddit.com/r/elementchat/comments/1ciwkd6/does_element_store_chat_data/ https://ems-docs.element.io/books/element-cloud-documentation/page/frequently-asked-questions#bkmrk-can-encrypted-messag https://ems-docs.element.io/books/element-cloud-documentation/page/frequently-asked-questions#bkmrk-are-all-my-messages- The question is do Element by default store all complete discussions, even if have not read all messages and joined these discussions on the considered device after having joined the discussion on another device. Note that as I restored with SeedVault it seems that if something has to be lost, it already has been./sdcard/
and files and folders in /sdcard/Download/
Related to Benjamin-Loison/termux-api/issues/1.
get_first_message.py
:
#!/usr/bin/python3
import json
FILE_PATH = "matrix - Benjamin Loison's bot - Chat Export - 2024-08-30T17-09-31.447Z.json"
with open(FILE_PATH) as f:
data = json.load(f)
messages = data['messages']
for message in messages:
if message['type'] == 'm.room.message':
print(json.dumps(message, indent = 4))
break
Clean and precise verbosity can be considered afterwards if it is not satisfying.
Should test both
sda
)I think that I prefer ideally bit by bit restoration, so let us try with SeedVault.
So have to manually:
adb push termux-backup.tar.gz /sdcard/
termux-backup.tar.gz: 1 file pushed, 0...7 MB/s (23755000567 bytes in 917.924s)
No need for termux-setup-storage
, the Termux app permissions are correctly restored, hence file access.
tar -zxf /sdcard/termux-backup.tar.gz -C /data/data/com.termux/files --recursive-unlink --preserve-permissions; matrix-commander -m 'Untar finished!'
2024-08-28 00:35:45,535: ERROR: matrix-commander: E219: Error during sending. Continuing despite error. Exception: Cannot connect to host matrix.org:443 ssl:default [No address associated with hostname]
2024-08-28 00:35:45,536: INFO: matrix-commander: 1 error and 0 warnings occurred.
Source: https://wiki.termux.com/wiki/Backing_up_Termux
Termux is indeed not able to access the Internet after EXIT
:
ping 8.8.8.8
socket: Connection refused
Force stop and Open does not help. Maybe it is due to the fact that it is a most recent version of Termux, see Benjamin-Loison/termux-api/issues/18.
VERSION=0.118.1
FILE_NAME=termux-app_$VERSION+github-debug_arm64-v8a.apk
#wget https://github.com/termux/termux-app/releases/download/v$VERSION/$FILE_NAME
adb install $FILE_NAME
does not help. Note that it keeps the data.
Related to Improve_websites_thanks_to_open_source/issues/936.
Rebooting does not help, even after uninstalling Termux:API and Termux:Boot.
If uninstall Termux and re-install it from F-Droid, then ping
works fine.
https://github.com/termux/termux-app https://github.com/termux/termux-app/commit/c2d57f2ed810b6fa854a6c9ab0ecee4aac38a0cc https://github.com/termux/termux-app/actions/runs/10581503562/job/29318946780 https://github.com/termux/termux-app/actions/runs/10581503562/artifacts/1860474698
FILE_NAME=termux-app_v0.118.0+c2d57f2-apt-android-7-github-debug_arm64-v8a
unzip $FILE_NAME.zip
rm $FILE_NAME.zip output-metadata.json
adb uninstall com.termux
adb install $FILE_NAME.apk
rm $FILE_NAME.apk
Still have working ping
.
After data restore and EXIT
ping
still works and Matrix message is correctly sent according to Termux but on my Linux Mint 22 Cinnamon Framework 13 for instance I get Unable to decrypt message. If I remember correctly I already restored Termux previously to this factory reset and noticed the same Unable to decrypt message.
adb install termux-api_v0.50.1+c553bc2-github-debug.apk
Performing Streamed Install
Success
adb install termux-boot-app_v0.8.1+613dc98.github.debug.apk
Performing Streamed Install
Success
The priority is on backing up, notably automating it, restoration can be automated later on as it happens less than backing up.
For contacts:
The following contacts have additional fields than name and phone number (can also be an avatar):
-----BEGIN PGP MESSAGE-----
hF4DTQa9Wom5MBgSAQdA9QaPo5oq+XrIFavwPBVX7qPCeSLULEXqtl+s2KJFvCkw
7befFSOZaD2svMvIzsGQsspVpLw+crQBcL8DmSoFRVPPuUjDw5I1eUXYzzkGblpH
0ncBdHH+klm6onaSuLepB7SVxc1vIQT9izsy9/J+VvUv+h0oSglD/z5vUVxtw1JU
Oz7Z7Wax3olbPzoJUGg1WA8+L9fSd+FaEqdnOcnxmcKiYX7lc4pYKB9XqJ396GNb
4Q3J7QtPDchAdWa/E1X4AA9Yn3eAHITGGA==
=TN/y
-----END PGP MESSAGE-----
LineageOS/android_packages_apps_Dialer does not seem to have selection (and export) feature and Settings does not seem to help.
Concerning Fennec only the synchronized History is unclear. Concerning add-ons I have Dark Reader, SponsorBlock and uBlock. For uBlock:
So see Files.
For the History:
Firefox History, History > Search history and Manage history do not seem to help.
Firefox Account does not seem to help too.
Firefox view synchronized History on DuckDuckGo and Google returns only the following interesting results among the first pages of results.
https://www.reddit.com/r/firefox/comments/13yfelg/i_need_to_see_the_history_per_device/ https://superuser.com/q/1335450
https://forum.f-droid.org/t/fennec-is-it-necessary-to-opt-out-of-the-adb-backups/12112/12 is the only relevant result when search first page of results on DuckDuckGo and Google Fennec export whole history.
If Firefox history sync to phone, then maybe export phone one somehow. It does not seem to be the case.
Related to Benjamin_Loison/fennecbuild/issues/4.
Concerning Termux:
date && time du -sh ..
Sun Aug 11 01:27:37 CEST 2024
34G ..
real 0m37.755s
user 0m0.963s
sys 0m16.177s
termux-backup --help
So for getting a progress have to proceed manually.
tar -zcf /sdcard/termux-backup.tar.gz -C /data/data/com.termux/files ./home ./usr
tar: ./home/bens_folder/termux/temperature.txt: file changed as we read it
tar: ./home/.gnupg/S.keyboxd: socket ignored
tar: ./home/.gnupg/S.gpg-agent: socket ignored
tar: ./home/.gnupg/S.gpg-agent.extra: socket ignored
tar: ./home/.gnupg/S.gpg-agent.browser: socket ignored
tar: ./home/.gnupg/S.gpg-agent.ssh: socket ignored
tar: ./usr/var/run/cron.reboot: Cannot open: Permission denied
tar: Exiting with failure status due to previous errors
ls -lh /sdcard/termux-backup.tar.gz
-rw-rw---- 1 root everybody 22G Aug 11 02:04 /sdcard/termux-backup.tar.gz
progress
[32737] tar /data/data/com.termux/files/home/.cache/pip/http/8/e/2/d/2/8e2d264aa5c82974f5cce6c6f1ab4306ad5dc56121462699938f5afb
71.1% (2.1 MiB / 2.9 MiB)
[32738] gzip /storage/emulated/0/termux-backup.tar.gz
100.0% (597 MiB / 597 MiB)
Then see Files.
Being able to run from adb
would avoid having free space on the phone to keep this archive, see Improve_websites_thanks_to_open_source/issues/389. Maybe adb pull
is somehow able to do so without compression but have to pay attention to permissions etc.
In fact when treat Files it backups /data/data/com.termux/files/
the question is are permissions still fine? But I am fine fixing them if necessary to avoid having another Termux copy.
I finally have doubts that the Termux files are in /sdcard/
:
pwd
/data/data/com.termux/files/home
ls -lah /sdcard/Android/data/com.termux/files/total 7.0K
drwxrwx--- 2 u0_a298 everybody 3.5K Aug 31 2022 .
drwxrwx--- 3 u0_a298 everybody 3.5K Aug 31 2022 ..
adb shell ls -lh /
...
drwxrwx--x 54 system system 4.0K 2024-08-15 16:40 data
...
adb shell whoami
root
adb shell ls -lh /data
...
drwxrwx--x 251 system system 52K 2024-08-11 21:55 data
adb shell ls -lh /data/data/
...
drwx------ 6 u0_a145 u0_a145 3.3K 2023-03-03 21:21 com.termux
...
adb shell ls -lh /data/data/com.termux/
drwxrws--x 4 u0_a145 u0_a145_cache 3.3K 2024-02-18 00:37 cache
drwxrws--x 2 u0_a145 u0_a145_cache 3.3K 2023-03-03 21:21 code_cache
drwxrwx--x 4 u0_a145 u0_a145 3.3K 2023-08-12 01:07 files
drwxrwx--x 2 u0_a145 u0_a145 3.3K 2024-08-15 16:41 shared_prefs
adb shell ls -lh /data/data/com.termux/files/
total 7
drwx------ 21 u0_a145 u0_a145 8.0K 2024-08-16 22:29 home
drwx------ 13 u0_a145 u0_a145 3.3K 2023-11-23 01:22 usr
adb shell ls -lh /data/data/com.termux/files/home
total 6
drwx------ 15 u0_a145 u0_a145 3.3K 2024-08-07 19:35 bens_folder
drwx------ 2 u0_a145 u0_a145 3.3K 2024-03-15 09:01 downloads
-rw------- 1 u0_a145 u0_a145 0 2024-08-16 22:29 ggxkcie5
time adb shell find -name ggxkcie5 2> /dev/null
./data/data/com.termux/files/home/ggxkcie5
./data/user/0/com.termux/files/home/ggxkcie5
./data_mirror/data_ce/null/0/com.termux/files/home/ggxkcie5
real 2m21.701s
user 0m0.009s
sys 0m0.064s
Note that in recovery on Fairphone 4 even with Mount /mnt/system/
:
adb shell ls /sdcard/
does not return anything.
adb shell ls /mnt/system/
acct
apex
bin
bootstrap-apex
bugreports
cache
config
d
data
data_mirror
debug_ramdisk
dev
etc
init
init.environ.rc
linkerconfig
lost+found
metadata
mnt
odm
odm_dlkm
oem
postinstall
proc
product
sdcard
second_stage_resources
storage
sys
system
system_dlkm
system_ext
tmp
vendor
vendor_dlkm
adb shell ls /mnt/system/sdcard/
ls: /mnt/system/sdcard/: No such file or directory
adb shell ls /mnt/system/data/
does not return anything.
adb shell ls /mnt/system/data/data/
ls: /mnt/system/data/data/: No such file or directory
so does not give access to Termux data, it makes quite sense as it should require decryption and I do not provide my password at any point.
adb shell ls /data/data/com.termux/files/
ls: /data/data/com.termux/files/: Permission denied
adb shell whoami
shell
adb root
adbd cannot run as root in production builds
adb ls /
000041ed 00001000 495c0780 product
000041ed 00001000 495c0780 res
000041ed 00001000 495c0780 debug_ramdisk
000041ed 00001000 495c0780 vendor
000041c0 00004000 495c0780 lost+found
0000a1a4 00000011 495c0780 d
0000a1a4 0000000b 495c0780 bin
000041ed 00001000 495c0780 oem
0000a1a4 00000015 495c0780 sdcard
000041f9 00001000 5edd0314 data
000041ed 000010cc 66bfc419 dev
0000a1a4 00000013 495c0780 charger
000041ed 00000118 0957f5ae apex
000041ed 00001000 495c0780 .
000041ed 00000064 66bfc43e storage
000041ed 00001000 495c0780 odm
0000a1a4 0000000b 495c0780 etc
0000416d 00000000 0957f5ab acct
000041e8 00001000 495c0780 sbin
0000a1a4 00000018 495c0780 product_services
000041ed 00001000 495c0780 system
000041ed 00000000 00000001 config
0000a1a4 00000032 495c0780 bugreports
0000416d 00000000 0957f5ab sys
0000a180 00000017 495c0780 default.prop
000041ed 00000104 0957f5ad mnt
0000416d 00000000 00000000 proc
000041ed 00001000 495c0780 ..
adb pull /data/
/data/: 0 files pulled, 0 skipped.
adb shell ls /data/
ls: /data/: Permission denied
adb shell ls /data/data/
ls: /data/data/: Permission denied
adb shell ls /data/data/com.termux/
ls: /data/data/com.termux/: Permission denied
FileZilla:
Status: Retrieving directory listing of "/data/data"...
Command: cd "/data/data"
Error: Directory /data/data: permission denied
Error: Failed to retrieve directory listing
/data/data/com.termux/
can be downloaded correctly however by wifi it is a bit slow. So related to Benjamin-Loison/termux-app/issues/22. With USB tethering the download bandwidth is great but the discovery of files is too slow as it seems perfomed interactively. So generating and downloading tar may be faster or even downloading tar on the fly would be the best.
FileZilla finally in 12 minutes downloaded 64,095 files for:
-----BEGIN PGP MESSAGE-----
hF4DTQa9Wom5MBgSAQdAFz4a3qxBU0zoEfN7vvD79B2/us7tYWY67hrvMnPlR3Qw
jpqZvWGuqjpUrM9TWEiesSNHeu4iHdKaMp/SzgzTCLJHF1YsFu7OMh5CFqssD9Zp
0kABy7Nxo9e17Rx27bsZQd6pd+xonilHKjwr+rOL3CJ1Vh/aXRBSuOS6KCLVUvvR
coP0mcBrgYbjOLAjQ2xhMCWH
=uzsR
-----END PGP MESSAGE-----
but failed for 20 files:
/com.termux/files/home/.gnupg/S.gpg-agent.ssh
/com.termux/files/home/.gnupg/S.keyboxd
/com.termux/files/home/.gnupg/S.gpg-agent.browser
/com.termux/files/home/.gnupg/S.gpg-agent
/com.termux/files/home/.gnupg/S.dirmngr
/com.termux/files/home/.gnupg/S.gpg-agent.extra
/com.termux/files/usr/libexec/git-core/git-citool
/com.termux/files/usr/var/run/cron.reboot
/com.termux/files/usr/var/service/crond/log/supervise/control
/com.termux/files/usr/var/service/crond/supervise/control
/com.termux/files/usr/var/service/sshd/supervise/control
/com.termux/files/usr/var/service/sshd/log/supervise/control
/com.termux/files/usr/var/service/httpd/supervise/control
/com.termux/files/usr/var/service/httpd/log/supervise/control
/com.termux/files/usr/var/service/crond/log/supervise/ok
/com.termux/files/usr/var/service/sshd/log/supervise/ok
/com.termux/files/usr/var/service/crond/supervise/ok
/com.termux/files/usr/var/service/httpd/log/supervise/ok
/com.termux/files/usr/var/service/httpd/supervise/ok
/com.termux/files/usr/var/service/sshd/supervise/ok
Why has it failed?
No issue due to restore, as in theory not Termux noticeable restoration, as only proceeded to bit by bit restorations.
Are these files important?
cat ~/../usr/var/run/cron.reboot
cat: /data/data/com.termux/files/home/../usr/var/run/cron.reboot: Permission denied
Note that `~/../usr/var/spool/cron/
whoami`` is where
crontab -l` is stored.
Related to the Super User question 1009623.
ls ~/.gnupg/
S.gpg-agent S.gpg-agent.ssh private-keys-v1.d sshcontrol
S.gpg-agent.browser S.keyboxd public-keys.d trustdb.gpg
S.gpg-agent.extra common.conf random_seed
gpg --list-secret-keys
shows that I have all my phone private keys on my Linux Mint 22 Cinnamon Framework 13 laptop so it is fine anyway.
tar --help
That is:
...
-c, --create create a new archive
...
-C, --directory=DIR change to directory DIR
...
-f, --file=ARCHIVE use archive file or device ARCHIVE
...
-z, --gzip, --gunzip, --ungzip filter the archive through gzip
...
time ssh -p 8022 _gateway -t 'tar -zc -C /data/data/com.termux/files ./home ./usr | cat' > termux-backup.tar.gz; echo $?
However, for:
-----BEGIN PGP MESSAGE-----
hF4DTQa9Wom5MBgSAQdAQtIPM9bKVF/rs5IP6OYrLcxd3isoa0nPCxPwjM7YSWAw
6R75DHlu3W4iUhOEmD3iYnrAhuSsZ+ZhiFFBAtdan3JGehXCQHfuO9S39205jHws
0kABH/dtySaZ8tGukybf+eIMY75enxcahxhxaLYVrdeS54sMX/O1Q6Os/aX1rXZm
31cNsKDGovlt3AmTL6b7jDlO
=b7QD
-----END PGP MESSAGE-----
It seems stuck after 10 minutes at:
ls -l termux-backup.tar.gz
-rw-rw-r-- 1 CENSORED CENSORED 429014371 Aug 17 00:49 termux-backup.tar.gz
While:
du -sh com.termux/
6.5G com.termux/
Concerning restoring:
mv /sdcard/authorized_keys ~/.ssh/
mv: cannot open '/sdcard/authorized_keys' for reading: Permission denied
As need to give internal storage access.
mkdir .ssh/
mkdir .ssh/
mkdir: cannot create directory ‘.ssh/’: File exists
vim .ssh/authorized_keys
The program vim is not installed. Install it by executing:
pkg install vim
or
pkg install vim-gtk, after running pkg install x11-repo
or
pkg install vim-python
termux-clipboard-get
The program termux-clipboard-get is not installed. Install it by executing:
pkg install termux-api
nano .ssh/authorized_keys
ifconfig
sshd
The program sshd is not installed. Install it by executing:
pkg install openssh
Should apt update && apt upgrade -y && apt autoremove -y
before:
pkg install openssh
No mirror or mirror group selected. You might want to select one by running 'termux-change-repo'
Testing the available mirrors:
[*] (10) https://packages-cf.termux.dev/apt/termux-main: ok
[*] (1) https://mirror.textcord.xyz/termux/termux-main: bad
[*] (1) https://mirror.nevacloud.com/applications/termux/termux-main: ok
[*] (1) https://mirrors.nguyenhoang.cloud/termux/termux-main: ok
[*] (1) https://mirror.twds.com.tw/termux/termux-main: ok
[*] (1) https://linux.domainesia.com/applications/termux/termux-main: ok
[*] (1) https://tmx.xvx.my.id/apt/termux-main: ok
[*] (1) https://mirror.freedif.org/termux/termux-main: ok
[*] (1) https://mirrors.cbrx.io/apt/termux/termux-main: ok
[*] (1) https://mirrors.in.sahilister.net/termux/termux-main/: ok
[*] (1) https://mirror.albony.in/termux/termux-main: ok
[*] (1) https://mirror.bardia.tech/termux/termux-main: bad
[*] (1) https://mirrors.sdu.edu.cn/termux/termux-main: ok
[*] (1) https://mirrors.sau.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.nju.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.sustech.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.pku.edu.cn/termux/termux-main/: ok
[*] (1) https://mirror.sjtu.edu.cn/termux/termux-main/: ok
[*] (1) https://mirror.iscas.ac.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.ustc.edu.cn/termux/termux-main: ok
[*] (1) https://mirrors.aliyun.com/termux/termux-main: ok
[*] (1) https://mirrors.qvq.net.cn/termux/termux-main: ok
[*] (1) https://mirrors.cqupt.edu.cn/termux/termux-main: ok
[*] (1) https://mirrors.zju.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.hust.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.bfsu.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirror.nyist.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-main: ok
[*] (1) https://ftp.agdsn.de/termux/termux-main: ok
[*] (4) https://grimler.se/termux/termux-main: ok
[*] (1) https://ro.mirror.flokinet.net/termux/termux-main: ok
[*] (1) https://mirrors.cfe.re/termux/termux-main: bad
[*] (1) https://mirror.termux.dev/termux-main: bad
[*] (1) https://termux.3san.dev/termux/termux-main: ok
[*] (1) https://mirror.bouwhuis.network/termux/termux-main: ok
[*] (1) https://mirror.accum.se/mirror/termux.dev/termux-main: ok
[*] (1) https://termux.mentality.rip/termux-main: ok
[*] (1) https://is.mirror.flokinet.net/termux/termux-main: ok
[*] (1) https://md.mirrors.hacktegic.com/termux/termux-main: ok
[*] (1) https://termux.astra.in.ua/apt/termux-main: ok
[*] (1) https://mirror.mwt.me/termux/main: ok
[*] (1) https://mirrors.medzik.dev/termux/termux-main: ok
[*] (1) https://packages.termux.dev/apt/termux-main: ok
[*] (1) https://mirror.sunred.org/termux/termux-main: ok
[*] (1) https://mirrors.de.sahilister.net/termux/termux-main: ok
[*] (1) https://mirror.leitecastro.com/termux/termux-main: ok
[*] (1) https://termux.cdn.lumito.net/termux-main: ok
[*] (1) https://nl.mirror.flokinet.net/termux/termux-main: ok
[*] (1) https://ftp.fau.de/termux/termux-main: ok
[*] (1) https://termux.librehat.com/apt/termux-main: ok
[*] (1) https://mirror.autkin.net/termux/termux-main: ok
[*] (1) https://mirror.polido.pt/termux/termux-main: bad
[*] (1) https://dl.kcubeterm.com/termux-main: bad
[*] (1) https://termux.danyael.xyz/termux/termux-main: ok
[*] (1) https://mirror.mwt.me/termux/main: ok
[*] (1) https://mirrors.utermux.dev/termux/termux-main: ok
[*] (1) https://mirror.vern.cc/termux/termux-main: ok
[*] (1) https://plug-mirror.rcac.purdue.edu/termux/termux-main: ok
[*] (1) https://mirror.quantum5.ca/termux/termux-main: ok
[*] (1) https://mirror.fcix.net/termux/termux-main: ok
[*] (1) https://mirror.csclub.uwaterloo.ca/termux/termux-main: ok
[*] (1) https://mirror.endianness.com/termux/termux-main: ok
[*] (1) https://mirrors.rda.run/termux/termux-main: bad
[*] (1) https://repository.su/termux/termux-main/: ok
[*] (1) http://mirror.mephi.ru/termux/termux-main: bad
Picking mirror: (61) /data/data/com.termux/files/usr/etc/termux/mirrors/north_america/mirrors.utermux.dev
Get:1 https://mirrors.utermux.dev/termux/termux-main stable InRelease [14.0 kB]
Get:2 https://mirrors.utermux.dev/termux/termux-main stable/main aarch64 Packages [520 kB]
Fetched 534 kB in 4s (148 kB/s)
Reading package lists... Done
Building dependency tree... Done
25 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree... Done
The following additional packages will be installed:
krb5 ldns libdb libedit libresolv-wrapper
openssh-sftp-server termux-auth
The following NEW packages will be installed:
krb5 ldns libdb libedit libresolv-wrapper
openssh openssh-sftp-server termux-auth
0 upgraded, 8 newly installed, 0 to remove and 25 not upgraded.
Need to get 2669 kB of archives.
After this operation, 15.8 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 https://mirrors.utermux.dev/termux/termux-main stable/main aarch64 libresolv-wrapper aarch64 1.1.7-4 [11.5 kB]
Get:2 https://mirrors.utermux.dev/termux/termux-main stable/main aarch64 libdb aarch64 18.1.40-4 [495 kB]
Get:3 https://mirrors.utermux.dev/termux/termux-main stable/main aarch64 krb5 aarch64 1.21.3 [900 kB]
Get:4 https://mirrors.utermux.dev/termux/termux-main stable/main aarch64 ldns aarch64 1.8.3-2 [303 kB]
Get:5 https://mirrors.utermux.dev/termux/termux-main stable/main aarch64 libedit aarch64 20240517-3.1-0 [79.2 kB]
Get:6 https://mirrors.utermux.dev/termux/termux-main stable/main aarch64 openssh-sftp-server aarch64 9.8p1-4 [47.8 kB]
Get:7 https://mirrors.utermux.dev/termux/termux-main stable/main aarch64 termux-auth aarch64 1.4-2 [6384 B]
Get:8 https://mirrors.utermux.dev/termux/termux-main stable/main aarch64 openssh aarch64 9.8p1-4 [828 kB]
Fetched 2669 kB in 2s (1194 kB/s)
Selecting previously unselected package libresolv-wrapper.
(Reading database ... 4248 files and directories currently installed.)
Preparing to unpack .../0-libresolv-wrapper_1.1.7-4_aarch64.deb ...
Unpacking libresolv-wrapper (1.1.7-4) ...
Selecting previously unselected package libdb.
Preparing to unpack .../1-libdb_18.1.40-4_aarch64.deb ...
Unpacking libdb (18.1.40-4) ...
Selecting previously unselected package krb5.
Preparing to unpack .../2-krb5_1.21.3_aarch64.deb ...
Unpacking krb5 (1.21.3) ...
Selecting previously unselected package ldns.
Preparing to unpack .../3-ldns_1.8.3-2_aarch64.deb ...
Unpacking ldns (1.8.3-2) ...
Selecting previously unselected package libedit.
Preparing to unpack .../4-libedit_20240517-3.1-0_aarch64.deb ...
Unpacking libedit (20240517-3.1-0) ...
Selecting previously unselected package openssh-sftp-server.
Preparing to unpack .../5-openssh-sftp-server_9.8p1-4_aarch64.deb ...
Unpacking openssh-sftp-server (9.8p1-4) ...
Selecting previously unselected package termux-auth.
Preparing to unpack .../6-termux-auth_1.4-2_aarch64.deb ...
Unpacking termux-auth (1.4-2) ...
Selecting previously unselected package openssh.
Preparing to unpack .../7-openssh_9.8p1-4_aarch64.deb ...
Unpacking openssh (9.8p1-4) ...
Setting up libedit (20240517-3.1-0) ...
Setting up openssh-sftp-server (9.8p1-4) ...
Setting up ldns (1.8.3-2) ...
Setting up libresolv-wrapper (1.1.7-4) ...
Setting up termux-auth (1.4-2) ...
Setting up libdb (18.1.40-4) ...
Setting up krb5 (1.21.3) ...
Setting up openssh (9.8p1-4) ...
Generating public/private rsa key pair.
Your identification has been saved in /data/data/com.termux/files/usr/etc/ssh/ssh_host_rsa_key
Your public key has been saved in /data/data/com.termux/files/usr/etc/ssh/ssh_host_rsa_key.pub
The key fingerprint is:
SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX u0_a224@localhost
The key's randomart image is:
+---[RSA 3072]----+
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
+----[SHA256]-----+
unknown key type dsa
Generating public/private ecdsa key pair.
Your identification has been saved in /data/data/com.termux/files/usr/etc/ssh/ssh_host_ecdsa_key
Your public key has been saved in /data/data/com.termux/files/usr/etc/ssh/ssh_host_ecdsa_key.pub
The key fingerprint is:
SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX u0_a224@localhost
The key's randomart image is:
+---[ECDSA 256]---+
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
+----[SHA256]-----+
Generating public/private ed25519 key pair.
Your identification has been saved in /data/data/com.termux/files/usr/etc/ssh/ssh_host_ed25519_key
Your public key has been saved in /data/data/com.termux/files/usr/etc/ssh/ssh_host_ed25519_key.pub
The key fingerprint is:
SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX u0_a224@localhost
The key's randomart image is:
+--[ED25519 256]--+
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXXXX|
+----[SHA256]-----+
When uploading com.termux/
from FileZilla the terminal exitted at some point so uploads started failing due to disconnected server, so I executed back in new Termux console:
sshd
CANNOT LINK EXECUTABLE "sshd": file offset for the library "libcrypto.so.3" >= file size: 0 >= 0
So let us restore files without network:
du -sh
4.0G .
du -sh *
1.2G home
2.8G usr
https://wiki.termux.com/wiki/Backing_up_Termux:
time tar -zcf termux-backup.tar.gz home/ usr/
real 2m15.626s
user 2m5.849s
sys 0m10.754s
progress -m
ls -lh termux-backup.tar.gz
-rw-rw-r-- 1 CENSORED CENSORED 1.4G Aug 18 17:20 termux-backup.tar.gz
adb root
adbd cannot run as root in production builds
adb push termux-backup.tar.gz /sdcard/
termux-backup.tar.gz: 1 file pushed, 0 skipped. 29.9 MB/s (1402500629 bytes in 44.703s)
termux-setup-storage
is necessary as Files does not give access to Termux storage and adb push cannot push to Termux folder (cannot adb root even after checking Developer options)
tar -zxf /sdcard/termux-backup.tar.gz -C /data/data/com.termux/files --recursive-unlink --preserve-permissions
After exit:
:/data/data/com.termux/files/home $ cd
:/data/data/com.termux/files/home $ ls
sh: ls: can't execute: Permission denied
I guess it is because I archived on Linux Mint 22 Cinnamon and not Termux, probably due to FileZilla.
So this time let us proceed folder by folder manually.
Maybe issues with matrix-commander
(with messages showing on other devices as Unable to decrypt message), see Benjamin-Loison/matrix-commander/issues/5.
Should encrypt to avoid other apps having access to /sdcard/
to access the backup. See https://wiki.termux.com/wiki/Backing_up_Termux.
Alternatively could use SSHFS.
Concerning Phone:
Both histories go to March 9, 2023.
Taking a screenshot with Capture more goes to January 2, 2024.
With 4 other Capture more screenshots I capture everything.
If dd
, SeedVault and my adb pull
fails, I am fine loosing my data. If dd
and SeedVault
fail, I am fine loosing my Fennec history and WhatsApp chats.
Space needed: 256 GB for dd
, used phone space (currently about 154 GB) * 2 for adb pull
and SeedVault. /sdcard/
is about 99 GB according to du -sh
.
Currently I have 431 GB free according to df -h
, so taking into account dd
, I have 175 GB free.
By compressing maybe can meet my goals, however maybe compressing requires both uncompressed source space and compressed target space.
time adb pull /sdcard/
/sdcard/: 6542 files pulled, 0 skipped. 34.4 MB/s (106358542072 bytes in 2951.298s)
real 49m12.010s
user 0m14.683s
sys 6m57.479s
du -sh sdcard
100G sdcard
Can use scrcpy
during the backup to avoid accidentally break connection by (indirectly) move the cable between the phone and computer.
Well in recovery it is quite pointless anyway:
scrcpy
scrcpy 2.6.1 <https://github.com/Genymobile/scrcpy>
ERROR: Device could not be connected (state=recovery)
ERROR: Server connection failed
At least took 41 minutes and 47.7 GB.
adb pull /sdcard/.SeedVaultAndroidBackup/
/sdcard/.SeedVaultAndroidBackup/: 5584... MB/s (54937670662 bytes in 1505.211s)
du -sh .SeedVaultAndroidBackup/
52G .SeedVaultAndroidBackup/
On Xiaomi Mi A3:
Switching from iOS or Android is easier than you think
- Switch from iOS or Android in no time
- Securely transfer all your data
- All of your favorite Google Apps will be right there with you
- Fairphones work with your devices: PCs, Macbooks, headphones, even iPads
Source: https://shop.fairphone.com/fairphone-5#section3
https://shop.fairphone.com/getting-started#Transfer-your-data-easily
https://support.fairphone.com/hc/en-us/articles/10464413605137-Switch-to-your-new-Fairphone
Should investigate Settings > Developer options > Desktop backup password (Desktop full backups aren't currently protected) on Xiaomi Mi A3 for instance.
https://technastic.com/back-up-android-apps-data-via-adb/ so seems related to adb backup
and adb restore
.
LineageOS does not keep the whole history of binary releases, hence have to pay attention. Taking whole sda
seems dangerous even if I saw that updating may solve what looks like a firmware issue.
Only saving user-data seems pretty nice as saving the OS does not seem useful and does not lead to firmware issue.
The real question for both bit by bit save is does it restore well on another same phone model instance? I am fine with installing LineageOS manually on the phone to restore data on. However, have to make sure that do not break something by loosing IMEI, encryption keys or similar due to this specific same phone model instance.
Should save 2 different ways preferably to make sure that one can break if I need to restore a backup.
Related to Benjamin_Loison/adb/issues/13#issuecomment-2207.
On my Fairphone 4 LineageOS Termux:
date && stat notes.txt
Tue Sep 3 00:35:22 CEST 2024
File: notes.txt
Size: 150 Blocks: 8 IO Block: 4096 regular file
Device: 0,144 Inode: 50876 Links: 1
Access: (0660/-rw-rw----) Uid: ( 0/ root) Gid: ( 9997/everybody)
Access: 2024-08-27 23:58:21.711123000 +0200
Modify: 2023-09-13 21:11:56.652000000 +0200
Change: 2024-08-27 23:58:21.711123107 +0200
Birth: -
On my Linux Mint 22 Cinnamon Framework 13:
date && adb pull /sdcard/Documents/administrative/notes.txt && stat notes.txt
Tue Sep 3 12:37:03 AM CEST 2024
/sdcard/Documents/administrative.... 0.0 MB/s (150 bytes in 0.005s)
File: notes.txt
Size: 150 Blocks: 24 IO Block: 4096 regular file
Device: 0,70 Inode: 91504777 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/benjamin) Gid: ( 1000/benjamin)
Access: 2024-09-03 00:37:03.697797589 +0200
Modify: 2024-09-03 00:37:03.702797579 +0200
Change: 2024-09-03 00:37:03.702797579 +0200
Birth: -
date && adb pull -a /sdcard/Documents/administrative/notes.txt && stat notes.txt
Tue Sep 3 12:39:14 AM CEST 2024
/sdcard/Documents/administrative.... 0.0 MB/s (150 bytes in 0.009s)
File: notes.txt
Size: 150 Blocks: 24 IO Block: 4096 regular file
Device: 0,70 Inode: 91503644 Links: 1
Access: (0660/-rw-rw----) Uid: ( 1000/benjamin) Gid: ( 1000/benjamin)
Access: 2023-09-13 21:11:56.000000000 +0200
Modify: 2023-09-13 21:11:56.000000000 +0200
Change: 2024-09-03 00:39:14.217526582 +0200
Birth: -
Source: https://adbshell.com/commands/adb-pull
So Modify is correctly kept.
Note that SeedVault backup after backing up Termux is useless as files in /sdcard/
are not backed up by SeedVault.
fp4ssht tar -zcf /sdcard/termux-backup.tar.gz -C /data/data/com.termux/files ./home ./usr
tar: ./home/bens_folder/termux/temperature.txt: file changed as we read it
tar: ./home/.gnupg/S.keyboxd: socket ignored
tar: ./home/.gnupg/S.gpg-agent: socket ignored
tar: ./home/.gnupg/S.gpg-agent.extra: socket ignored
tar: ./home/.gnupg/S.gpg-agent.browser: socket ignored
tar: ./home/.gnupg/S.gpg-agent.ssh: socket ignored
tar: ./usr/var/run/cron.reboot: Cannot open: Permission denied
tar: Exiting with failure status due to previous errors
Connection to fairphone-4-5g-1 closed.
echo $?
2
time tar -tzf termux-backup.tar.gz > /dev/null; echo $?; matrix-commander -m 'Verification finished'
0
Source: the Stack Overflow answer 2001750
man tar
...
-t, --list
List the contents of an archive. Arguments are optional. When
given, they specify the names of the members to list.
...
-z, --gzip, --gunzip, --ungzip
Filter the archive through gzip(1).
...
-f, --file=ARCHIVE
Use archive file or device ARCHIVE. If this option is not
given, tar will first examine the environment variable `TAPE'.
If it is set, its value will be used as the archive name. Oth‐
erwise, tar will assume the compiled-in default. The default
value can be inspected either using the --show-defaults option,
or at the end of the tar --help output.
An archive name that has a colon in it specifies a file or de‐
vice on a remote machine. The part before the colon is taken as
the machine name or IP address, and the part after it as the
file or device pathname, e.g.:
--file=remotehost:/dev/sr0
An optional username can be prefixed to the hostname, placing a
@ sign between them.
By default, the remote host is accessed via the rsh(1) command.
Nowadays it is common to use ssh(1) instead. You can do so by
giving the following command line option:
--rsh-command=/usr/bin/ssh
The remote machine should have the rmt(8) command installed. If
its pathname does not match tar's default, you can inform tar
about the correct pathname using the --rmt-command option.
...
What does it look like if do not redirect to /dev/null
?
tar -tzf termux-backup.tar.gz | head
./home/
./home/.termux/
./home/.termux/termux.properties
./home/.termux/boot/
./home/.termux/boot/start.sh
./home/.termux/actual_start.sh
./home/.bash_history
./home/.ssh/
./home/.ssh/authorized_keys
./home/.ssh/known_hosts
adb pull -a /sdcard/; echo $?; time matrix-commander -m 'Pull finished!'
/sdcard/: 11402 files pulled, 0 skipped. 106.8 MB/s (117315124533 bytes in 1047.905s)
0
du -sh sdcard/
110G sdcard/
du -sh sdcard/.SeedVaultAndroidBackup/
45G sdcard/.SeedVaultAndroidBackup/
adb shell du -sh /sdcard/.SeedVaultAndroidBackup/
45G /sdcard/.SeedVaultAndroidBackup/
ls -lh sdcard/termux-backup.tar.gz
-rw-rw---- 1 benjamin benjamin 23G Sep 5 18:54 sdcard/termux-backup.tar.gz
adb shell ls -lh /sdcard/termux-backup.tar.gz
-rw-rw---- 1 root everybody 22G 2024-09-05 18:54 /sdcard/termux-backup.tar.gz
du -sh .SeedVaultAndroidBackup/*
2.4G .SeedVaultAndroidBackup/1725551528353
43G .SeedVaultAndroidBackup/82e49ac12b5b78d3.sv
adb push .SeedVaultAndroidBackup/ /sdcard/; echo $?; matrix-commander -m 'Push finished!'
.SeedVaultAndroidBackup/: 5375 files p... MB/s (47748608343 bytes in 1867.742s)
0
adb push termux-backup.tar.gz /sdcard/; echo $?; matrix-commander -m 'Push finished!'
termux-backup.tar.gz: 1 file pushed, 0 skipped. 23.6 MB/s (23803064345 bytes in 963.603s)
0
Before restoring facing:
ping 8.8.8.8
socket: Connection refused
https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28
curl -s https://api.github.com/repos/termux/termux-app/actions/artifacts | jq '.artifacts[] | select((.name | test("termux\\-app_v0\\.118\\.0\\+[0-9a-f]{7}\\-apt\\-android\\-7\\-github\\-debug_arm64\\-v8a")) and (.workflow_run.head_branch == "master"))'
{
"id": 1860474698,
"node_id": "MDg6QXJ0aWZhY3QxODYwNDc0Njk4",
"name": "termux-app_v0.118.0+c2d57f2-apt-android-7-github-debug_arm64-v8a",
"size_in_bytes": 32952821,
"url": "https://api.github.com/repos/termux/termux-app/actions/artifacts/1860474698",
"archive_download_url": "https://api.github.com/repos/termux/termux-app/actions/artifacts/1860474698/zip",
"expired": false,
"created_at": "2024-08-27T15:51:01Z",
"updated_at": "2024-08-27T15:51:01Z",
"expires_at": "2024-11-25T15:47:57Z",
"workflow_run": {
"id": 10581503562,
"repository_id": 44804216,
"head_repository_id": 44804216,
"head_branch": "master",
"head_sha": "c2d57f2ed810b6fa854a6c9ab0ecee4aac38a0cc"
}
}
https://github.com/termux/termux-app/commits/master/ does not seem to list builds of previous commits.
curl 'https://api.github.com/repos/termux/termux-app/actions/artifacts/1860474698/zip'
{
"message": "You must have the actions scope to download artifacts.",
"documentation_url": "https://docs.github.com/rest/actions/artifacts#download-an-artifact",
"status": "403"
}
https://github.com/settings/personal-access-tokens/new Token name: Download GitHub artifacts Description: https://github.com/Benjamin-Loison/android/issues/46#issuecomment-2332912554
No matter permissions of Fine-grained tokens and Tokens (classic) and using Bearer
or token
I get either:
While an URL like https://github.com/termux/termux-app/actions/runs/10581503562/artifacts/1860474698 works fine only with Firefox and if we are connected.
wget https://github.com/termux/termux-app/actions/runs/10581503562/artifacts/1860474698 --header 'Cookie: user_session=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
works fine.
adb install -r termux-app_v0.118.0+c2d57f2-apt-android-7-github-debug_arm64-v8a.apk
Performing Streamed Install
Success
and
adb install termux-app_v0.118.0+c2d57f2-apt-android-7-github-debug_arm64-v8a.apk
Performing Streamed Install
Success
do not help.
adb uninstall com.termux
Success
adb install termux-app_v0.118.0+c2d57f2-apt-android-7-github-debug_arm64-v8a.apk
Performing Streamed Install
Success
still does not solve the issue.
wget https://f-droid.org/repo/com.termux_1000.apk
adb uninstall com.termux
Success
adb install com.termux_1000.apk
Performing Streamed Install
adb: failed to install com.termux_1000.apk: Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: Reconciliation failed...: Reconcile failed: Package com.termux has no signatures that match those in shared user com.termux; ignoring!]
adb uninstall com.termux.api
Success
adb uninstall com.termux.boot
Success
adb install termux-app_v0.118.0+c2d57f2-apt-android-7-github-debug_arm64-v8a.apk
Performing Streamed Install
Then ping
works fine.
time tar -zxf /sdcard/termux-backup.tar.gz -C /data/data/com.termux/files --recursive-unlink --preserve-permissions; echo $?; matrix-commander -m 'Untar finished!'
real 6m1.573s
user 5m0.047s
sys 1m31.721s
0
How to monitor progress, as there is no output, progress
requires installation and it may conflict with on-going restoration. du -sh ..
is an interesting start.
Add-ons must be installed from the same source as the application so that the same User ID is used.
Source: Wikipedia: Termux#Add-ons (1246508231)
why the source matters? Can't just name the user user or the purpose is to match system one? Related to Benjamin_Loison/cron/issues/17.
On both my phone and a Xiaomi Mi A3 still have Verified on both sides even after sending to each other a message and on Xiaomi side killing and opening again the app.
Being able to export and re-import app permissions would be nice, even if requires using adb
manually.
Related to Benjamin_Loison/seedvault/issues/23.
Shortcut to main comment: #issuecomment-2282294748 or the following #issuecomment-2282299708 to easily scroll to the end of the main one.
Related to Benjamin-Loison/timeshift/issues/9 and: