[REQUEST] ZS570KL (64G) partition dump / aboot - Asus ZenFone 3 Deluxe Questions & Answers

I would appreciate if someone would do the following in a rooted adb shell session:
1: print the list of partitions tables via busybox parted applet (& paste it here)
Do so in both sectors & bytes by selecting "unit s" & "unit B" in parted.
2: dump (via dd) & upload all partitions to google drive.
system, boot, cache & userdata are not needed.
I'm specifically looking for the aboot/emmc_appsboot partition

Related

[How to] Determine dd Parameters For All LG G4 Models

[How to] determine dd parameters for all LG G4 models
IMPORTANT:
Only for advanced users!
You are an advanced user if you know exactly what you are doing.
You are an advanced user if you know what to do if something went wrong.
You are NOT an advanced user if you know how to do copy+paste.
You can bring your smartphone into a state, so it no longer works.
I am not responsible for anything. The following instructions are only suggestions.
Hello,
everyone knows how to root the LG G4 with the "low effort root" method.
They copied the system partition to an ".img" file, rooted it and copied it back to the "system" partition.
Many users wonder how to get the right parameters for the "dd" commands.
Please read the complete guide and be sure that you understand it until you execute a command!
Information:
Code:
dd if=/inputfile bs=8192 count=12345 of=/outputfile
if = Input File
of = Output File
bs = Blocksize in bytes (default is 512 - to increase copy speed use multiple of 512 e.g. 8192)
count = how many blocks
skip = skip blocks before start reading
seek = skip blocks before start writing
more info: http://man7.org/linux/man-pages/man1/dd.1.html
There are different models of the LG G4 on the market.
We know that the system partition is different depending on the model of the G4.
As an example I will show you how to calculate the parameters for the LG G4 H815 (International Model).
What you need:
Windows with Send_Command.exe
Instructions:
At first we need to know where the "system" partition starts (first sector) and how big it is (partition size).
I used the first method to find these values. But I recommend the second method because it's easier.
First method (difficult method, extracting the GPT and using "gdisk" in linux to read the partition info)
What you need:
Linux with "gdisk" installed
Instructions:
Put your smartphone to "Download Mode" and connect it to the Send_Command.exe command prompt.
We need to copy the partition table to the internal storage.
The partition table of GPT (GUID Partition Table) has a size of 16384 bytes and starts at LBA2.
Each LBA has a size of 512 bytes. Because we start at LBA0 we need to add 1024 bytes.
In summary 16384 + 1024 = 17408 (bytes).
Execute the following command:
Code:
dd if=/dev/block/mmcblk0 bs=1 count=17408 of=/data/media/0/gpt_backup.img
Enter "LEAVE" to restart your phone.
You will find the (very small) file "gpt_backup.img" on your internal storage.
Switch to Linux:
Copy the file to your Linux and open the terminal. Then type this:
Code:
gdisk /yourpath/gpt_backup.img
Some warnings will occur. Ignore them.
You will see:
Code:
Command (? for help):
Enter "p" and hit "enter".
You will get a list of the partitions.
Scroll up a bit and check that you see:
"Logical sector size: 512 bytes"
Scroll down and look for the "system" partition.
You will find a line similar to this:
Code:
47 884736 9363455 4.0GiB FFFF system
Now you know the number of the "system" partition is "47".
You will see:
Code:
Command (? for help):
Type "i" and hit "enter".
You will be asked the partition number.
Enter it and hit "enter".
You will see something conatining lines similar to this:
Code:
First sector: 884736
Last sector: 9363455
Partition size: 8478720
Partition name: 'system'
We need the values from "First sector" and "Partition size".
Second method (easier method, just using "adb shell" to read the partition info)
What you need:
adb shell
usb debugging enabled
To get the "logical sector size" use:
cat /sys/block/mmcblk0/queue/logical_block_size
It should be 512
smason said:
To find in any smartphone the offset and the size of /system:
$ adb shell
[email protected]:/ $ ls -la /dev/block/bootdevice/by-name/system
ls -la /dev/block/bootdevice/by-name/system
lrwxrwxrwx root root 2015-01-02 10:50 system -> /dev/block/mmcblk0p47
[email protected]:/ $ cd /sys/block/mmcblk0/mmcblk0p47
cd /sys/block/mmcblk0/mmcblk0p47
[email protected]:/sys/block/mmcblk0/mmcblk0p47 $ cat start
cat start
884736
[email protected]:/sys/block/mmcblk0/mmcblk0p47 $ cat size
cat size
8478720
[email protected]:/sys/block/mmcblk0/mmcblk0p47 $
so:
offset = 512 * 884736 = 452984832
partition size = 512 * 8478720 = 4341104640
Cheers!
Click to expand...
Click to collapse
So "first sector" is the value from "cat start" (884736).
The "partiton size" is the value from "cat size" (8478720).
Now the mathematics (using the values from above):
Logical sector size = 512 (I never saw something different on LG G4 smartphones)
Assuming bs=8192
skip and seek: "First sector" * "Logical sector size" / bs
884736 * 512 / 8192 = 55296
count: "Partition size" * "Logical sector size" / bs
8478720 * 512 / 8192 = 529920
That was an example for the H815 (International Model).
Use your own values to calulate the "dd" parameters!
Back to Windows:
Put your smartphone to "Download Mode" and connect it to the Send_Command.exe command prompt.
Now you can copy your "system" partition to "system.img" with the following command:
Code:
dd if=/dev/block/mmcblk0 bs=8192 skip=55296 count=529920 of=/data/media/0/system.img
Replace the values with the ones you calculated for your model!
Now you could copy the "system.img" to your Linux and root it or do everything else you want.
Important: Do NOT delete the original "system.img" from your internal storage as long as you are not 100% sure your G4 is stable.
If your modifications don't work, you can copy back the original "system" partition (with "dd").
To copy the modified "system_changed.img" back to the "system" partition use the following command:
Code:
dd if=/data/media/0/system_changed.img bs=8192 seek=55296 count=529920 of=/dev/block/mmcblk0
Replace the values with the ones you calculated for your model!
Important: Be sure to use "skip" when reading and "seek" when writing.
The "dd" command should take about a minute.
Did the instructions help you?
Please give a "Thanks!"
Thank you
Hi,
thanks for this great post.
I just have one question. With your formulas and using 8K block size, I get a floating point number as result. So I used a block size of 4K instead, and I get an even number. This seems better to me so I went with it, as I believe smaller block sizes are always ok?
I'm just wondering one thing which seems not right to me. My system partition is reported to be 2.5GB:
Partition number (1-42): 39
Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Microsoft basic data)
Partition unique GUID: A8725BAA-9E45-B2F8-8FA3-8C972F60F0CF
First sector: 836608 (at 408.5 MiB)
Last sector: 6074573 (at 2.9 GiB)
Partition size: 5237966 sectors (2.5 GiB)
Attribute flags: 1000000000000000
Partition name: 'system'
So with the formulas:
FACTOR 512 / 4096 = 0.125
skip and seek: "First sector" * "Logical sector size" / bs
836608 *FACTOR = 104576
count: "Partition size" * "Logical sector size" / bs
8478720 * FACTOR = 1059840
If I now run the dd command:
dd if=/dev/block/mmcblk0 bs=4096 skip=104576 count=1059840 of=/storage/external_SD/system.img
I get a file system.img which is 4096 MB. Should it not be 2.5GB as my original system partition?
If I use bs=512 (the default) and type
dd if=/dev/block/mmcblk0 bs=512 skip=836608 count=8478720 of=/storage/external_SD/system.img
I get a system.img of the right size (bit over 2.5GB).
I think the block size to use for "skip" is to be specified with the option ibs=XXX, not bs=XXX which only applies to "count" (according to man dd). I tried the ibs option, but the command then just doesn't work on Send_Command.exe. It doesn't even print an error but simply returns immediately.
Cheers
Jen
Hi,
which phone do you have?
Your calculation seems wrong. It's ok to use BS with 4k. I could be a bit slower then 8k, but that doesn't matter.
BUT: Look at your "count" value. Your partition size is 5237966. You used 8478720 (the value from my G4(H815EU) example). Thats wrong!!!
How to calculate with 1k and your values:
bs=1024
skip=836608*512/1024=418304
count=5237966*512/1024=2618983
Please check my calulation!!!
It's interesting, that the Send_Command shell has access to your external sd card...
I think the block size to use for "skip" is to be specified with the option ibs=XXX, not bs=XXX which only applies to "count" (according to man dd).
Click to expand...
Click to collapse
No. "bs" is the right parameter.
If you use "bs" it sets "ibs" and "obs" to the value of "bs".
Just do "dd --help" on a linux system for more details.
Hi Dominik,
oh my, how embarrassing I actually did take the wrong value from the example you posted. I used my value (the 5237966) for calculating the parameters with bs=8K, and got a floating value, so tried 4K instead... and the wrong value must have snug in. Oups.
I also get floating value on 4K now that you've pointed my mistake out:
5237966 * 512/4096= 654745.75
If I rounded this up, would this not mean that I copy a tiny bit of the next partition on the image? And if I then use the image to restore, would I not run the risk to damage something in the following partition?
Anyway, it's not a huge drama as I can just use bs=512 and it works.
Yes I have access to the SD card, the image also has copied there successfully. I was also surprised because I read in the forums that it's not possible.
I found it out with the "df" command, as the SD was listed there. I needed to use it because there's no room on my internal storage (it's a ridiculous 8GB on the LG H735) to store the image there.
My system partition is only 2.5GB so I don't think I have to reformat, but you are right it would be better to use ext4.
Ok
I removed my information about formatting the sd card.
You dont't have to format it. FAT32 is ok.
So you can use your sd card on systems which don't support ext4 too.
I have the LG G4S (H735). It's unusable without rooting as it only has 8GB internal memory. That's why I'm trying to root it now.
jen.magnolis said:
I have the LG G4S (H735). It's unusable without rooting as it only has 8GB internal memory. That's why I'm trying to root it now.
Click to expand...
Click to collapse
Ok, good luck.
Please open a new thread if you have questions about rooting your phone.
Or is there already one? Maybe these?
http://forum.xda-developers.com/g4/help/rooting-lg-h735-g4-beat-t3192491
http://forum.xda-developers.com/g4/general/lg-g4s-world-root-lg-devices-t3231759/page7
Oh. Just saw that you are already there
dominik-p said:
Ok, good luck.
Please open a new thread if you have questions about rooting your phone.
Or is there already one? Maybe these?
http://forum.xda-developers.com/g4/help/rooting-lg-h735-g4-beat-t3192491
http://forum.xda-developers.com/g4/general/lg-g4s-world-root-lg-devices-t3231759/page7
Oh. Just saw that you are already there
Click to expand...
Click to collapse
I just created a new thread too to focus on the particular problem I have:
http://forum.xda-developers.com/g4/general/rooting-lg-g4s-h735-t3243549
this guide helped in dumping boot and recovery partitions.
thank you very much sir! i successfully dumped my boot and recovery partition using dd in my mediatek device by following your guide.
sparksthedev said:
thank you very much sir! i successfully dumped my boot and recovery partition using dd in my mediatek device by following your guide.
Click to expand...
Click to collapse
Congratulations
Did you use the first (more komplex) oder the second method for your device?
I saw that you had problems in this thread:
http://forum.xda-developers.com/showthread.php?p=65907557#post65907557
And you wrote a guide for MTK devices here:
http://forum.xda-developers.com/general/general/guide-dumping-boot-img-recovery-img-t3339530
This doesn't work with the LG G4, but I think it will help many others.
Thank you
My sister asked me to root her phone. It seems more complicated than anything I did in the past (HTC Wildfire, Galaxy Core Plus, Xperia M4A).
I tried this tutorial and it kinda worked, but I can't mount image I got, so it's useless (image, not tutorial!).
Phone is LG-H736 (Beat). I got this result in gdisk:
Code:
Partition number (1-42): 39
Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Microsoft basic data)
Partition unique GUID: A9520AE6-ABC6-F107-E8FE-B37C4C30CB77
First sector: 836608 (at 408.5 MiB)
Last sector: 6074573 (at 2.9 GiB)
Partition size: 5237966 sectors (2.5 GiB)
Attribute flags: 1000000000000000
Partition name: 'system'
The 8K bs gave me floating point result, so I used 0,5K.
So the dd command were:
Code:
dd if=/dev/block/mmcblk0 bs=512 skip=836608 count=5237966 of=/storage/external_SD/system.img
BTW, I had access to SDCard and I didn't need to open ports...
EDIT: I got the system.img. The problem was I haven't got enough space on SD card.
But now I bricked it...
https://forum.xda-developers.com/g4/help/softbricked-g4-beat-lg-h735-t3959237

[NooB Guide] Increase Internal Storage of XS/XSL

Attention!​ I know there are already some posts about it. If you find it annoying PLEASE ignore this post. Do Not bother to comment. Just Ignore it.​
Disclaimer: I'm Not Responsible for Anything. If you wish do it as your own risk.​
These things are goning to happen
For the reason of Formating data will be lost - So backup everything to PC
You'll lose google sign in, contacts, messages, social networking etc. - backup before proceed
Things You will Need
Drivers - For Detecting your device properly (Sony Users can use "Flashtool")
ADB - Use mini version. You don't have to install Android SDK for this
USB Cable
CMD - Use "ConEmu" or "Console2" more flexible than cmd. Provides easy copy of text from console
TWRP Recovery - Download it from twrp site
I'm Going to put this assuming you as Novice. So I'll Explain as much as possible
Step 1 -
* Installing flashtool
Download flashtool from the link given above
Install flashtool as usual.
Then from "C:\Flashtool\drivers" install drivers for your phone.
Open Flashtool (Keep it open for this step)
* Phone Detection
After installing drivers - enable "USB debugging" in phone. Connect your phone to pc see if it is detected or not.
If not try doing uninstall & installing flashtool again. If it is not detected yet I shall say "STOP" forget partitioning. Look in the forum for a solution. Fix it and then continue.
If your device detects properly in normal mode then proceed
Turn off phone. Connect USB cable to PC and while pressing volume up button and connect cable to Phone.
A blue light will flash & Driver will install if necessary. In Flashtool window it will show fastboot mode after detecting phone. If not "STOP" try again. Fix it and then continue.
Step 2 - Install mini adb
If you have downloaded mini ADB.exe version install it to root directory of PC for example C:\ADB. Double click to open the .exe when ask for location of install show to C:\ADB
If you have downloaded Mini ADB as .zip/.rar file. Right click on the file> Extract to > C:\ADB
Step 3 - TWRP
Download from the link given above.
Move Downloaded TWRP image such as twrp-3.0.0-0-nozomi.img to ADB folder (C:\ADB)
Rename the file to twrp.img.
(Optional) - also move rom.zip for later use. If you want to install a fresh rom.
Step 4 - Kernel flash
* Flashing Kernel by flashtool
Turn off phone, conncet it to pc while pressing volume + button
open flashtool> flash device (thunder icon)> fastboot> Flash kernel> select twrp-3.0.0-0-nozomi.img
See the flashtool log if it says "OK" then Reboot/start the phone. Otherwise redo this step.
When starting press volume + - button several time it will bring up recovery screen.
* Flashing kernel into Fota Kernel.
You have to Upload the recovery.img into your phone & Flash to do this: Open Command Window by default in windows it is called cmd.
Opening Command window
* By CMD:
Go to ADB folder> Press Shift + Right Mouse button> Open Command window here> it will open a command window
* Using Other console software:
ConEmu or Console2 can't be open this way. You have to use "cd" command to go to adb folder.
In conEmu or console2 write: cd your adb location for example: cd c:\ADB
Now write these in command window-
adb push twrp.img /sdcard/ <<<<---- this will copy twrp.img to your phone sdcard. Remember to change recovery name to twrp.img
dd if=/sdcard/twrp.img of=/dev/block/mmcblk0p11 <<<<---- this will write twrp to FOTA block of your phone.
** Rebooting phone will bring up recovery screen. In the recovery screen it will ask you whether system should be put into "Read only mode". Don't do that.
** In twrp Go to Mount> deselect System, data, cache, Sdcard and read only system > select again > again Deselect
Before You Procced Any Further Make Sure:
PC can detect your device Normally
PC Can detect device in Fastboot mode
If you really want to do this or not?
Step 5 - Partitioning
[*] Connect USB Cable while in TWRP recovery. (It dosen't matter which screen you are in just Stay in twrp recovery)
[*] Open ADB Folder> Open CMD or ConEmu from there (See Step 4 - opening command window section for this)
Write these command
adb shell <<<<----- it will start ADB
then write
fdisk /dev/block/mmcblk0 <<<<----- It will enable partitioning commands to work
This will bring some info & It will Look Like this:
The number of cylinders for this disk is set to 973824.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help):
**NOTE** " Command (m for help): " will show automatically if you successfuly entered in partitioning mode if not redo steps again.​
Now we need to see each block of default partition and detect SDCARD & Internal Storage: Write this-
p <<<<<<----- This will print or show each partition. Command (m for help): already be there just write p for example Command (m for help): p
It will show this:
Code:
[HIDE]Disk /dev/block/mmcblk0: 31.9 GB, 31910264832 bytes
4 heads, 16 sectors/track, 973824 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 65 2048 f0 Linux/PA-RISC boot
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 * 65 81 512 4d Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 129 768 20480 48 Unknown
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 769 954240 30511104 5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 785 800 512 46 Unknown
/dev/block/mmcblk0p6 833 928 3072 4a Unknown
/dev/block/mmcblk0p7 961 1056 3072 4b Unknown
/dev/block/mmcblk0p8 1089 1184 3072 58 Unknown
/dev/block/mmcblk0p9 1217 1376 5120 70 Unknown
/dev/block/mmcblk0p10 1409 1664 8192 83 Linux
/dev/block/mmcblk0p11 1665 2176 16384 f0 Linux/PA-RISC boot
/dev/block/mmcblk0p12 2177 34944 1048576 83 Linux
/dev/block/mmcblk0p13 34945 42944 256000 83 Linux
/dev/block/mmcblk0p14 42945 108480 2097152 83 Linux
/dev/block/mmcblk0p15 108481 954240 27064320 c Win95 FAT32 (LBA)
Command (m for help):[/HIDE]
STOP​COPY THESE PARTITIOIN INFO TO A TEXT FILE AND SAVE IT. EVERY PHONE HAS SEPERATE PARTITION SETTING. IF ANYTHING GOES WRONG IT WILL BE NECESSARY TO SEE AND GIVE EXACTLY SAME VALUE TO RECOVER ORIGINAL PARTITION.​
Identifying SDCARD & Internal Storage - From the print output we see lots of blocks and lots of data. But We need to know which partition belongs to which.
/dev/block/mmcblk0p14 <<<---- this is the Internal Storage. See the blocks column its like 2 GB (2097152)
/dev/block/mmcblk0p15 <<<---- this is the SDCARD. Blocks look like it's around 27GB and there is also win95 FAT32 type partition.
As we need to increase Internal Storage Size. From where these extra storage will come from? Well, it's from SDCARD. That's why SDCARD & Internal Storage has to be deleted and repartition again. As for delete do this
d <<<<<---- for deleting partition Command (m for help): d
Partition number (1-15): <<<<---- it will ask which partition you want to delete?
15 <<<<<---- First delete mmcblk0p15
then again give
d <<<<<---- for deleting partition Command (m for help): d
Partition number (1-15): 14 <<<<----- Deletes Internal storage partition which is mmcblk0p14
You can give P command to see whether those partition deleted or not
Command (m for help): p
Now creating new partition for Internal storage. Write
n <<<<<----- this is for creating new partition Command (m for help): n
this will show this:
Code:
First cylinder (769-954240, default 769):
To Understand properly look at this table you generated earlier using p command:
Code:
start end
/dev/block/mmcblk0p13 34945 42944
/dev/block/mmcblk0p14 42945 108480
/dev/block/mmcblk0p15 108481 954240
Here mmcblk0p13 started ended at 42944. mmcblk0p14 started at 42945. And mmcblk0p14 ended 108480 just after that mmcblk0p15 started at 108481. Ending is beginning. Quiet easy actually.
So when asked to put first cylinder: you take mmcblk0p13 end value plus 1 write that in first cylinder. for example if End value of mmcblk0p13 is 2 then first cylinder will be 3. if mmcblk0p13 end value is 1000 then first cylinder value will be 1001. if mmcblk0p13 End value is 42900 then first cylinder Value will be 42901. I think that's enough for understanding.
First cylinder (769-954240, default 769): 42945 [<<<<----- in my case mmcblk0p13 end value is 42944 so first cylinder value is 42945 this will not be same for you. press Enter]
Then it will ask for Last Cylinder value: There is three way to put this in kilobyte, in megabyte or in default size but we have to put + sign before size. For example: +100000k or +4000M or +2000000. Easiest one will be using Megabyte. 4000 megabyte is 4 gb, 8000 is 8GB. By default when partitioning system keep some space for recording partition info that's why we never get full size in Memory card, Hard disk, Flash drive etc. This will also be applied here. If you give +4000M command you will get 3.6GB or 3.7GB Something like that. So calculate give some more to keep it even if you want.
Code:
Last cylinder or +size or +sizeM or +sizeK (42945-954240, default 954240):
I want my internal storage is around 4GB So I Gave
+4192 <<<<----- Last cylinder or +size or +sizeM or +sizeK (42945-954240, default 954240): +4192
Now The SDCARD Partition. To create This partition we have to give First cylinder value. As we don't know mmcblk0p14 has which Ending cylinder value. We have to generate the partition table and see. So give the P command.
Command (m for help): p <<<<--- shows partition table. Note the END Value of mmcblk0p14. suppose End value is 170875
Give n command
Command (m for help): n <<<<--- new partition for SDCARD or mmcblk0p15. It will ask for first cylinder
First cylinder (769-954240, default 769): <<<<---- put noted Ending value of mmcblk0p14 + 1 here. (170875+1 = 170876) press enter
Now Last cylinder: Just press enter it will take default
Last cylinder or +size or +sizeM or +sizeK (42945-954240, default 954240):
Change partition type for SDCARD by giving these command.
Command (m for help): t <<<--- t for change partition type.
Partition number (1-15): 15 <<<--- It asks which partition to be changed give 15 for SDCARD/mmcblk0p15
Hex code (type L to list codes): c <<<--- FAT32 from win95 for most compatibility give c to choose this. Do not change to any other system type it might not recognized by PC or even your device. Press enter.
Writing all these changing permanently
Command (m for help): w <<<--- give w for write permission. if successful you'll see these message.
Code:
The partition table has been altered.
Calling ioctl() to re-read partition table
**NOTE** if you see something like below line. Partition is not altered or changed. Redo all steps carefully and properly.
Code:
fdisk: WARNING: rereading partition table failed, kernel still uses old table: Device or resource busy
Step 6 - Formatting Partition.
Your Partition table redefined or resized only. No Formatting has done yet. Your phone do not read memory unless its properly formatted.
If you wish to use stock or stock based rom DO NOT CHANGE PARTITION FORMAT. It will cause problem even brick. Search around forum for more info about this.
Changing Partition format is good for the Upgraded OS version like lolipop 5.0.0 or 5.1.1 or Marshmallow 6.0.0 to work some features. But not always necessary.
Disconnect Phone from pc> Boot into recovery
Code:
TWRP> Wipe> Advance> Format data, cache, system and SDCARD.
If you want to change Format>
Code:
From TWRP>Wipe>Advance>select system or data or cache> change file format> select desiered one> change.
Nice tutorial...but how to push ROM back to phone
payjo73 said:
Nice tutorial...but how to push ROM back to phone
Click to expand...
Click to collapse
If you Mean Stock ROM Use flash tool.
If you mean a zip file of custom rom use adb command:
adb push something.zip /sdcard/
Hey, I have done the exact same procedure and flashed oneofakind ROM. Now my internal SD card seems to be messed up.
Camera app throws error "insert an SD card before using" error & Gallery app throws error "no SD card detected error"
Kindly HELP !!
ps : I already had TWRP installed, had root access & unlocked bootloader. So started from Step 5 with partitioning steps ! I can see the internal storage of 19GB in settings though.
pps : I searched google extensively but most related solutions had external SD card being used so I couldn't reconcile it with my device (Xperia S)
C0D3FR34K said:
Hey, I have done the exact same procedure and flashed oneofakind ROM. Now my internal SD card seems to be messed up.
Camera app throws error "insert an SD card before using" error & Gallery app throws error "no SD card detected error"
Kindly HELP !!
ps : I already had TWRP installed, had root access & unlocked bootloader. So started from Step 5 with partitioning steps ! I can see the internal storage of 19GB in settings though.
pps : I searched google extensively but most related solutions had external SD card being used so I couldn't reconcile it with my device (Xperia S)
Click to expand...
Click to collapse
You need to allow permissions for letting the app access storage in settings of phone.
Mirhawk said:
You need to allow permissions for letting the app access storage in settings of phone.
Click to expand...
Click to collapse
Thanks.
How do i do that ? I never had to do it earlier. I have installed the ROM multiple times in past year.
C0D3FR34K said:
Thanks.
How do i do that ? I never had to do it earlier. I have installed the ROM multiple times in past year.
Click to expand...
Click to collapse
It's in Settings, Apps>Settings icon at top right> App permissions. This error occurs with Marshmellow ROM's as they some new pemission features. You can check out the link in My signature for more related info
Bro i was following this tutorial but i don't know how mobile got disconnected ?.. Now mobile got damaged it can't able to switch on.. Even pc not detecting.. What should I do now.. Please help???

How To Guide How to backup your partitions with command line (requires root)

How to backup partition images with dd on the command line (root required)​
We don't currently have a working custom recovery for the Xperia 10 III, but if you have root there's a simple method to dump partition images.
This is a very good idea and you should do it at least once, especially if you like to mess around the device a lot.
You won't be able to do this before you root, so by the time you do some partitions will not be stock anymore. Use XperiFirm instead to get the clean stock images.
Special partitions:​
The userdata partition holds all your personal files and system settings. It's huge (about 105 GB) and obviously you can't dump it into itself. You can dump it on an SD card if it's 128+ GB.
The super partition is a physical partition that contains several logical partitions (including system and vendor) That's why you won't find those in the partition list. This is done on Android 10+ devices to allow those logical partitions to be resized or rearranged as needed. You don't need to split out the internal logical partitions, you can flash back the entire super partition. The stock firmware also comes with a super image, not individual logical partitions.
Using a helper script:​There's a Magisk module called Backup (by Draco) which gives you a command line shell script you can use if you prefer. It mostly does the same things I described above. The script is here if anybody wants to just grab it directly.
On the plus side, the script knows to dump only the active A/B image (which is the one that interests you most). On the flip side, it doesn't have a feature to skip userdata.
So here is a shell command that will use the backup script to dump all partitions, but only those matching your device's active A/B slot, and skips userdata:
Code:
backup $(ls /dev/block/bootdevice/by-name/ | grep -v userdata | sed 's/_[ab]$//')
And here's one that also skips super:
Code:
backup $(ls /dev/block/bootdevice/by-name/ | grep -v userdata | grep -v super | sed 's/_[ab]$//')
How to dump partitions manually:​If you can't/won't use the helper script you can do it by hand. All the following commands need root:
Find the names of all the partitions:
Code:
ls /dev/block/bootdevice/by-name/
Dump one specific partition identified by NAME:
Code:
dd if=/dev/block/bootdevice/by-name/NAME of=NAME.img
Dump all partitions except userdata:
Code:
ls /dev/block/bootdevice/by-name/ | grep -v userdata | while read NAME; do echo dd if=/dev/block/bootdevice/by-name/${NAME} of=${NAME}.img; done
Find the active slot:
Code:
getprop ro.boot.slot_suffix
Get checksums for all the images after the dump:
Code:
md5sum *.img
Confused about _a and _b partitions?​You should read about A/B Seamless Updates.
Long story short, some partitions have two copies eg. boot_a and boot_b. When you boot up the device you use the partitions in one slot (eg. the _a partitions). When an OTA update is being downloaded, it writes into the partitions for the other slot (eg. the _b partitions). Your phone can stay in use while this happens. If the OTA fails nothing is broken, you just keep using the good slot partitions. After the OTA is successful you switch to the other slot and also have the previous version in the other slot in case you need to switch back.
This means that some of the _a and _b images for the same partition can be different for you! So it's strongly recommended to do the checksums, and also to find out which is your active slot, so you know which partitions you're using right now.
I used a 128 GB card to take a backup of userdata. The backup script had some trouble with the backup location being on the storage card for some reason and I didn't have time to figure it out, but the dd command I gave above worked fine.
Code:
# time dd if=/dev/block/bootdevice/by-name/userdata of=userdata.img
112111374336 bytes (104 G) copied, 2342.274225 s, 46 M/s
39m02.31s real 1m11.78s user 14m44.72s system
Code:
# adb pull /storage/1234-ABCD/backup/userdata.img ./
/storage/1234-ABCD/backup/userdata.img: 1 file pulled, 0 skipped.
87.2 MB/s (112111374336 bytes in 1225.663s)
So that's 104 GB that took 39 minutes to be written to a new Samsung Evo U3/V30 microSDXC (46 MB/sec real write speed) and 20 minutes to be read to the PC (Samsung Evo M.2) with adb pull over USB (87 MB/sec read speed). Just so you know what you're in for.
I was looking into whether I could speed up the process of taking userdata snapshots by dumping the partition directly to the PC, but you need to be root to access the device block. The stock ROM doesn't allow the command adb root, but I found this blog post which made me realize you can run a su -c command that asks dd to write to stdout and just pipe the output to a file. The post author has also made this helpful Python script which lets you do pulls and pushes with root-only files.
If you want to run the command directly (I've only tested on Linux, no idea if it works on PowerShell but it might):
Code:
# adb shell "su -c" "dd if=/dev/block/bootdevice/by-name/userdata" > userdata.img
If you want to use the Python script:
Code:
# adb-root.py pull /dev/block/bootdevice/by-name/userdata userdata.img
Using the same fast SSD on the PC side as above, I now get:
Code:
218967528+0 records in
218967528+0 records out
112111374336 bytes (104 G) copied, 1077.681097 s, 99 M/s
real 17m57.910s
So that's roughly 15 minutes compared to 1 hour total with the previous method and you don't need to have a 128 GB SD card anymore.
Are you able to switch to a different backup location? Say a USB OTG if possible.
mikeshutte said:
Are you able to switch to a different backup location? Say a USB OTG if possible.
Click to expand...
Click to collapse
With dd yes, simply move to the directory you want before you call dd.
The backup script is bugged and seems to ignore the -d parameter for the backup location so it always uses /sdcard/backup. (I think it might be expecting a different version of getopts...) Normally I would say to try creating a symlink from /sdcard/backup to the OTG storage but the ln utility is also behaving strangely and I can't make any symlinks (even with root).
wirespot said:
With dd yes, simply move to the directory you want before you call dd.
The backup script is bugged and seems to ignore the -d parameter for the backup location so it always uses /sdcard/backup. (I think it might be expecting a different version of getopts...) Normally I would say to try creating a symlink from /sdcard/backup to the OTG storage but the ln utility is also behaving strangely and I can't make any symlinks (even with root).
Click to expand...
Click to collapse
Ok I'll give it a try and see what happens. Thanks for your help.
Hi, I'm used to TWRP backups, so I don't really understand this tool. I've backedup everything except the massive userdata partition. If needed, how would I restore this? Is the userdata partition required when I have all the others?
Thanks!
jakito said:
Hi, I'm used to TWRP backups, so I don't really understand this tool. I've backedup everything except the massive userdata partition. If needed, how would I restore this? Is the userdata partition required when I have all the others?
Thanks!
Click to expand...
Click to collapse
This is basically the same thing that TWRP does, dd is a command line Linux tool that makes a "raw" copy of a partition.
Restoration is a bit more tricky. In theory you can simply dump the raw backup copy over the partition. The problem is that it's not ok to do it while the system is running. Typically it's done by booting into recovery (TWRP) and overwriting the partition from there.
Another method for restore is to use fastboot, which is an alternative tool you can boot into that only does one thing, write partitions. But fastboot is typically locked by the vendor to only write signed images, so it can only be used to write official release ROMs.
There are some limited uses for fastboot, such as overwriting the boot partition, which is not checked for signature anymore once you've unlocked the bootloader. So if you want to experiment with unofficial kernels and mess something up you can always restore a good boot partition with fastboot.
TLDR: for the time being until we get a working TWRP recovery the most you can do is take backups, but not restore them.
wirespot said:
This is basically the same thing that TWRP does, dd is a command line Linux tool that makes a "raw" copy of a partition.
Restoration is a bit more tricky. In theory you can simply dump the raw backup copy over the partition. The problem is that it's not ok to do it while the system is running. Typically it's done by booting into recovery (TWRP) and overwriting the partition from there.
Another method for restore is to use fastboot, which is an alternative tool you can boot into that only does one thing, write partitions. But fastboot is typically locked by the vendor to only write signed images, so it can only be used to write official release ROMs.
There are some limited uses for fastboot, such as overwriting the boot partition, which is not checked for signature anymore once you've unlocked the bootloader. So if you want to experiment with unofficial kernels and mess something up you can always restore a good boot partition with fastboot.
TLDR: for the time being until we get a working TWRP recovery the most you can do is take backups, but not restore them.
Click to expand...
Click to collapse
I see. Thank you nonetheless!
wirespot said:
This is basically the same thing that TWRP does, dd is a command line Linux tool that makes a "raw" copy of a partition.
Restoration is a bit more tricky. In theory you can simply dump the raw backup copy over the partition. The problem is that it's not ok to do it while the system is running. Typically it's done by booting into recovery (TWRP) and overwriting the partition from there.
Another method for restore is to use fastboot, which is an alternative tool you can boot into that only does one thing, write partitions. But fastboot is typically locked by the vendor to only write signed images, so it can only be used to write official release ROMs.
There are some limited uses for fastboot, such as overwriting the boot partition, which is not checked for signature anymore once you've unlocked the bootloader. So if you want to experiment with unofficial kernels and mess something up you can always restore a good boot partition with fastboot.
TLDR: for the time being until we get a working TWRP recovery the most you can do is take backups, but not restore them.
Click to expand...
Click to collapse
I don't know how I ended up but making a backup you can't restore is completely pointless.
Techguy777 said:
I don't know how I ended up but making a backup you can't restore is completely pointless.
Click to expand...
Click to collapse
No, it's not. All your data is in there. You can mount your backup on a linux computer and pull out apks as well as app data. You can then restore these folder by folder with adb and a root shell on your phone.
That beeing said, does anyone know a proper backup software like Titanium Backup for Android 11 and above? Sometimes I read recommendations, but looking at the ratings it seems that no software manages to achieve the same level of comfort and control. Also they all seem to suffer from the same limitations.
Let's be honest: Google wants to make your life hard, so they can lock you in.
@xperinaut
I'm using Titanium on Android 11. Is it not working for you?

[GUIDE] Dual-Boot for P20 Lite

Code:
disclaimer
/*
* Your warranty is... still valid?
*
* I am not responsible for bricked devices, dead SD cards,
*/
Hello
This Guide to make Dual-Boot for P20 lite that keep Stock rom untouched and install any GSI. It allows two Android os installed at the same time and switch between them using SHRP Recovery for dual boot.
This method tested and worked on P20 lite (ANE LX1), Watch this video
Spoiler: General information
This done by creating a new system partition using Parted (shrink userdata partition and creat the new system partition)
To Boot from the new system partition: change the name of the new system partition to "system" and the name of old system partition to any name e.g. "system-b"
To Boot from the old system partition: change the name of the old system partition to "system" and the name of new system partition to any name e.g. "system-b"
Dual boot for P20 lite - demonstration video (I am using SHRP RECOVERY (like TWRP) with tweaks to change boot partition easily, instead of writing terminal commands. This a video shows the dual boot process)
Requirements​
TWRP/SHRP
Parted (attached arm64, unzip the file)
Latest fastboot and ADB commands installed
Backup all your data because you will make a factory reset and format data partition
Steps:​
Boot to TWRP/SHRP
Run the following commands
Code:
adb push /path/to/parted /sbin/parted
adb shell
chmod 777 /sbin/parted
parted /dev/block/mmcblk0
p free
3- it will show the list of partition "save this you may use it later". remember the number of old system partition which is in my case "52"
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
4- remove "userdata" partition which in my case number 59 using the following command
Code:
rm 59
5- create the new system partition (partition number 59 in my case ) using the following command
Code:
mkpart name fs_type start end
name: name of new partition e.g "system-b"
fs_type: file system type e.g "ex4"
start: the end value in MB of the previous partition, in my case "7153MB"
end: equal to start + size where size will be the size of the target partition. in my case in need 4GB partition so end=7153MB + 4GB =11153MB
In my case I'll type:
Code:
mkpart system-b ext4 7153MB 11153MB
set 59 msftdata on
name 59 system-b
6- create the "userdata" partition (partition number 60 in my case, start= 11153MB )
In my case I'll type:
Code:
mkpart userdata ext4 11153MB 31.3GB
set 60 msftdata on
name 60 userdata
7- get the new partition list
Code:
p free
8- exit
Code:
quit
9- format userdata and the new system partition using "mkfs.type /dev/block/mmcblk0pxx" (in my case partition number 59 and 60). you may need to reboot to stock recovery to make factory reset
Code:
adb push /path/to/mkfs.ext4 /sbin/mkfs.ext4
adb shell
chmod 777 /sbin/mkfs.ext4
mkfs.ext4 /dev/block/mmcblk0p59
mkfs.f2fs /dev/block/mmcblk0p60
10- You can now switch between two systems using either of these two methods
Spoiler: Using SHRP Recovery
SHRP is a beautiful TWRP-based recovery with modern UI, custom layout, useful functions, and more.
In this method you must have "System" and "System-b" partitions, other names not accepted
1- Download SHRP Recovery for DUAL Boot from here
2- Flash it on recovery_ramdisk or erecovery_ramdisk
3- from the main screen choose tweaks
A- Active new system partition and new data profile
(Important Note: Now "System partition" is the new created partition and "System-b partition" is the default system partition)
B- Active default system partition and default data profile
(Important Note: Now "System partition" is the default system partition and "System-b partition" is the new created partition)
Reboot before make any change
Spoiler: manually
A- To Boot from your new system partition > boot to twrp and run the following command
Code:
adb push /path/to/parted /sbin/parted
adb shell
chmod 777 /sbin/parted
parted /dev/block/mmcblk0
name 52 system-b
name 59 system
or from TWRP terminal write the following
Code:
parted -s /dev/block/mmcblk0 name 52 system-b
parted -s /dev/block/mmcblk0 name 59 system
change the number 52 and 59 according to your partition list (in my case 59: new system partion, 52 old system partition ). Then reboot TWRP and flash your new android os
B- To Boot from your old system partition > boot to twrp and run the following command
Code:
adb push /path/to/parted /sbin/parted
adb shell
chmod 777 /sbin/parted
parted /dev/block/mmcblk0
name 59 system-b
name 52 system
or from TWRP terminal write the following
Code:
parted -s /dev/block/mmcblk0 name 59 system-b
parted -s /dev/block/mmcblk0 name 52 system
change the number 52 and 59 according to your partition list (in my case 59: new system partion, 52 old system partition ). Then reboot
-------------------------------------------------------
Google Chrome may lag on the new data profile use this method to solve this problem
Abdelhay.ali said:
Code:
disclaimer
/*
* Your warranty is... still valid?
*
* I am not responsible for bricked devices, dead SD cards,
*/
Hello
This Guide to make Dual-Boot for P20 lite that keep Stock rom untouched and install any GSI. It allows two Android os installed at the same time and switch between them using SHRP Recovery for dual boot.
This method tested and worked on P20 lite (ANE LX1), Watch this video
Spoiler: General information
This done by creating a new system partition using Parted (shrink userdata partition and creat the new system partition)
To Boot from the new system partition: change the name of the new system partition to "system" and the name of old system partition to any name e.g. "system-b"
To Boot from the old system partition: change the name of the old system partition to "system" and the name of new system partition to any name e.g. "system-b"
Dual boot for P20 lite - demonstration video (I am using SHRP RECOVERY (like TWRP) with tweaks to change boot partition easily, instead of writing terminal commands. This a video shows the dual boot process)
Requirements​
TWRP/SHRP
Parted (attached arm64, unzip the file)
Latest fastboot and ADB commands installed
Backup all your data because you will make a factory reset and format data partition
Steps:​
Boot to TWRP/SHRP
Run the following commands
Code:
adb push /path/to/parted /sbin/parted
adb shell
chmod 777 /sbin/parted
parted /dev/block/mmcblk0
p free
3- it will show the list of partition "save this you may use it later". remember the number of old system partition which is in my case "52"
View attachment 5781191
4- remove "userdata" partition which in my case number 59 using the following command
Code:
rm 59
5- create the new system partition (partition number 59 in my case ) using the following command
Code:
mkpart name fs_type start end
name: name of new partition e.g "system-b"
fs_type: file system type e.g "ex4"
start: the end value in MB of the previous partition, in my case "7153MB"
end: equal to start + size where size will be the size of the target partition. in my case in need 4GB partition so end=7153MB + 4GB =11153MB
In my case I'll type:
Code:
mkpart system-b ext4 7153MB 11153MB
set 59 msftdata on
name 59 system-b
6- create the "userdata" partition (partition number 60 in my case, start= 11153MB )
In my case I'll type:
Code:
mkpart userdata ext4 11153MB 31.3GB
set 60 msftdata on
name 60 userdata
7- get the new partition list
Code:
p free
View attachment 5781193
8- exit
Code:
quit
9- format userdata and the new system partition using "mkfs.type /dev/block/mmcblk0pxx" (in my case partition number 59 and 60). you may need to reboot to stock recovery to make factory reset
Code:
adb push /path/to/mkfs.ext4 /sbin/mkfs.ext4
adb shell
chmod 777 /sbin/mkfs.ext4
mkfs.ext4 /dev/block/mmcblk0p59
mkfs.f2fs /dev/block/mmcblk0p60
10- You can now switch between two systems using either of these two methods
Spoiler: Using SHRP Recovery
SHRP is a beautiful TWRP-based recovery with modern UI, custom layout, useful functions, and more.
In this method you must have "System" and "System-b" partitions, other names not accepted
1- Download SHRP Recovery for DUAL Boot from here
2- Flash it on recovery_ramdisk or erecovery_ramdisk
3- from the main screen choose tweaks
View attachment 5781195
A- Active new system partition and new data profile
View attachment 5781197
(Important Note: Now "System partition" is the new created partition and "System-b partition" is the default system partition)
B- Active default system partition and default data profile
View attachment 5781199
(Important Note: Now "System partition" is the default system partition and "System-b partition" is the new created partition)
Reboot before make any change
Spoiler: manually
A- To Boot from your new system partition > boot to twrp and run the following command
Code:
adb push /path/to/parted /sbin/parted
adb shell
chmod 777 /sbin/parted
parted /dev/block/mmcblk0
name 52 system-b
name 59 system
or from TWRP terminal write the following
Code:
parted -s /dev/block/mmcblk0 name 52 system-b
parted -s /dev/block/mmcblk0 name 59 system
change the number 52 and 59 according to your partition list (in my case 59: new system partion, 52 old system partition ). Then reboot TWRP and flash your new android os
B- To Boot from your old system partition > boot to twrp and run the following command
Code:
adb push /path/to/parted /sbin/parted
adb shell
chmod 777 /sbin/parted
parted /dev/block/mmcblk0
name 59 system-b
name 52 system
or from TWRP terminal write the following
Code:
parted -s /dev/block/mmcblk0 name 59 system-b
parted -s /dev/block/mmcblk0 name 52 system
change the number 52 and 59 according to your partition list (in my case 59: new system partion, 52 old system partition ). Then reboot
-------------------------------------------------------
Click to expand...
Click to collapse
Hi.
I see from the video that you have riceos and evolution. How can I get these roms for the p20 lite. Also how are these roms?
ancient12 said:
Hi.
I see from the video that you have riceos and evolution. How can I get these roms for the p20 lite. Also how are these roms?
Click to expand...
Click to collapse
From here
Android 13 for P20 lite (Tested GSIs)
Here are recent A13 GSIs that booted and worked on my P20 lite Hi6250 Requirements: You can flash SHRP recovery that have all the requirements to make Android 13 boot normally (including permissive kernel, decrypt data, selinux fix, AIO fix and...
forum.xda-developers.com
Hi,
Is it possible to enable the A/B system updates feature on our devices with this method?
art0001 said:
Hi,
Is it possible to enable the A/B system updates feature on our devices with this method?
Click to expand...
Click to collapse
I think you have to implement it from the scratch like "OTA update" by phh. The new update should be flashed to the new system partition "system-b" then change it's name to "system"

Question system backup

Hoping I can get some assistance. Seeing as TWRP isn't a viable option right now for the OnePlus 11, I'm curious if there is a good way to do a full system backup/restore (mimic what TWRP did) using ADB or some other native way or application. When I last played around with Titanium I didn't see a good way of performing this task. It's possible I wasn't doing it correctly, but I was playing around with the batch options and couldn't get it to do anything.
Anyway, my thought was to write a powershell script and backup all the partitions that way, but here is my question. On my oneplus 11 (I have the CPH2451 model) I can go to "/dev/block/by-name" and see all the partitions. I can use the adb shell dd if of command to copy it to my sd card and then pull it on to my computer for example, but is this the proper process to back up the system, data, settings?
I notice in TWRP when you go through the backup process, you have the option to backup boot, system, vendor/OEM, data, modem, efs partitions. That leads me to my next question when I traverse through the path I posted above, there are a ton of partitions there, not to mention many duplicate for exable boot_a and boot_b. So when I back it up would I need to back up everything or is there a fast & clean way to backup the minimum required data without missing anything important?
Root and try Swift for app, phone, sms backups.
Otherwise, since almost none of the other partitions are writable anymore, it's pretty pointless backing them up. But you could with DD (again, you would need to be rooted)... fastboot and fastbootd should be capable of writing the partitions back to the device.
All you need to backup is /data since all others are included in your firmware. Problem when do a backup of /data: You need to perform the backup while system is running. You can't access /data from outside the system without TWRP. If you perform a backup use Termux and the tar command for it. The built in tar command of Android is very limited. Termux offers you a full version of tar.
kevp75 said:
Root and try Swift for app, phone, sms backups.
Otherwise, since almost none of the other partitions are writable anymore, it's pretty pointless backing them up. But you could with DD (again, you would need to be rooted)... fastboot and fastbootd should be capable of writing the partitions back to the device.
Click to expand...
Click to collapse
Thanks for your reply. My device is rooted so that's not a problem. It's just a shame that TWRP doesn't seem to be a viable option. As far as SMS back goes, I'm not too concerned about that because I primarily use google voice, so basically all my contacts and SMS/MMS is saved in the cloud. My biggest concern is just getting a working backup of the system/configurations because I tend to do quite a bit of customizations on my phone and it would suck having to redo everything.
WoKoschekk said:
All you need to backup is /data since all others are included in your firmware. Problem when do a backup of /data: You need to perform the backup while system is running. You can't access /data from outside the system without TWRP. If you perform a backup use Termux and the tar command for it. The built in tar command of Android is very limited. Termux offers you a full version of tar.
Click to expand...
Click to collapse
Thank you as well for your reply. I'm assuming termux is a android based terminal? if termux can do it; would adb/adb shell be able to? The only reason I ask is because it's much easier to type commands from a computer than on the phone. Also what commands would I use? Is there a tut I can follow?
m0d hipp¥ said:
termux can do it; would adb/adb shell be able to?
Click to expand...
Click to collapse
Yes, Termux is an app. ADB could do, but with ADB you have only access to Android's built in commands in /system/bin. Termux offers an own environment with full versions of all the limited built in ones.
WoKoschekk said:
Yes, Termux is an app. ADB could do, but with ADB you have only access to Android's built in commands in /system/bin. Termux offers an own environment with full versions of all the limited built in ones.
Click to expand...
Click to collapse
That makes sense. I'll have to play around with it after work and see what I can figure out. Thanks
There are a few things to take care of. I'll post them later here.
For those who are not rooted:
OnePlus Clone Phone app allows to create full backs by copying apps and their data to a different OnePlus/Oppo phone.
adb backup/restore has long stopped working "thanks" to Google.
Sorry I haven't had a chance to test the methods above, but just to be more clear on my end, I'm not super concerned about backing up apps because there are several ways of doing that. Lucky patcher among other tools allows you to backup apps & app settings. I'm a bit more concerned about system settings/configurations. For example if I wanted to do a backup of my current state the system is in. I have over 100 apps disabled and having to redo that is a bit tedious. Not only that, but also all the configurations I have made within the system settings I'd like to save those as well. So this is really what I'm targeting.
EDIT:
For starters I wrote this simple script in Powershell that gets all the partitions on my device.
Code:
$Partition_Path = "/dev/block/bootdevice/by-name"
foreach($Partition in $(adb shell ls $Partition_Path))
{
$Partition
}
The output is the following:
Code:
ALIGN_TO_128K_1
ALIGN_TO_128K_2
DRIVER
abl_a
abl_b
aop_a
aop_b
aop_config_a
aop_config_b
apdp
apdp_full
apdpb
bluetooth_a
bluetooth_b
boot_a
boot_b
cdt
connsec
cpucp_a
cpucp_b
ddr
devcfg_a
devcfg_b
devinfo
dinfo
dip
dsp_a
dsp_b
dtbo_a
dtbo_b
engineering_cdt_a
engineering_cdt_b
featenabler_a
featenabler_b
frp
fsc
fsg
hyp_a
hyp_b
imagefv_a
imagefv_b
init_boot_a
init_boot_b
keymaster_a
keymaster_b
keystore
last_parti
limits
limits-cdsp
logdump
logfs
mdcompress
mdm1oemnvbktmp
mdtp_a
mdtp_b
mdtpsecapp_a
mdtpsecapp_b
metadata
misc
modem_a
modem_b
modemst1
modemst2
multiimgoem_a
multiimgoem_b
multiimgqti_a
multiimgqti_b
ocdt
oplus_sec_a
oplus_sec_b
oplusdycnvbk
oplusreserve1
oplusreserve2
oplusreserve3
oplusreserve4
oplusreserve5
oplusstanvbk_a
oplusstanvbk_b
param
persist
preisp_dt
preisp_dt_bk
preisp_otp
qmcs
qupfw_a
qupfw_b
qweslicstore_a
qweslicstore_b
rawdump
recovery_a
recovery_b
rtice
rticmpdata_a
rticmpdata_b
secdata
shrm_a
shrm_b
splash_a
splash_b
splash_odm
spunvm
ssd
storsec
super
toolsfv
tz_a
tz_b
tzsc
uefi_a
uefi_b
uefisecapp_a
uefisecapp_b
uefivarstore
userdata
vbmeta_a
vbmeta_b
vbmeta_system_a
vbmeta_system_b
vbmeta_vendor_a
vbmeta_vendor_b
vendor_boot_a
vendor_boot_b
vm-bootsys_a
vm-bootsys_b
vm-data
vm-persist
xbl_a
xbl_b
xbl_config_a
xbl_config_b
xbl_ramdump_a
xbl_ramdump_b
xbl_sc_logs
xbl_sc_test_mode
My question is if I went the termux route or the adb shell route to try and do a backup using the command:
Code:
adb exec-out "su -c dd if=$Partition_Path/$Partition of=/sdcard/Backup/$Partition.img"
which of these partitions would be the ones I should focus on backing up? By the way, there are 3 partitions that are HUGE so I don't think they're necessary, but let me know if they are. The 3 partitions are super, userdata, and logdump. By the way userdata is like over 100Gb, and that's unrealistic because my phone def doesn't have that much data on there.
m0d hipp¥ said:
Sorry I haven't had a chance to test the methods above, but just to be more clear on my end, I'm not super concerned about backing up apps because there are several ways of doing that. Lucky patcher among other tools allows you to backup apps & app settings. I'm a bit more concerned about system settings/configurations. For example if I wanted to do a backup of my current state the system is in. I have over 100 apps disabled and having to redo that is a bit tedious. Not only that, but also all the configurations I have made within the system settings I'd like to save those as well. So this is really what I'm targeting.
EDIT:
For starters I wrote this simple script in Powershell that gets all the partitions on my device.
Code:
$Partition_Path = "/dev/block/bootdevice/by-name"
foreach($Partition in $(adb shell ls $Partition_Path))
{
$Partition
}
The output is the following:
Code:
ALIGN_TO_128K_1
ALIGN_TO_128K_2
DRIVER
abl_a
abl_b
aop_a
aop_b
aop_config_a
aop_config_b
apdp
apdp_full
apdpb
bluetooth_a
bluetooth_b
boot_a
boot_b
cdt
connsec
cpucp_a
cpucp_b
ddr
devcfg_a
devcfg_b
devinfo
dinfo
dip
dsp_a
dsp_b
dtbo_a
dtbo_b
engineering_cdt_a
engineering_cdt_b
featenabler_a
featenabler_b
frp
fsc
fsg
hyp_a
hyp_b
imagefv_a
imagefv_b
init_boot_a
init_boot_b
keymaster_a
keymaster_b
keystore
last_parti
limits
limits-cdsp
logdump
logfs
mdcompress
mdm1oemnvbktmp
mdtp_a
mdtp_b
mdtpsecapp_a
mdtpsecapp_b
metadata
misc
modem_a
modem_b
modemst1
modemst2
multiimgoem_a
multiimgoem_b
multiimgqti_a
multiimgqti_b
ocdt
oplus_sec_a
oplus_sec_b
oplusdycnvbk
oplusreserve1
oplusreserve2
oplusreserve3
oplusreserve4
oplusreserve5
oplusstanvbk_a
oplusstanvbk_b
param
persist
preisp_dt
preisp_dt_bk
preisp_otp
qmcs
qupfw_a
qupfw_b
qweslicstore_a
qweslicstore_b
rawdump
recovery_a
recovery_b
rtice
rticmpdata_a
rticmpdata_b
secdata
shrm_a
shrm_b
splash_a
splash_b
splash_odm
spunvm
ssd
storsec
super
toolsfv
tz_a
tz_b
tzsc
uefi_a
uefi_b
uefisecapp_a
uefisecapp_b
uefivarstore
userdata
vbmeta_a
vbmeta_b
vbmeta_system_a
vbmeta_system_b
vbmeta_vendor_a
vbmeta_vendor_b
vendor_boot_a
vendor_boot_b
vm-bootsys_a
vm-bootsys_b
vm-data
vm-persist
xbl_a
xbl_b
xbl_config_a
xbl_config_b
xbl_ramdump_a
xbl_ramdump_b
xbl_sc_logs
xbl_sc_test_mode
My question is if I went the termux route or the adb shell route to try and do a backup using the command:
Code:
adb exec-out "su -c dd if=$Partition_Path/$Partition of=/sdcard/Backup/$Partition.img"
which of these partitions would be the ones I should focus on backing up? By the way, there are 3 partitions that are HUGE so I don't think they're necessary, but let me know if they are. The 3 partitions are super, userdata, and logdump. By the way userdata is like over 100Gb, and that's unrealistic because my phone def doesn't have that much data on there.
Click to expand...
Click to collapse
All settings and apps and app data is stored on /data. If you backup /data and save it on /sdcard (which is the path /data/media/0) your backup runs infinitely
TWRP does a backup either by dd or with tar. The command dd creates an image and tar an archive. It doesn't make sense to create an image of /data for two reasons: encryption will be corrupt and you don't have enough storage space on /data to save an image of /data.
What TWRP does: Create an archive of /data with tar, but exclude /data/media. It looks like this in Termux:
Code:
tar -cv --exclude='media/*' --file=/storage/$EXT/data.ext4.win000 /data
This saves the backup on an external sd. You can change it to
Code:
tar -cv --exclude='media/*' --file=/data/media/0/data.ext4.win000 /data
for saving the backup in your internal storage.
WoKoschekk said:
All settings and apps and app data is stored on /data. If you backup /data and save it on /sdcard (which is the path /data/media/0) your backup runs infinitely
Click to expand...
Click to collapse
So basically infinite loop? Is there any way to break out of it? Or what if I back it up to another partition that has RW and then when it's done move it to the sdcard?
Also I'm trying to understand how to use tar with exec-out. Would it be something like this:
Code:
adb exec-out "su -c dd if=/dev/block/bootdevice/by-name/userdata && tar -cz -p --exclude='media*' --exclude='*-cache' /sdcard/userdata.tar"
it's also possible to split the archive in several parts:
Code:
tar -cv --exclude='media/*' -ML 1572864 --file=/data/media/0/data.ext4.win000 --file=/data/media/0/data.ext4.win001 --file=/data/media/0/data.ext4.win002 /data
this way you get 3 parts with a size of 1,5GB for each of it.
please wait, it's a bit more complicated
do you have a TWRP backup of any phone?
Unfortunately I don't have a phone with TWRP. I do have a oneplus 9 Pro (LE2125) on hand, but it doesn't have TWRP either. As far as I am aware TWRP isn't available for the OP9 pro.
By the way, I really appreciate your help and your examples. Thank you!
m0d hipp¥ said:
Unfortunately I don't have a phone with TWRP. I do have a oneplus 9 Pro (LE2125) on hand, but it doesn't have TWRP either. As far as I am aware TWRP isn't available for the OP9 pro.
By the way, I really appreciate your help and your examples. Thank you!
Click to expand...
Click to collapse
The 9 pro has twrp and it works on oos13 too.
m0d hipp¥ said:
Unfortunately I don't have a phone with TWRP. I do have a oneplus 9 Pro (LE2125) on hand, but it doesn't have TWRP either. As far as I am aware TWRP isn't available for the OP9 pro.
By the way, I really appreciate your help and your examples. Thank you!
Click to expand...
Click to collapse
Ok, here is a part of the recovery.log by TWRP. It starts with the beginning of a backup of /data:
Code:
I:operation_start: 'Nandroid'
Updating partition details...
I:Data backup size is 5760MB, free: 43310MB.
I:Unable to mount '/usb-otg'
I:Actual block device: '', current file system: 'auto'
...done
I:Backup Name is: '2023-06-07--22-01-50'
I:Backup_Folder is: '/external_sd/TWRP/BACKUPS/ZY322V8K28/2023-06-07--22-01-50'
I:Calculating backup details...
* Total number of partitions to back up: 1
* Total size of all data: 5760MB
* Available space: 53009MB
[BACKUP STARTED]
* Backup Folder: /external_sd/TWRP/BACKUPS/ZY322V8K28/2023-06-07--22-01-50
Invalid encryption mode file /data/unencrypted/mode
Backing up Data (excl. storage)...
Backups of Data do not include any files in internal storage such as pictures or downloads.
Invalid encryption mode file /data/unencrypted/mode
Breaking backup file into multiple archives...
I:Creating backup...
I:Creating tar file '/external_sd/TWRP/BACKUPS/ZY322V8K28/2023-06-07--22-01-50/data.ext4.win000'
I:addFile '/data/ota' including root: 1
==> set selinux context: u:object_r:ota_data_file:s0
Click to expand...
Click to collapse
TWRP does exclude the "storage" which is /data/media. This directory gets always mounted as /storage/emulated/0 for security reasons on every Android phone.The path /storage/emulated/0 is the sdcardfs (virtual filesystem, see here for more info). Additionally it's always linked as /sdcard in the system.
So, /data/media = /storage/emulated/0 = /sdcard!
The log shows also that TWRP saves the files of /data as a tar archive. But tar ≠ tar if you compare Android's tar with the one of Termux.
Android's tar:
Code:
usage: tar -[cxtjzhmvO] [-X FILE] [-T FILE] [-f TARFILE] [-C DIR]
Create, extract, or list files from a tar file
Operation:
c Create
f Name of TARFILE ('-' for stdin/out)
h Follow symlinks
j (De)compress using bzip2
m Don't restore mtime
t List
v Verbose
x Extract
z (De)compress using gzip
C Change to DIR before operation
O Extract to stdout
exclude=FILE File to exclude
X File with names to exclude
T File with names to include
Termux:
Code:
Usage: tar [OPTION...] [FILE]...
GNU 'tar' saves many files together into a single tape or disk archive, and can
restore individual files from the archive.
Examples:
tar -cf archive.tar foo bar # Create archive.tar from files foo and bar.
tar -tvf archive.tar # List all files in archive.tar verbosely.
tar -xf archive.tar # Extract all files from archive.tar.
Main operation mode:
-A, --catenate, --concatenate append tar files to an archive
-c, --create create a new archive
--delete delete from the archive (not on mag tapes!)
-d, --diff, --compare find differences between archive and file system
-r, --append append files to the end of an archive
--test-label test the archive volume label and exit
-t, --list list the contents of an archive
-u, --update only append files newer than copy in archive
-x, --extract, --get extract files from an archive
Operation modifiers:
--check-device check device numbers when creating incremental
archives (default)
-g, --listed-incremental=FILE handle new GNU-format incremental backup
-G, --incremental handle old GNU-format incremental backup
--hole-detection=TYPE technique to detect holes
--ignore-failed-read do not exit with nonzero on unreadable files
--level=NUMBER dump level for created listed-incremental archive
--no-check-device do not check device numbers when creating
incremental archives
--no-seek archive is not seekable
-n, --seek archive is seekable
--occurrence[=NUMBER] process only the NUMBERth occurrence of each file
in the archive; this option is valid only in
conjunction with one of the subcommands --delete,
--diff, --extract or --list and when a list of
files is given either on the command line or via
the -T option; NUMBER defaults to 1
--sparse-version=MAJOR[.MINOR]
set version of the sparse format to use (implies
--sparse)
-S, --sparse handle sparse files efficiently
Local file name selection:
--add-file=FILE add given FILE to the archive (useful if its name
starts with a dash)
-C, --directory=DIR change to directory DIR
--exclude=PATTERN exclude files, given as a PATTERN
--exclude-backups exclude backup and lock files
--exclude-caches exclude contents of directories containing
CACHEDIR.TAG, except for the tag file itself
--exclude-caches-all exclude directories containing CACHEDIR.TAG
--exclude-caches-under exclude everything under directories containing
CACHEDIR.TAG
--exclude-ignore=FILE read exclude patterns for each directory from
FILE, if it exists
--exclude-ignore-recursive=FILE
read exclude patterns for each directory and its
subdirectories from FILE, if it exists
--exclude-tag=FILE exclude contents of directories containing FILE,
except for FILE itself
--exclude-tag-all=FILE exclude directories containing FILE
--exclude-tag-under=FILE exclude everything under directories
containing FILE
--exclude-vcs exclude version control system directories
--exclude-vcs-ignores read exclude patterns from the VCS ignore files
--no-null disable the effect of the previous --null option
--no-recursion avoid descending automatically in directories
--no-unquote do not unquote input file or member names
--no-verbatim-files-from -T treats file names starting with dash as
options (default)
--null -T reads null-terminated names; implies
--verbatim-files-from
--recursion recurse into directories (default)
-T, --files-from=FILE get names to extract or create from FILE
--unquote unquote input file or member names (default)
--verbatim-files-from -T reads file names verbatim (no escape or option
handling)
-X, --exclude-from=FILE exclude patterns listed in FILE
File name matching options (affect both exclude and include patterns):
--anchored patterns match file name start
--ignore-case ignore case
--no-anchored patterns match after any '/' (default for
exclusion)
--no-ignore-case case sensitive matching (default)
--no-wildcards verbatim string matching
--no-wildcards-match-slash wildcards do not match '/'
--wildcards use wildcards (default for exclusion)
--wildcards-match-slash wildcards match '/' (default for exclusion)
Overwrite control:
--keep-directory-symlink preserve existing symlinks to directories when
extracting
--keep-newer-files don't replace existing files that are newer than
their archive copies
-k, --keep-old-files don't replace existing files when extracting,
treat them as errors
--no-overwrite-dir preserve metadata of existing directories
--one-top-level[=DIR] create a subdirectory to avoid having loose files
extracted
--overwrite overwrite existing files when extracting
--overwrite-dir overwrite metadata of existing directories when
extracting (default)
--recursive-unlink empty hierarchies prior to extracting directory
--remove-files remove files after adding them to the archive
--skip-old-files don't replace existing files when extracting,
silently skip over them
-U, --unlink-first remove each file prior to extracting over it
-W, --verify attempt to verify the archive after writing it
Select output stream:
--ignore-command-error ignore exit codes of children
--no-ignore-command-error treat non-zero exit codes of children as
error
-O, --to-stdout extract files to standard output
--to-command=COMMAND pipe extracted files to another program
Handling of file attributes:
--atime-preserve[=METHOD] preserve access times on dumped files, either
by restoring the times after reading
(METHOD='replace'; default) or by not setting the
times in the first place (METHOD='system')
--clamp-mtime only set time when the file is more recent than
what was given with --mtime
--delay-directory-restore delay setting modification times and
permissions of extracted directories until the end
of extraction
--group=NAME force NAME as group for added files
--group-map=FILE use FILE to map file owner GIDs and names
--mode=CHANGES force (symbolic) mode CHANGES for added files
--mtime=DATE-OR-FILE set mtime for added files from DATE-OR-FILE
-m, --touch don't extract file modified time
--no-delay-directory-restore
cancel the effect of --delay-directory-restore
option
--no-same-owner extract files as yourself (default for ordinary
users)
--no-same-permissions apply the user's umask when extracting permissions
from the archive (default for ordinary users)
--numeric-owner always use numbers for user/group names
--owner=NAME force NAME as owner for added files
--owner-map=FILE use FILE to map file owner UIDs and names
-p, --preserve-permissions, --same-permissions
extract information about file permissions
(default for superuser)
--same-owner try extracting files with the same ownership as
exists in the archive (default for superuser)
--sort=ORDER directory sorting order: none (default), name or
inode
-s, --preserve-order, --same-order
member arguments are listed in the same order as
the files in the archive
Handling of extended file attributes:
--acls Enable the POSIX ACLs support
--no-acls Disable the POSIX ACLs support
--no-selinux Disable the SELinux context support
--no-xattrs Disable extended attributes support
--selinux Enable the SELinux context support
--xattrs Enable extended attributes support
--xattrs-exclude=MASK specify the exclude pattern for xattr keys
--xattrs-include=MASK specify the include pattern for xattr keys
Device selection and switching:
--force-local archive file is local even if it has a colon
-f, --file=ARCHIVE use archive file or device ARCHIVE
-F, --info-script=NAME, --new-volume-script=NAME
run script at end of each tape (implies -M)
-L, --tape-length=NUMBER change tape after writing NUMBER x 1024 bytes
-M, --multi-volume create/list/extract multi-volume archive
--rmt-command=COMMAND use given rmt COMMAND instead of rmt
--rsh-command=COMMAND use remote COMMAND instead of rsh
--volno-file=FILE use/update the volume number in FILE
Device blocking:
-b, --blocking-factor=BLOCKS BLOCKS x 512 bytes per record
-B, --read-full-records reblock as we read (for 4.2BSD pipes)
-i, --ignore-zeros ignore zeroed blocks in archive (means EOF)
--record-size=NUMBER NUMBER of bytes per record, multiple of 512
Archive format selection:
-H, --format=FORMAT create archive of the given format
FORMAT is one of the following:
gnu GNU tar 1.13.x format
oldgnu GNU format as per tar <= 1.12
pax POSIX 1003.1-2001 (pax) format
posix same as pax
ustar POSIX 1003.1-1988 (ustar) format
v7 old V7 tar format
--old-archive, --portability
same as --format=v7
--pax-option=keyword[[:]=value][,keyword[[:]=value]]...
control pax keywords
--posix same as --format=posix
-V, --label=TEXT create archive with volume name TEXT; at
list/extract time, use TEXT as a globbing pattern
for volume name
Compression options:
-a, --auto-compress use archive suffix to determine the compression
program
-I, --use-compress-program=PROG
filter through PROG (must accept -d)
-j, --bzip2 filter the archive through bzip2
-J, --xz filter the archive through xz
--lzip filter the archive through lzip
--lzma filter the archive through lzma
--lzop filter the archive through lzop
--no-auto-compress do not use archive suffix to determine the
compression program
--zstd filter the archive through zstd
-z, --gzip, --gunzip, --ungzip filter the archive through gzip
-Z, --compress, --uncompress filter the archive through compress
Local file selection:
--backup[=CONTROL] backup before removal, choose version CONTROL
--hard-dereference follow hard links; archive and dump the files they
refer to
-h, --dereference follow symlinks; archive and dump the files they
point to
-K, --starting-file=MEMBER-NAME
begin at member MEMBER-NAME when reading the
archive
--newer-mtime=DATE compare date and time when data changed only
-N, --newer=DATE-OR-FILE, --after-date=DATE-OR-FILE
only store files newer than DATE-OR-FILE
--one-file-system stay in local file system when creating archive
-P, --absolute-names don't strip leading '/'s from file names
--suffix=STRING backup before removal, override usual suffix ('~'
unless overridden by environment variable
SIMPLE_BACKUP_SUFFIX)
File name transformations:
--strip-components=NUMBER strip NUMBER leading components from file
names on extraction
--transform=EXPRESSION, --xform=EXPRESSION
use sed replace EXPRESSION to transform file
names
Informative output:
--checkpoint[=NUMBER] display progress messages every NUMBERth record
(default 10)
--checkpoint-action=ACTION execute ACTION on each checkpoint
--full-time print file time to its full resolution
--index-file=FILE send verbose output to FILE
-l, --check-links print a message if not all links are dumped
--no-quote-chars=STRING disable quoting for characters from STRING
--quote-chars=STRING additionally quote characters from STRING
--quoting-style=STYLE set name quoting style; see below for valid STYLE
values
-R, --block-number show block number within archive with each message
--show-defaults show tar defaults
--show-omitted-dirs when listing or extracting, list each directory
that does not match search criteria
--show-snapshot-field-ranges
show valid ranges for snapshot-file fields
--show-transformed-names, --show-stored-names
show file or archive names after transformation
--totals[=SIGNAL] print total bytes after processing the archive;
with an argument - print total bytes when this
SIGNAL is delivered; Allowed signals are: SIGHUP,
SIGQUIT, SIGINT, SIGUSR1 and SIGUSR2; the names
without SIG prefix are also accepted
--utc print file modification times in UTC
-v, --verbose verbosely list files processed
--warning=KEYWORD warning control
-w, --interactive, --confirmation
ask for confirmation for every action
Compatibility options:
-o when creating, same as --old-archive; when
extracting, same as --no-same-owner
Other options:
-?, --help give this help list
--restrict disable use of some potentially harmful options
--usage give a short usage message
--version print program version
Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.
The backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.
The version control may be set with --backup or VERSION_CONTROL, values are:
none, off never make backups
t, numbered make numbered backups
nil, existing numbered if numbered backups exist, simple otherwise
never, simple always make simple backups
Valid arguments for the --quoting-style option are:
literal
shell
shell-always
shell-escape
shell-escape-always
c
c-maybe
escape
locale
clocale
*This* tar defaults to:
--format=gnu -f- -b20 --quoting-style=escape
--rmt-command=/data/data/com.termux/files/usr/libexec/rmt
You see the difference...
Download Termux here.
Open it and first of all run pkg update

Categories

Resources