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 71
  • 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.

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

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

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
  • 2 months later...

Hello all, on my Pro1x I installed DivestOS (which is based on LineageOS - well it takes Lineage and drops a bunch of blobs and adds security patches).  The problem is that fingerprint scanner generates error immediately when I try to add a finger, and GPS doesn't seem to work. Another problem is that I cannot connect USB debugging (for adb logcat) because the phone is in a reconnecting USB loop (not the cable, rebooted PC, etc - on stock OS it worked, now it doesn't)

Status

  • I didn't backup /persist because I thought it is not Ubuntu Touch nor Sailfish but LineageOS based Android.
  • In DivestOS install procedure in fastboot I swap AVB keys (fastboot erase avb_custom_key; fastboot flash avb_custom_key avb_pkmd-pro1x.bin) that I downloaded for Pro1x. Then I flashed their recovery image and rebooted into that recovery.
  • But then accidentally rebooted back to stock OS it started and didn't complain. Then again to fastboot and chose recovery > then sideloaded the OS. Other things seem to work.

Steps:

  • I will contact the developer of DivestOS, but I wanted to first ask here if anyone had issues with fingerprint scanner or GPS or USB debugging, because I want to eliminate possibilities, and I am wondering if this is related to that /persist-parition-sensor-stuff
  • I am thinking about reinstalling stock Android and/or LineageOS and/or DivestOS... But if it is this /persist stuff then I wonder if that might get things worse...

Thanks in advance for any suggestions!

  • Sad 1
Link to post
Share on other sites
16 hours ago, ColdCamel said:

(...) The problem is that fingerprint scanner generates error immediately when I try to add a finger, and GPS doesn't seem to work. Another problem is that I cannot connect USB debugging (for adb logcat) because the phone is in a reconnecting USB loop (not the cable, rebooted PC, etc - on stock OS it worked, now it doesn't) (...)

Small update and good news!: fortunately it doesn't seem to be /persist related, because I reinstalled LineageOS 20, stock Android 2.1.12, 2.1.15 and 2.1.17 beta, and there everything works, except LineageOS 20 latest build (20230622?) where there are errors with fingerprint. DivestOS is based on LineageOS, and it was also latest build.

So this just seems to be LineageOS-related and my sensors keep working. That's why I reported this on the official XDA forum thread for Pro1x LineageOS, so if anyone is interested you can follow it there:

https://forum.xda-developers.com/t/official-lineageos-20-for-pro1-x.4543997/page-7#post-88687101

The USB problem was only on DivestOS, so I will get back to this later, and anyway it is not important in this thread.

Edited by ColdCamel
  • Thanks 2
Link to post
Share on other sites
  • 1 month later...

I am able to connect via adb and was able to pull /dev/block/sda2 . Is it normal to be about 40MB? Is there another partition for userdata and modem? I had run into issues when using the command below via terminal:

  • adb shell find /dev/block/platform -name “by-name” -exec ls -Al -Z –color {} \;

and this error comes up:

find: -exec without \;

How can I see which partition is used for userdata. I am able to see where the directory is when I run :

adb shell find /dev/block/platform ls

which lists all the files in "by-name" below including userdata:

/dev/block/platform/soc/4804000.ufshc/by-name/userdata

I want to be able to backup entire system, modems, userdata, and etc . Do you need to back them up by file or is there a partition that includes them all?

Does anyone know how to proceed?

Edited by mangled
Link to post
Share on other sites
  • 3 weeks later...

hi

After using lineageos, i would like to return to stock android.

I followed the steps from here 

 

but when i launch the script under git terminal, i get en error (not the one listed on the pdf) 

Quote

./QX1050_otaflash_win.sh
QX1050 fastboot flash tools
Creating 'checkparti_a'                            FAILED (remote: 'Not enough space for partition')
fastboot: error: Command failed
update fastboot binary

why ? and how can i fix that ?

Link to post
Share on other sites
21 minutes ago, guss said:

hi

After using lineageos, i would like to return to stock android.

I followed the steps from here 

 

but when i launch the script under git terminal, i get en error (not the one listed on the pdf) 

why ? and how can i fix that ?

@Caseymay be able to help you

Also: 

 

Edited by MonCon
Link to post
Share on other sites
On 8/12/2023 at 11:38 AM, mangled said:

I am able to connect via adb and was able to pull /dev/block/sda2 . Is it normal to be about 40MB? Is there another partition for userdata and modem? I had run into issues when using the command below via terminal:

  • adb shell find /dev/block/platform -name “by-name” -exec ls -Al -Z –color {} \;

and this error comes up:


find: -exec without \;

How can I see which partition is used for userdata. I am able to see where the directory is when I run :

adb shell find /dev/block/platform ls

which lists all the files in "by-name" below including userdata:

/dev/block/platform/soc/4804000.ufshc/by-name/userdata

I want to be able to backup entire system, modems, userdata, and etc . Do you need to back them up by file or is there a partition that includes them all?

Does anyone know how to proceed?

Anyone able to backup userdata?

Link to post
Share on other sites
On 8/29/2023 at 10:51 PM, MonCon said:

@Caseymay be able to help you

Also: 

 

thanks

Finaly, I flashed stock rom using QFIL

But i haven't seen "Various ROMs available to the Pro1/Pro1X available for download, Links" before my first OS change, and i see, we have to backup the persist partition. How can we do that backup, It's possible to do that with adb ?

What 's containing this partition ?

 

Link to post
Share on other sites

@guss don't think LineageOS affects your persist partition, and you only need to back it up if you are going away from an Android based OS, such as Sailfish or Ubuntu Touch, and intend to return to Android one day.  There is some guidance and associated links for backup in the 'Various ROMs available' thread, but I've never used them, so I can't comment on how easy or effective the methods are.
Just out of curiosity, why are you leaving LineageOS?  

Link to post
Share on other sites

 

17 hours ago, MonCon said:

@guss Also: 

 

ok thanks

17 hours ago, MonCon said:

@guss don't think LineageOS affects your persist partition, and you only need to back it up if you are going away from an Android based OS, such as Sailfish or Ubuntu Touch, and intend to return to Android one day.  There is some guidance and associated links for backup in the 'Various ROMs available' thread, but I've never used them, so I can't comment on how easy or effective the methods are.
Just out of curiosity, why are you leaving LineageOS?  

I m leaving lineagos only for some tests related to my calls problems

It lineageOS fix lots of issues you can have in the stock Android (like fingerprint sensor acting like "F5" that refresh web page when you touch it )

And i think the NFC not working (but i don't have other device that support that, only access cards but i don't know if they arr compatible so i'm not sure)

I so some advice like "WARNING: Make sure that you can send and receive SMS and place and receive calls (also via WiFi and LTE, if available), otherwise it won’t work on LineageOS either! Additionally, some devices require that VoLTE/VoWiFi be utilized once on stock to provision IMS." https://wiki.lineageos.org/devices/pro1x/install

So i want to test again on stock android.

I don't know if we have to do that to activate/configure/update drivers or only to say if it doesn't work on android, it won't work on LOS.
Before having the pro1x i have a redmi that a flash to LOS, but whitout updating andoroid befor flash, and lots of sensor didn't work. After relashing stock, android, updateing it, and reflashing LOS all sensors worked.

 

Link to post
Share on other sites
  • 3 months later...
2022 年 8 月 13 日上午 6:10,sspiff 说:

 

 

On 8/13/2022 at 6:10 AM, sspiff said:

Thanks for all your research @mosen!

Unfortunately, I tried this and now my device is no longer booting into Android at all now. I haven't been able to get into recovery or fastboot mode since, only EDL mode.

When I try running EDL, it says the device is in memory dump mode and starts dumping memory from the phone. I am able to get back into the EDL flashing mode some of the time.

Behavior when booting is first showing the Powered by Android logo, then black screen. Sometimes the logo is there for quite a while.

I have an unaltered copy of my persist partition on my work PC, but for now it's late and I'm calling it for tonight.

My situation is the same as yours, did you solve it later? If it's solved, can you tell me how? Thanks.

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