Jump to content

Pro¹ X - backup, restore and repair device specific partitions


Recommended Posts

Consider that, concerning non-working sensors, the recommendation to do a full backup of the original Android system is largely obsoleted by the latest edit of the OP of this thread:

Concerning your connection troubles, I can only recommend to try different (USB) hardware. I ended up doing all my adb/fastboot business from a Raspberry Pi3 as my Thinkpads are seemingly to "advanced" for the purpose ...

Link to post
Share on other sites
  • Replies 60
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

It is highly advised to take a backup of your device specific partitions right after you receive the device. Update 20220829: tl:dr: Community has not found a safe way to restore backups as of yet.

Yet another way how to backup persist (or any other) partition even without PC, with rooted phone and Magisk: Install Magisk module "backup" and reboot. After that using some terminal app in phon

Edited the first post with working repair instructions using restorecon. Ii just now successfully found that way to be working on my side. 🥳🎉

21 hours ago, claude0001 said:

Consider that, concerning non-working sensors, the recommendation to do a full backup of the original Android system is largely obsoleted by the latest edit of the OP of this thread:

Concerning your connection troubles, I can only recommend to try different (USB) hardware. I ended up doing all my adb/fastboot business from a Raspberry Pi3 as my Thinkpads are seemingly to "advanced" for the purpose ...

Indeed, for edl it might be worth to try a usb 2.0 connection. This can be done by using an old cheap usb 2.0 hub if your computers do not offer any @thilo
`fastboot fetch` is just not available, sadly.
Regarding your backup attempts using adb, its necessary to root android using magisk to be permitted to access those partitions. Its an easy process documented here officially:
https://docs.google.com/document/d/1sBS-Taw-3MXrG4lETA6dfuwda8K-9uVlzLhGk46ctzg/edit

Or in short,
- install magisk from the official source https://github.com/topjohnwu/Magisk
-
grab the boot.img fitting to your build number (contained in the same system image package used to fully flash the device)
- patch this boot image using magisk
- Download the patched boot.image using adb
- flash the patched boot.img using fastboot
- Boot into android to see working root in the magisk app
- `adb root` to grant root rights for next command
- grant permission for the adb root in the pop-up or when missed in the magisk apps section for the shell app.
- `adb pull /dev/block/sda2 persist_20221101.img`
- `adb unroot` not really necessary since it does not persist reboot or adb on/off

But as @claude0001correctly noted, there is no know way to restore the persist partition currently.
But it might be worth having it for the point in time when a working way has been found.

  • Thanks 1
Link to post
Share on other sites
  • 4 weeks later...

Yet another way how to backup persist (or any other) partition even without PC, with rooted phone and Magisk: Install Magisk module "backup" and reboot.

After that using some terminal app in phone (I use Termux), first gain root access:

su

and then enter

backup persist

it will create file persist.img in folder /backup of your phone's internal storage. The path can be changed of course. I suppose same can be achieved with dd command, but the above is easier.

Instead of terminal app in the phone you can of course use adb shell from a pc.

  • Like 3
  • Thanks 3
Link to post
Share on other sites
  • 2 months later...
On 11/1/2022 at 9:13 PM, thilo said:

Running edl with --debugmode shows timeout errors (see attached file)edl-debug.txt.

So I still don't manage to make a backup. Any hints?

I also couldn't get it to work and gave up. Same timeout errors as you.

I just rooted the phone with Magisk and used the following command to backup all the partitions to the sdcard:

mkdir /sdcard/backup
cd /dev/block/platform/soc/*/by-name
for filename in *; do if [ "$filename" != "userdata" ]; then echo "dd if=$filename of=/sdcard/backup/$filename.dd"; fi; done

This prints lines with the dd syntax to back up all partitions. It does not execute them for you. Please check if those lines fit your expectations first and then run one or all of them.

I then got the backups off the device using

adb pull /sdcard/backup

 

  • Thanks 1
Link to post
Share on other sites
1 hour ago, dicer said:

for filename in *; do if [ "$filename" != "userdata" ]; then echo "dd if=$filename of=/sdcard/backup/$filename.dd"; fi; done

Believe it or not, this is how we used to create OS distributions back-in-the-day.  Fattire even wrote a short poem about it:

So Many Zeroes!  A Children's Book By Dr. Seuss (a.k.a. fattire)

Blue had his V2, all shiny and GNU, and wanted to send it, but stopped to review.
"What would this ware weigh, if zipped up today?  Should it not be much larger than the SDK?"
And yet it was bigger (nearly one-half a gigger!), but Blue still released it with vim and with vigor.
"A drive is a drive, at any old size!  But a drive is alive when its zero'ed to thrive!"
So Blue packered his tracks with a /dev/zero-whacker.  And then that blue cracker, he launched his bittracker...
And he ripped, and he zipped (but he didn't encrypt), until it was scripted, and that's when he shipped it!
It was plain to see-- that his brand-new v3-- was shiny and tiny and better.  Whoopie!
In fact the whole thing was down to 180.  A number of megs that was far, far less weighty.
And now when the Rommers all rom their romses, and now when the Singers all sing their songses,
their image of Blue will be bigger and taller,
and installers they image will be *many* megs smaller.

180 MB for an entire OS image. Ah, life was simpler then ;-)

  • Like 2
  • Haha 1
Link to post
Share on other sites
58 minutes ago, Sean McCreary said:

180 MB for an entire OS image. Ah, life was simpler then 😉

Ah you youngsters. started before there was dos. 1KB memory +  plug to a TV and a tape recorder.  (ZX81)

A few years later I had the first PC with not one but TWO floppy drives so I could have source on one, compile to another, swap the first, and link the object-code back to the first drive.

Later that was upgraded with what I saw as an almost infinite big harddisk - it was a whooping 10Mb 🤣👴 👴

  • Haha 1
Link to post
Share on other sites
  • 4 weeks later...
14 minutes ago, vlad the inhaler said:

i need hep obtaining a persist partition. Can someone share image of it please ?

AFAIK This partition contains specimen specific data that should not be used on multiple devices simultaneously.
Hence it should not be shared,
Perhaps Support can regenerate and push one matching your serial number? I tag @Casey to see if there is a way to get it?

Link to post
Share on other sites
  • 1 month later...

Hi,

since my Pro1X has arrived recently I'd like to make sure I understand this correctly, so:

  1. the persist (and other) partition can be backed up using edl. 
  2. the backup of persist partition is useless, because restoring doesn't guarantee the attestation keys to work
  3. it is not necessary to do 2) because the problem with keys is only with selinux context, which can be fixed by restorecon command (I suppose root access on the device is needed)
  4. why should I backup specifically those 5 partitions? What is interesting on the remaining 4? I have a backup, I am just curious 🙂

Is this correct? If so I have some more questions and notes:

  1. I did the backup using edl few times and the image of persist partition is changing between Android boots. I checked that just with md5, I plan to analyze more, but this suggest that this is a "live" partition, not just read-only. This may explain why the restore doesn't work.
  2. Did anyone analyze if and why the other systems (UT, Sailfish, etc) do access this partition? What about passing to these systems just a copy of it (e.g. using loopback) to prevent this trouble? I tried to find where it is mounted, but just by reading the scripts (they are quite complicated), so without success.

Thank you

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Terms