Backup of Android seems inconsistent. What to do?
How do you backup your Android Mobile?
In the past, I’d mount my mobile via USB, and backup from there. It crashed often, and is far from reliable.
I then started to use adbfs-rootless to mount the phone and then backup using restic, which is pretty stable, and capable to resume after USB-issues. (Which just means, it’s not outright crashing, but instead stalls for a moment. Doing anything on the Mobile usually helps resume quicker.)
(Side-Note: as it’s a FUSE mount, the inode numbers are not consistent across mounts. Hence, I recently [today] started using --ignore-inode
, greatly speeding up backup runs. Related Docs: Backing up — restic 0.18.0 documentation )
Open Question:
Now, what do you use for your Android Mobile Devices. Do you mount them?
Support Question (maybe restic, maybe adbfs / fuse)
This weekend I’ve made several backup runs of my mobile, and to my surprise, had to notice inconsistency in the snapshots. Hence the open question ^^·
I suppose, it’s an issue with android; But here are the details:
Summary
With the Mobile mounted using adbfs-rootless for each run (aka. unmounted inbetween).
// older runs omitted
a79198fc 2025-06-01 22:46 laptop adbfs,mobile_intern /mnt/3/storage/emulated/0 53.879 GiB // without --ignore-inode
5966b16b 2025-06-13 18:13 laptop adbfs,mobile_intern /mnt/3/storage/emulated/0 9.257 GiB // broken run.
eab385c4 2025-06-13 18:24 laptop adbfs,mobile_intern /mnt/3/storage/emulated/0 9.237 GiB // broken run.
a6532a70 2025-06-13 18:52 laptop adbfs,mobile_intern /mnt/3/storage/emulated/0 51.717 GiB // fine?? // without --ignore-inode
27c95bd0 2025-06-14 14:57 laptop adbfs,mobile_intern /mnt/3/storage/emulated/0 57.092 GiB # Added to the repository: 8.492 MiB (2.517 MiB stored) // from where?? It should be unchanged.
34916483 2025-06-14 15:47 laptop adbfs,mobile_intern /mnt/3/storage/emulated/0 59.483 GiB # Added to the repository: 2.836 MiB (1.021 MiB stored) // Mobile restarted, some change?
93c5cb35 2025-06-13 19:46 laptop adbfs,mobile_sd /mnt/3/sdcard 93.281 GiB // without --ignore-inode // expected from older runs: around 93.172 GiB
a801fd9d 2025-06-14 15:03 laptop adbfs,mobile_sd /mnt/3/sdcard 96.058 GiB # Added to the repository: 5.817 MiB (2.600 MiB stored) // from where?? It should be unchanged.
ea108ee2 2025-06-14 15:51 laptop adbfs,mobile_sd /mnt/3/sdcard 96.058 GiB # Added to the repository: 5.817 MiB (2.600 MiB stored) // Mobile restarted; no change?; And yes, the "Added" from the backup cmd is exactly the same.
The broken runs were probably due to USB crashing, as I overloaded my system with Hubs and parallel Tasks across all kind of connected devices.
But I have zero clue tbh. The cmd used is the same for ALL these snapshots (excpet the path for internal/sdcard).
Now, what I don’t understand are the size changes.
In ALL cases, one Video file is flagged as modified (using restic diff <parentID> <snapshotID>
, see below) showing multiple GB “Added” (and only few MB removed; from Apps).
The Video file is different each time.
This doesn’t seem like Bitrot too me, but rather like incomplete backups? The files aren’t marked with +
for added, but M
, and are months/years old.
Some Diffs:
comparing snapshot a6532a70 to 27c95bd0
comparing snapshot a6532a70 to 27c95bd0:
[0:04] 100.00% 75 / 75 index files loaded
- /mnt/3/storage/emulated/0/Android/data/org.APPSPECIFIC
+ /mnt/3/storage/emulated/0/Android/data/org.APPSPECIFIC
M /mnt/3/storage/emulated/0/DCIM/_redacted_path_/VID_20241019_005006.mp4
Files: 1 new, 1 removed, 1 changed
Dirs: 0 new, 0 removed
Others: 0 new, 0 removed
Data Blobs: 3649 new, 1 removed
Tree Blobs: 1245 new, 1245 removed
Added: 5.383 GiB
Removed: 8.259 MiB
comparing snapshot 27c95bd0 to 34916483
comparing snapshot 27c95bd0 to 34916483:
[0:04] 100.00% 75 / 75 index files loaded
- /mnt/3/storage/emulated/0/Android/data/org.APPSPECIFIC
+ /mnt/3/storage/emulated/0/Android/data/org.APPSPECIFIC
M /mnt/3/storage/emulated/0/DCIM/_redacted_path_/VID_20241019_031057.mp4
M /mnt/3/storage/emulated/0/_redacted_
Files: 0 new, 1 removed, 2 changed
Dirs: 1 new, 0 removed
Others: 0 new, 0 removed
Data Blobs: 1643 new, 2 removed
Tree Blobs: 581 new, 580 removed
Added: 2.394 GiB
Removed: 2.766 MiB
comparing snapshot 93c5cb35 to a801fd9d
comparing snapshot 93c5cb35 to a801fd9d:
[0:04] 100.00% 75 / 75 index files loaded
M /mnt/3/storage/694E-DD6C/DCIM/_redacted_path_/VID_20231107_064117.mp4
Files: 0 new, 0 removed, 1 changed
Dirs: 0 new, 0 removed
Others: 0 new, 0 removed
Data Blobs: 1861 new, 0 removed
Tree Blobs: 421 new, 421 removed
Added: 2.782 GiB
Removed: 5.698 MiB
I gurantee, these VID files are at least half a year old. And, their data already existed in the repo from even older runs (Although, those might’ve been without adbfs).
The sdcard is formatted as exfat.
PS: All backup runs were run with --no-cache
, as the target is a local HDD. Cache only drains my SSD.
Should I script in in-memory cache?
And a bunch of version information, if needed.
Summary
restic 0.18.0 compiled with go1.24.1 on linux/amd64
FUSE library version: 2.9.9
fusermount version: 2.9.9
using FUSE kernel interface version 7.19
Android Debug Bridge version 1.0.41
Version 35.0.2-android-tools