Backup persist partition without unlocked bootloader? - OnePlus 8 Questions & Answers

I've read advice to backup persist partition before making any changes to the device but I can't seem to access that partition without root(?) or something like a custom recovery, both of which require unlocked bootloader (even if only to run the recovery and not flash it).
Is there any way to back up persist partition on a locked bootloader? Does it matter if I never set up my fingerprint?

mynameis8 said:
I've read advice to backup persist partition before making any changes to the device but I can't seem to access that partition without root(?) or something like a custom recovery, both of which require unlocked bootloader (even if only to run the recovery and not flash it).
Is there any way to back up persist partition on a locked bootloader? Does it matter if I never set up my fingerprint?
Click to expand...
Click to collapse
try MSMtool readback function. google it pls

Although it does require bootloader unlock, I found it is possible to backup the persist partition without rooting and without installing anything by using TWRP:
* find a TWRP that is compatible with your phone
* fastboot boot <twrp.img>
Even though that's not a root tool, it makes partitions available such as boot, recovery and persist partitions for backup either via the "dd" command (in adb shell) or by "adb pull"

Related

[Q] Prevent CWM start from Bootloader?

With CM7 installed I am able to start CWM from bootloader by selecting "RECOVERY". Clockworkmod recovery itself has full adb support, so everyone who has stolen / found my Nexus S can gain full root access via USB simply by rebooting into CWM.
Is there a way to prevent this? Or a CWM version without adb support?
I'm worried about my google/dropbox/mail account - is adb root access for everyone with a simple USB cable a security issue?
I don't it's a good idea, but if the recovery partition contains only recovery, then you can format the recovery partition to prevent from booting it. Then keep your bootloader locked, so the only way to get access to the phone is to unlock the bootloader, which will wipe the phone clean.
Don't try it unless you are 100% sure though, I've read another guy whose brother formatted every partition in the phone, and the phone became bricked with no fastboot mode as well. I don't know which partition contains fastboot mode.

[Q] How to backup after htcdev.com UNLOCKED SHIP S-ON

Ultimately I wish to install custom ROMs but first I would like to make sure I understand what I'm doing.
I would like to do an Nandroid backup before changing any partition, however after the official unlock my device still doesn't meet the requirements for Nandroid - the recovery I've got doesn't have adbd and busybox - and I cannot fastboot flash a new recovery unless the device is ENG S-OFF. Neither can I boot from a custom image in fastboot, it just says "FAILED (remote: not allowed)". So what are my options if I want to backup of my boot, recovery and system partitions, without having to overwrite them first.
Your comments are much appreciated.
After using HTC unlock my device was wiped clean. Didn't know before everything would be gone. Is there a way to backup before?
Tapa2 desire s

Internal Storage: Recover lost download folder images without root?

is there any way to recover deleted images without having root or unlocking boot loader? my phone is a moto g xt1042 running lolipop. i hear unlocking bootloader wipes your phone clean making recovery impossible? can someone please assist.
Without root, you are limited to the data recovery apps available on Google Play. In future, at least unlock bootloader if possible - so you give yourself a lot more options for getting out of trouble.
Edit: With phone connected to PC / Laptop - perhaps you can use data recovery software to scan internal storage and recover the files.
lost101 said:
Without root, you are limited to the data recovery apps available on Google Play. In future, at least unlock bootloader if possible - so you give yourself a lot more options for getting out of trouble.
Edit: With phone connected to PC / Laptop - perhaps you can use data recovery software to scan internal storage and recover the files.
Click to expand...
Click to collapse
Very unlikely in MTP, most if not all recovery software won't even see the storage.
liveroy said:
Very unlikely in MTP, most if not all recovery software won't even see the storage.
Click to expand...
Click to collapse
I'd even say impossible. MTP allows no access to the raw storage, only to "objects" (usually files).
So if you want the photos, you are left with one option: unlock bootloader, flash TWRP and dump the userdata partition. Unlocking will erase userdata but that doesn't mean data recovery won't be able to restore the images.
Related: http://forum.xda-developers.com/showpost.php?p=64171086&postcount=2
lost101 said:
So if you want the photos, you are left with one option: unlock bootloader, flash TWRP and dump the userdata partition. Unlocking will erase userdata but that doesn't mean data recovery won't be able to restore the images.
Click to expand...
Click to collapse
If unlocking does the erasing right as it is implemented in AOSP's recovery, it uses secure erase (BLKSECDISCARD), which makes all previous data inaccessible.
_that said:
If unlocking does the erasing right as it is implemented in AOSP's recovery, it uses secure erase (BLKSECDISCARD), which makes all previous data inaccessible.
Click to expand...
Click to collapse
Perhaps you are correct, but I have done the unlock erase myself. It takes seconds, and my perspective is that unless the data has actually been overwritten - there is still a chance of recovery.
At this point what is there to loose? and at least with an unlocked bootloader, OP won't be in this situation again.

Booting TWRP Advice

HTCDreamOn said:
A word of advice: I strongly recommend temporarily booting any images (be it recoveries or kernels) you are about to flash to your device. This is simply a case of using the command "fastboot boot blahblah.img" whether blahblah.img is a recovery or kernel.
Click to expand...
Click to collapse
We know you can boot to TWRP vice flash to your device by using the command:
Code:
fastboot boot twrp.img
But how do you proceed from here? Are you required to use ADB commands at this point or can you unplug your USB cable and use TWRP as if it was installed, I.E. , back up current ROM, and install new zip.
purplepizza said:
We know you can boot to TWRP vice flash to your device by using the command:
Code:
fastboot boot twrp.img
But how do you proceed from here? Are you required to use ADB commands at this point or can you unplug your USB cable and use TWRP as if it was installed, I.E. , back up current ROM, and install new zip.
Click to expand...
Click to collapse
Sorry if I wasn't clear. Yes you can unplug usb and use as normal, it just means twrp isn't flashed to the device so it won't be there when you reboot.
I just recommend this step because I'm paranoid. Once you've confirmed the image works you should reboot to bootloader and fastboot flash the image, then you'll be able to boot into twrp whenever you want.
HTCDreamOn said:
Sorry if I wasn't clear. Yes you can unplug usb and use as normal, it just means twrp isn't flashed to the device so it won't be there when you reboot.
I just recommend this step because I'm paranoid. Once you've confirmed the image works you should reboot to bootloader and fastboot flash the image, then you'll be able to boot into twrp whenever you want.
Click to expand...
Click to collapse
This is a good step to do, and if the device supports it it should be used... for example the Moto G (if unlocked) fully supports fastboot boot commands, devices like the HTC One M7 do NOT support this anymore...
To the OP, what is really happening here is that TWRP or the boot.img (kernel) is being loaded from USB into RAM and executed normally, instead of the standard /boot partition which is skipped when executing fastboot boot. TWRP (and recovery in general) is really just a specialized micro-sized android distribution and when started via fastboot boot is executed as if it was the boot image. Once the image is transferred into RAM, the boot continues normally per the instructions of TWRP or the boot image, and no further action via USB is required. USB is just the medium to load the image into RAM and nothing more.
fastboot boot - used to manually load a boot image (or recovery) and execute from RAM, it is not flashed to the device, on the next reboot it will return to it's previous state
fastboot flash boot/recovery - used to actually flash the boot image or recovery image to the it's appropriate partition on the device, it does not execute it. On a reboot or factory default this information will stay in the device.
acejavelin said:
This is a good step to do, and if the device supports it it should be used... for example the Moto G (if unlocked) fully supports fastboot boot commands, devices like the HTC One M7 do NOT support this anymore...
To the OP, what is really happening here is that TWRP or the boot.img (kernel) is being loaded from USB into RAM and executed normally, instead of the standard /boot partition which is skipped when executing fastboot boot. TWRP (and recovery in general) is really just a specialized micro-sized android distribution and when started via fastboot boot is executed as if it was the boot image. Once the image is transferred into RAM, the boot continues normally per the instructions of TWRP or the boot image, and no further action via USB is required. USB is just the medium to load the image into RAM and nothing more.
fastboot boot - used to manually load a boot image (or recovery) and execute from RAM, it is not flashed to the device, on the next reboot it will return to it's previous state
fastboot flash boot/recovery - used to actually flash the boot image or recovery image to the it's appropriate partition on the device, it does not execute it. On a reboot or factory default this information will stay in the device.
Click to expand...
Click to collapse
Thanks. So it seems there is no reason to ever flash TWRP unless you don't want the PC dependence to use the TWRP tool.
purplepizza said:
Thanks. So it seems there is no reason to ever flash TWRP unless you don't want the PC dependence to use the TWRP tool.
Click to expand...
Click to collapse
Well, sort of... but the point is once you flash anything via twrp, you are no longer stock, so why not flash twrp to make it easier to flash other things?
The smartest thing would be to unlock, boot TWRP, make a nandroid backup before you do anything at all, then flash TWRP and do your thing...
acejavelin said:
Well, sort of... but the point is once you flash anything via twrp, you are no longer stock, so why not flash twrp to make it easier to flash other things?
The smartest thing would be to unlock, boot TWRP, make a nandroid backup before you do anything at all, then flash TWRP and do your thing...
Click to expand...
Click to collapse
I understand what you are saying. The only flash I planned on was SuperSU. I thought when a system upgrade is available, I could simply use SU to unroot and be ready for the update. Would this work?
If I followed your recommendation, could I feasibly, flash TWRP, then when an upgrade is ready, flash nandroid backup (which I assume removes TWRP) then accept system update, then re-flash TWRP. I could restore apps by using TB. Does this make sense? Or does TWRP remain in place after flashing nandroid backup?
purplepizza said:
I understand what you are saying. The only flash I planned on was SuperSU. I thought when a system upgrade is available, I could simply use SU to unroot and be ready for the update. Would this work?
If I followed your recommendation, could I feasibly, flash TWRP, then when an upgrade is ready, flash nandroid backup (which I assume removes TWRP) then accept system update, then re-flash TWRP. I could restore apps by using TB. Does this make sense? Or does TWRP remain in place after flashing nandroid backup?
Click to expand...
Click to collapse
TWRP remains in place after restoring a nandroid (I think, I haven't installed on my Moto G, but in most devices it doesn't backup/restore recovery), but you can easily restore the original recovery via fastboot.
acejavelin said:
TWRP remains in place after restoring a nandroid (I think, I haven't installed on my Moto G, but in most devices it doesn't backup/restore recovery), but you can easily restore the original recovery via fastboot.
Click to expand...
Click to collapse
Just curious, how did you go from 5.1.1 to 6.0?
purplepizza said:
Just curious, how did you go from 5.1.1 to 6.0?
Click to expand...
Click to collapse
OTA... part of soak test on December 22.
acejavelin said:
OTA... part of soak test on December 22.
Click to expand...
Click to collapse
Hey thanks for helping to answer this, your explanation was much better I thought it had something to do with loading into RAM but wasn't sure. I didn't know some devices don't allow fastboot boot commands though, I've always relied on them. Part of the reason I'm avoiding htc now.
@purplepizza I agree with everything acejavelin has said: essentially you really do want to make sure your have twrp flashed.
To answer your nandroid question: It basically just takes an image of the partitions you choose, usually /system, /data, and /boot (where kernel stuff is) which is the least you need to boot back with all your data. It doesn't backup recovery and when you restore it doesn't write anything to recovery, so yes twrp will still be in place. In general you should only ever flash stuff to the recovery partition whilst in fastboot mode (i.e. using fastboot flash recovery recovery.img), I know on some devices you can flash recoveries as zip files in the recovery itself but you shouldn't.
I've seen quite a few people querying about the 6.0 OTA: in short, I wouldn't worry about it because once they start rolling out, people always catch the OTA and post here on xda. You can flash that and it'll return you to stock 6.0 anyway, at which point you can reroot and everything if you want.
acejavelin said:
Well, sort of... but the point is once you flash anything via twrp, you are no longer stock, so why not flash twrp to make it easier to flash other things?
The smartest thing would be to unlock, boot TWRP, make a nandroid backup before you do anything at all, then flash TWRP and do your thing...
Click to expand...
Click to collapse
One more question, when making the first nandroid backup. do you just back up system and data or do you include boot as well?
purplepizza said:
One more question, when making the first nandroid backup. do you just back up system and data or do you include boot as well?
Click to expand...
Click to collapse
My opinion is always backup everything, you can always choose what to restore
Sent from my MotoG3 using Tapatalk
acejavelin said:
My opinion is always backup everything, you can always choose what to restore
Sent from my MotoG3 using Tapatalk
Click to expand...
Click to collapse
So what is boot? I know I am kind of going back to my previous question, but if I restore boot, is that the boot loader? I would assume this would not commonly need restored?
And I now assume the bootloader is completely independent from recovery.
purplepizza said:
So what is boot? I know I am kind of going back to my previous question, but if I restore boot, is that the boot loader? I would assume this would not commonly need restored?
And I now assume the bootloader is completely independent from recovery.
Click to expand...
Click to collapse
It is not the bootloader... It is the /boot partition of the phone, basically the kernel and RAM disk. If you screw things up and need to restore, you typically want to restore /boot, /system, and /data, and occasionally /cache (if you want to restore to save time and get an exact duplicate of the previous image, otherwise many people skip /cache and let it rebuild on the first boot which takes 10-15 minutes extra).
acejavelin said:
Well, sort of... but the point is once you flash anything via twrp, you are no longer stock, so why not flash twrp to make it easier to flash other things?
The smartest thing would be to unlock, boot TWRP, make a nandroid backup before you do anything at all, then flash TWRP and do your thing...
Click to expand...
Click to collapse
HTCDreamOn said:
@purplepizza I agree with everything acejavelin has said: essentially you really do want to make sure your have twrp flashed.
Click to expand...
Click to collapse
So I am following your advice. I booted to TWRP, made Nandroid backup.
Rebooted and flashed TWRP, see below:
Code:
sudo fastboot flash recovery twrp.img
target reported max download size of 268435456 bytes
sending 'recovery' (7772 KB)...
OKAY [ 10.635s]
writing 'recovery'...
OKAY [ 0.141s]
finished. total time: 10.776s
All seems OK.
Scrolled to recovery, selected recovery. TWRP was there. I then powered down.
After that I held power and volume down, system boots to dead Android with message “No command” Held power then volume up, I see stock boot loader. Is TWRP flashed somewhere or is it gone? So what did I do wrong.
purplepizza said:
So I am following your advice. I booted to TWRP, made Nandroid backup.
Rebooted and flashed TWRP, see below:
Code:
sudo fastboot flash recovery twrp.img
target reported max download size of 268435456 bytes
sending 'recovery' (7772 KB)...
OKAY [ 10.635s]
writing 'recovery'...
OKAY [ 0.141s]
finished. total time: 10.776s
All seems OK.
Scrolled to recovery, selected recovery. TWRP was there. I then powered down.
After that I held power and volume down, system boots to dead Android with message “No command” Held power then volume up, I see stock boot loader. Is TWRP flashed somewhere or is it gone? So what did I do wrong.
Click to expand...
Click to collapse
I have no idea, you did it right... selecting recovery from the bootloader should start TWRP, not stock recovery, that should be gone.
acejavelin said:
I have no idea, you did it right... selecting recovery from the bootloader should start TWRP, not stock recovery, that should be gone.
Click to expand...
Click to collapse
Any recommendations how to proceed?
I also need help with my soft bricked moto g3
Moto g3 (xt 1550, Indian dual sim 16 gb version)
I officially upgraded to 6.0.0 via ota and my objective was to root my phone and use xposed modules. I am not interested in any other custom rom (I'd rather keep stock rom just for moto display and ota upgrades) or custom recovery like twrp(I'm afraid it may cause ota upgrades to fail).
I used the method described here in the question- http://android.stackexchange.com/qu...rsu-using-play-store-versus-a-custom-recovery
So I first successfully unlocked my bootloader using the official motorola method.
I then proceeded to use google's backup settings to re-install all the apps that were uninstalled due to unlocking the bootloader. I also put supersu.zip version 2.46 on internal sd card.
I then proceeded to (without rebooting) enter fastboot where i used minimal adb to temporarily boot into twrp version2.8.7 r5 (link - http://forum.xda-developers.com/2015-moto-g/orig-development/twrp-twrp-moto-g-2015-t3170537 ).
Once in twrp, I located and flashed the supersu.zip. It flashed successfully. I procceded to clear dalvik cache and then after clearing cache I tried to reboot my phone using twrp.
However, it did not go beyond the "Warning - Bootloader Unlocked" screen that you get on unlocking a motorola bootloader. I left it for over 10 minutes (usb was still plugged in, I had >80% battery) but it did not proceed.
Long -pressing the power button causes the phone to vibrate and again attempt to boot, stuck at the same initial screen. Adb quite understandably does not work here.
I can press vol down+power and enter fastboot , where adb works fine.
I can enter stock recovery from the fastboot sceen too.
Using adb in fastboot, I am able to boot twrp . In fact, I tried to re-install supersu.zip. I retried version 2.46 and then tried version 2.56. On all occcassions, it was able to successfully flash it, but gets hung on the initial boot screen.
USB Debugging is also enabled, and I have a backp of my sd card data.
I tried taking a backup of the system and apps in twrp (3 gb in total) and tried to reflash it, but it still hangs at the same screen.
Is there any way I can unbrick my device and- (in decreasing order of preference)
1. Keep my stock rom and recovery?
2. Keep stock rom with twrp? (It should not be a problem)
3. Custom rom with custom recovery - perhaps official cm. Least preferred as I want Moto Display and stock/vanilla android.
Also, is SELinux involved anywhere with my phone getting bricked? I also read that a custom kernel is required for rooting 6.0, which I don't have. Supersu Version 2.56 is said to prevent soft bricks if the kernel is incorrect (systemless root), yet even after flashing the newer one it is still bricked. Where am I going wrong? What should I do? Thanks in advance! :good:
purplepizza said:
Any recommendations how to proceed?
Click to expand...
Click to collapse
Try the flash again? Sorry, but I don't really know help... if you are successfully rooted, perhaps try to flash TWRP image with Flashify? (select your file, don't let it auto-grab an image)
acejavelin said:
Try the flash again? Sorry, but I don't really know help... if you are successfully rooted, perhaps try to flash TWRP image with Flashify? (select your file, don't let it auto-grab an image)
Click to expand...
Click to collapse
I have not rooted yet. I guess I can try by booting TWRP then flashing SuperSU.
Can you think of any reasons not to try fastboot again the re-flash TWRP?

Phone bricked when trying to flash stock bootloader - which should be what it had already? Help!

So a while back I unlocked and rooted my phone. I did something wrong the first time around and it bricked, so I started from scratch and flashed a stock firmware image, then installed Magisk. I used TWRP, but did not install it. No problems, except the OTA updates don't work, and the phone constantly nags me about it. I had a similar problem on a prior phone (Moto G4+) when the recovery partition was modified, and flashing back to stock fixed it on that phone. I finally get around to trying to fix this, figured Magisk did something to either boot or bootloader, so I re-flash boot.img and bootloader.img using the same images and instructions I originally used to flash my phone. boot.img fails claming bad signature, but bootloader.img succeeds. Now my phone will not successfully boot and claims it needs a factory reset. If I boot to TWRP, I can decrypt and see my data is intact (I explicitly chose not to encrypt my phone for this exact reason but *shrug*). If I install TWRP, it only boots to a TWRP screen and will not accept touch input. Booting TWRP from fastboot functions normally.
So basically, my data is intact. I want it to remain intact. My bootloader is mad at me. What do I do?
I have tried flashing the bootloader.img from multiple versions of the stock ROM and all of them have the same result. Using 'fastboot flash bootloader bootloader.img'
My only theory is that the key was written to the bootloader and flashing stock it doesn't have that key, but that doesn't make sense because what's the point of encryption then (see: I explicitly did not want my phone encrypted).
Update: I was able to fix it and retain all my data by using LMSA to recover it, but I edited the flashfile.xml to remove the step where it wipes userdata.

Categories

Resources