Closed Cubox closed 6 years ago
@cubox, thanks for including the partition map.
Can you run adb shell cat /etc/fstab
and post the output, while booted into TWRP? It seems that your /data
partition may not be reported as such … perhaps because it's encrypted?
<cubox@Sleipnir>-<~> λ adb shell cat /etc/fstab
/dev/block/mmcblk0p41 /system ext4 rw 0 0
/dev/block/dm-0 /data ext4 rw 0 0
/dev/block/mmcblk0p38 /cache ext4 rw 0 0
/dev/block/mmcblk0p1 /firmware ext4 rw 0 0
/usb-otg vfat rw 0 0
If it's encrypted, it is with the default password. Android documentation reports that such password is literally "default_password"
TWRP is able to access /data through the "File Manager" option.
Basically the problem here is that build_partmap()
is too naive in the way that it builds the map of block devices and partitions:
BLOCK DEVICE PARTITION NAME SIZE (KiB) MOUNT POINT FSTYPE
-------------- ---------------- ------------ ------------- --------
mmcblk0p42 userdata 27807616
What it does is first make a list of all the mmcblk*
partitions, and then second it tries to figure out where those partitions are mounted.
Really, there should be more of a meet-in-the-middle approach:
mmcblk0p42
is the userdata
partition usually mounted at /data
)/etc/fstab
and try to figure out what they correspond to (e.g. /data
is the mount point for /dev/block/dm-0
)mmcblk0p42
is the "raw" block device for the userdata
//data/
partition (which will be used to make a raw partition image in the case of a Nandroid backup) while /dev/block/dm-0
is the "mountable" block device (which will be mounted at /data
in the case of a TWRP backup).We'd end up with a partition table more like this:
BLOCK DEVICE PARTITION NAME SIZE (KiB) MOUNT POINT FSTYPE
----------------------------------- ---------------- ------------ ------------- --------
(raw) /sys/block/mmcblk0/mmcblk0p42 userdata 27807616 /data ext4
(mountable) /dev/block/dm-0
(both) /sys/block/mmcblk0/mmcblk0p41 system 2097152 /system ext4
(both) /sys/block/mmcblk0/mmcblk0p1 modem 114688 /firmware ext4
I don't enough time to work on tetherback anymore… and I don't have a real device that would require this treatment so it'd be hard for me to test, anyway. Anyone care to take a crack at this? It should not be too hard to modify build_partmap()
to be a bit more sophisticated and figure out the correct partition map as shown above.
Thanks for your explanation on the issue.
I am not skilled to fix that, so I will leave this to someone who can. However, is there a way for me to fix this issue temporarily (even by doing some ugly code/edits) for my device?
If I can hardcode the behaviour to follow into the code, or something of the sort.
Thanks!
OK, I'm a little late to the party but this might help someone else. I was able to backup encrypted userdata from my Nexus 5X with a small patch, so I created a pull request: #59
Since my pull request has been merged, this can be closed.
Hi,
When trying to run your software (master or release), I get this error... I'm running a Nexus 6, with CM installed.
If you need me to do any manipulations to help in finding the problem, please tell me and I will report back.
Thanks!