Sample Header Ad - 728x90

Android Enthusiasts

Q&A for enthusiasts and power users of the Android operating system

Latest Questions

9 votes
1 answers
12582 views
How can I tell whether I am booted into the A or B partition?
Android can install to an A or a B partition. This seems to be a default these days. How can I tell which one I am booted into using `adb`? I am using LineageOS 17.1.
Android can install to an A or a B partition. This seems to be a default these days. How can I tell which one I am booted into using adb? I am using LineageOS 17.1.
Evan Carroll (4661 rep)
Nov 15, 2020, 06:09 AM • Last activity: Jun 29, 2025, 10:16 AM
0 votes
1 answers
99 views
How to increase ZRAM size on devices shipping with Android >=4.0?
I've recently got this new device which shipped with an Android >=4.0 Jelly Bean, and I was wondering how to increase zram on it because with the current parameters, it happens that even the foreground application goes out of memory and gets killed by the system. So you know, weird. You know, becaus...
I've recently got this new device which shipped with an Android >=4.0 Jelly Bean, and I was wondering how to increase zram on it because with the current parameters, it happens that even the foreground application goes out of memory and gets killed by the system. So you know, weird. You know, because I have other devices with the same 2 gigabytes of RAM which shipped with Android Jelly Bean and still run this same very recent Android version this new device runs on which I have never experienced this issue unless than when like I enable all types of tethering and run >10 applications in the background at the same time. I've heard it like supports something new called "Treble". I've also read now that there are Android Java applications whose entire purpose is just editing the zram parameters, which seems totally wild and inappropriate to me, so I was wondering if it was possible to do it properly without having to deal with such weird stuff.
Scrooge McDuck (158 rep)
Mar 26, 2025, 10:01 PM • Last activity: Mar 27, 2025, 03:58 PM
1 votes
0 answers
142 views
Is it possible to switch slots with virtual A/B in AOSP device using fastbootd?
My Android device is an AOSP 14 launch device, based on x86_64 architecture, bootloader is also unlocked. **Seamless A/B** support and **Dynamic partitions** support is present in my device. Also I can switch slots using **fastbootd** (`fastboot set_active `). By flashing images to both slots, I can...
My Android device is an AOSP 14 launch device, based on x86_64 architecture, bootloader is also unlocked. **Seamless A/B** support and **Dynamic partitions** support is present in my device. Also I can switch slots using **fastbootd** (fastboot set_active ). By flashing images to both slots, I can set _a/_b slot as active and the device will boot with that slot. Recently, I enabled virtual A/B support in the device. Is slot switching still possible with **fastbootd**? As far as I know, with virtual A/B, slot_a and slot_b dynamic partitions will **not** present inside the super image at a time, slot switch will happen only through OTA. During OTA, the update will get snapshotted and applied on the base device, and if it succeeded, that snapshot got merged with the base device and the active slot will be switched to another slot.
jayanth vutukuri (21 rep)
Dec 2, 2024, 06:06 AM • Last activity: Dec 6, 2024, 02:38 PM
1 votes
3 answers
1339 views
lpmake error "Partition should only have linear extents:"
I'm trying to extract the content of super.img, modify some elements then repack it again. I followed all the steps correctly to extract the contents of `super.img` file. When running `stat '%n %s *.img` for all images, I get the following sizes: ``` super.img 9663676416 ``` For the partitions withi...
I'm trying to extract the content of super.img, modify some elements then repack it again. I followed all the steps correctly to extract the contents of super.img file. When running stat '%n %s *.img for all images, I get the following sizes:
super.img 9663676416
For the partitions within super.img, I get the following:
mi_ext_a.img 4096
mi_ext_b.img 0
odm_a.img 755478528
odm_b.img 0
product_a.img 2827481088
product_b.img 0
system_a.img 644575232
system_b.img 0
system_dlkm_a.img 98304
system_dlkm_b.img 0
system_ext_a.img 503472128
system_ext_b.img 0
vendor_a.img 1484333056
vendor_b.img 0
vendor_dlkm_a.img 37294080
vendor_dlkm_b.img 0
I noticed that the sum of the partitions is 6252732416 which is less than the super.img size (don't know if this is the problem) Now, without even modifying any partition content, I wanted to use lpmake to re-create the super.img again, hence, I created this batch
lpmake \
 --metadata-size 4096 \
 --super-name super \
 --metadata-slots 2 \
 --device super:9663676416 \
 --group main:6252736512 \
 --partition system_a:readonly:644575232:main --image system_a=./system_a.img  \
 --partition system_b:readonly:0:main --image system_b=./system_b.img \
 --partition system_ext_a:readonly:503472128:main --image system_ext_a=./system_ext_a.img  \
 --partition system_ext_b:readonly:0:main --image system_ext_b=./system_ext_b.img \
 --partition system_dlkm_a:readonly:98304:main --image system_dlkm_a=./system_dlkm_a.img \
 --partition system_dlkm_b:readonly:0:main --image system_dlkm_b=./system_dlkm_b.img \
 --partition product_a:readonly:2827481088:main --image product_a=./product_a.img  \
 --partition product_b:readonly:0:main --image product_b=./product_b.img \
 --partition vendor_a:readonly:1484333056:main --image vendor_a=./vendor_a.img \
 --partition vendor_b:readonly:0:main --image vendor_b=./vendor_b.img \
 --partition vendor_dlkm_a:readonly:37294080:main --image vendor_dlkm_a=./vendor_dlkm_a.img \
 --partition vendor_dlkm_b:readonly:0:main --image vendor_dlkm_b=./vendor_dlkm_b.img \
 --partition mi_ext_a:readonly:4096:main --image mi_ext_a=./mi_ext_a.img \
 --partition mi_ext_b:readonly:0:main --image mi_ext_b=./mi_ext_b.img \
 --partition odm_a:readonly:755478528:main --image odm_a=./odm_a.img \
 --partition odm_b:readonly:0:main --image odm_b=./odm_b.img \
 --sparse \
 --output ./super.new.img
Yet, I'm getting the below error:
lpmake I 02-07 20:36:57 3610213 3610213 builder.cpp:1012] [liblp]Partition system_a will resize from 0 bytes to 644575232 bytes
lpmake I 02-07 20:36:57 3610213 3610213 builder.cpp:1012] [liblp]Partition system_ext_a will resize from 0 bytes to 503472128 bytes
lpmake I 02-07 20:36:57 3610213 3610213 builder.cpp:1012] [liblp]Partition system_dlkm_a will resize from 0 bytes to 98304 bytes
lpmake I 02-07 20:36:57 3610213 3610213 builder.cpp:1012] [liblp]Partition product_a will resize from 0 bytes to 2827481088 bytes
lpmake I 02-07 20:36:57 3610213 3610213 builder.cpp:1012] [liblp]Partition vendor_a will resize from 0 bytes to 1484333056 bytes
lpmake I 02-07 20:36:57 3610213 3610213 builder.cpp:1012] [liblp]Partition vendor_dlkm_a will resize from 0 bytes to 37294080 bytes
lpmake I 02-07 20:36:57 3610213 3610213 builder.cpp:1012] [liblp]Partition mi_ext_a will resize from 0 bytes to 4096 bytes
lpmake I 02-07 20:36:57 3610213 3610213 builder.cpp:1012] [liblp]Partition odm_a will resize from 0 bytes to 755478528 bytes
Invalid sparse file format at header magic
Invalid sparse file format at header
Invalid sparse file format at header magic
Invalid sparse file format at header
Invalid sparse file format at header magic
Invalid sparse file format at header
Invalid sparse file format at header magic
Invalid sparse file format at header
Invalid sparse file format at header magic
Invalid sparse file format at header
Invalid sparse file format at header magic
Invalid sparse file format at header
Invalid sparse file format at header magic
Invalid sparse file format at header
Invalid sparse file format at header magic
lpmake E 02-07 20:36:59 3610213 3610213 images.cpp:320][liblp]Partition should only have linear extents: odm_b
Regardless of changing the order above, it keeps giving the same error for the last partition in the script. Any idea how to get it properly configured?
zinger (111 rep)
Feb 7, 2023, 05:40 PM • Last activity: Sep 15, 2023, 12:26 PM
1 votes
1 answers
3416 views
A/B devices: Switch slots without using PC
I've seen this question asked two years ago https://android.stackexchange.com/q/245205/131553 which asks for the same on Android 9,but with so many tools being developed (and abandoned) and changes in Android versions , is it possible now? I use Pixel 4a/6a, rooted, Magisk 25.2 on Android 13. There...
I've seen this question asked two years ago https://android.stackexchange.com/q/245205/131553 which asks for the same on Android 9,but with so many tools being developed (and abandoned) and changes in Android versions , is it possible now? I use Pixel 4a/6a, rooted, Magisk 25.2 on Android 13. There aren't any TWRP recoveries for them. With the perpetual cat and mouse game between root detection by banking and such like apps, I feel the cat (Google) will have an upper hand soon. So my thought is to have one slot rooted and the other slot unrooted and on the fly switch slots using an Android based way. I know it can be done using a PC but that's not what I want. Does anyone know of any way? Maybe Termux based or some kind of scripting? Or Magisk/Edxposed modules? I don't want multi-ROM or dual booting solutions (doubt if they exist for current Android versions) Edit 1. [Switch My Slot](https://github.com/gibcheesepuffs/Switch-My-Slot-Android) hasn't been updated after 2021. When I run that it closes saying bootctl binary missing 2. [Magisk Bootctl Binary](https://github.com/roihershberg/bootctl-binary) works only upto Android 12. I tried it but there appear to be some Magisk limitations too apart from failing since it is not designed for current API level. 3. I couldn't find any bootctl Magisk module in various repos
beeshyams (41525 rep)
Jul 22, 2023, 05:53 AM • Last activity: Jul 24, 2023, 12:04 AM
1 votes
2 answers
4468 views
Accidentally flashed TWRP on both A/B partitions on Xiaomi Mi A2 Lite
I decided to try to root my Xiaomi Mi A2 Lite. I accidentally flashed `twrp-3.2.3-0-daisy.img` on both A and B partitions. Because of that, now I can only access the TWRP menu. I think I should download the official ROM and get its boot file, but I'm not sure and I don't want to mess it up more. I'v...
I decided to try to root my Xiaomi Mi A2 Lite. I accidentally flashed twrp-3.2.3-0-daisy.img on both A and B partitions. Because of that, now I can only access the TWRP menu. I think I should download the official ROM and get its boot file, but I'm not sure and I don't want to mess it up more. I've downloaded the ROM and found this boot.img file. Image. If that's it, is it enough to flash it? And in which partition? A or B?
Sapu (11 rep)
Nov 24, 2018, 02:26 PM • Last activity: Jun 12, 2023, 09:09 AM
1 votes
1 answers
1566 views
Rebuilt `super` partition won't boot
I'm trying to customize an Android 11 super partition, removing certain apps. I used [https://forum.xda-developers.com/t/guide-ota-tools-lpunpack.4041843/][1] to unpack the `super` partition, mounted them as read-write using the instructions [here][2] and then repacked them as follows: ``` ~/otatool...
I'm trying to customize an Android 11 super partition, removing certain apps. I used https://forum.xda-developers.com/t/guide-ota-tools-lpunpack.4041843/ to unpack the super partition, mounted them as read-write using the instructions here and then repacked them as follows:
~/otatools/bin/lpmake \
--metadata-size 65536 \
--metadata-slots 2 \
--device super:2684354560 \
--group qti_dynamic_partitions:2680160256 \
--partition system:readonly:700383232:qti_dynamic_partitions \
--image system=./system.img \
--partition system_ext:readonly:300167168:qti_dynamic_partitions \
--image system_ext=./system_ext.img \
--partition product:readonly:68022272:qti_dynamic_partitions \
--image product=./product.img \
--partition vendor:readonly:304410624:qti_dynamic_partitions \
--image vendor=./vendor.img \
--output ./super.img
The command executes fine with the usual messages about invalid sparse images. But when I flash it using EDL mode, the phone won't boot. Furthermore, 7zip won't open this file like it opens the original super image, it detects it as a different format. It doesn't seem to be a boot verity issue. Obviously, I'm doing something wrong, but what?
Ytagger (21 rep)
Oct 20, 2021, 06:28 PM • Last activity: Mar 9, 2023, 01:53 PM
1 votes
1 answers
1482 views
How is system-as-root mounted in Android 9?
In Android 9, `system.img` consist of system and ramdisk. So kernel will mount `system.img` directly and implement `init` program. Next, `init` will parse `init.rc` file and mount remaining partitions based on `fstab` file. But, there is some thing in `fstab` file that I don't understand : ``` /dev/...
In Android 9, system.img consist of system and ramdisk. So kernel will mount system.img directly and implement init program. Next, init will parse init.rc file and mount remaining partitions based on fstab file. But, there is some thing in fstab file that I don't understand :
/dev/block/by-name/system      /      ext4    ro,barrier=1
Here, system is mounted as root in fstab file. I thought that system.img is mount before to execute init program but here, system.img is mouted again. Can someone explain this for me?
hugtech (123 rep)
Sep 29, 2019, 01:32 AM • Last activity: Jul 25, 2022, 04:36 PM
5 votes
0 answers
2073 views
How to switch slots without a computer or using TWRP?
I'm working with Android 9 Pie and I have one slot rooted (slot A) and the other is not (slot B). My reasoning to have my phone this way is because I need the non-rooted side to log in to the app I use for my job. (Even though it still works if I log in on slot B and then switch slots via TWRP witho...
I'm working with Android 9 Pie and I have one slot rooted (slot A) and the other is not (slot B). My reasoning to have my phone this way is because I need the non-rooted side to log in to the app I use for my job. (Even though it still works if I log in on slot B and then switch slots via TWRP without logging out). I've tried the outdated [Switch My Slot](https://github.com/gibcheesepuffs/Switch-My-Slot-Android) app which crashes immediately. I'm mostly looking for a command I can run via termux to speed things up as opposed to just switching slots in TWRP which takes longer than just a command that would switch slots and reboot. How to switch slots without a computer or using TWRP?
user1091091 (51 rep)
Feb 2, 2022, 04:20 AM • Last activity: Feb 2, 2022, 11:29 PM
0 votes
0 answers
232 views
Resize USB internal storage and use some as external without formatting the whole USB
I expanded my Amazon FireTV 4K Max (Fire TV Home Version 6341067.1 running Fire OS 7.2.5.5 PS7255/2444) storage by installing a USB flash drive together with an OTG and a usb 3.0 hub but i formatted the whole USB as internal storage. I would like to know if is it possible to resize the USB partition...
I expanded my Amazon FireTV 4K Max (Fire TV Home Version 6341067.1 running Fire OS 7.2.5.5 PS7255/2444) storage by installing a USB flash drive together with an OTG and a usb 3.0 hub but i formatted the whole USB as internal storage. I would like to know if is it possible to resize the USB partition used as internal storage so i canuse the rest of the USB as external storage without having to format the whole USB? Hope someone can help. Thanks in advanced. :)
peris (101 rep)
Dec 29, 2021, 08:05 PM
2 votes
0 answers
532 views
What is Dynamic system update
Is seamless update(a/b partition) same as dynamic system update Or Can I use DSU in A only devices & how do I know if my device supports dsu updates. I have lineageos 18.1
Is seamless update(a/b partition) same as dynamic system update Or Can I use DSU in A only devices & how do I know if my device supports dsu updates. I have lineageos 18.1
Vivek Singh (21 rep)
Nov 6, 2021, 03:42 AM • Last activity: Nov 6, 2021, 05:00 AM
2 votes
3 answers
6265 views
Manually create A/B partitions
I have a Xiaomi Mi 6X which is the Chinese version of A2. There is a way to convert it into A2, but OTA updates won't work because 6X has only A partition. I'm not sure, but I've read, it is possible to create/delete partitions on an Android device. So I want to create A/B partitions manually, but I...
I have a Xiaomi Mi 6X which is the Chinese version of A2. There is a way to convert it into A2, but OTA updates won't work because 6X has only A partition. I'm not sure, but I've read, it is possible to create/delete partitions on an Android device. So I want to create A/B partitions manually, but I have no idea how it looks like.
Aray Karjauv (121 rep)
Feb 4, 2019, 02:15 PM • Last activity: Sep 27, 2021, 10:06 AM
1 votes
0 answers
504 views
Is it proper to format /data and /cache before running the LineageOS copy_partitions_script?
I've recently flashed LineageOS to my OnePlus6T by following the official guide on the Lineage website, I'm now writing a script I can run on my desktop which will perform the same procedure on a second device. In the official guide the instruction is to flash the provided script, which copies the c...
I've recently flashed LineageOS to my OnePlus6T by following the official guide on the Lineage website, I'm now writing a script I can run on my desktop which will perform the same procedure on a second device. In the official guide the instruction is to flash the provided script, which copies the content of the active partition slot onto the inactive slot: > In some cases slot b can be unpopulated or contain much older firmware > than slot a, leading to various issues including a potential > hard-brick. We can ensure none of that will happen by copying the > contents of slot a to slot b. This step is NOT optional. My question is: is it proper/safe/optimal to wipe the userdata and cache partitions *before* flashing the copy_partitions_script? I can't see any reason why it wouldn't be and doing so would enable me to reduce the amount of interaction (read selecting things on the device) that the script would require. The official guide lists the data wipe as the next step after flashing the script, but it doesn't explicitly state that it *must* come after. Any insight would be much appreciated.
nohatsatthetable (181 rep)
Aug 17, 2021, 01:23 PM
1 votes
1 answers
4409 views
Faster way to copy slot B back to slot A after update
After update into Slot into B, is there any way to mirror the contents of B back to slot A? So that both slots have the same versions. How do copy complete updated slot B back to slot A efficiently?
After update into Slot into B, is there any way to mirror the contents of B back to slot A? So that both slots have the same versions. How do copy complete updated slot B back to slot A efficiently?
Amruth A (75 rep)
Apr 26, 2021, 01:52 PM • Last activity: May 3, 2021, 06:40 AM
1 votes
1 answers
3391 views
What's the purpose of A and B partition slots if both are flashed?
I recently play with LineageOS flashing (or actually adb-sideloading) tutorials, but I guess my question is more generic. In my device there are A and B partitions for everything except the `userdata` partition (and maybe something else). I understand the purpose is to provide extra safety against b...
I recently play with LineageOS flashing (or actually adb-sideloading) tutorials, but I guess my question is more generic. In my device there are A and B partitions for everything except the userdata partition (and maybe something else). I understand the purpose is to provide extra safety against bricking. Should anything go wrong during a flashing operation, there's the other slot. Now, **every tool and manual procedure I have seen flashes both A and B. Doesn't it render the whole concept useless? What's the gain from A and B slots if we keep on putting the same to both?**
Grzegorz Oledzki (173 rep)
Apr 28, 2020, 07:59 PM • Last activity: Apr 26, 2021, 01:57 PM
1 votes
1 answers
2394 views
How can I boot to a specific partition with ADB?
If I have ADB access to device, how can I specify the boot partition and reboot. I tried with `setprop` but this failed, #> setprop ro.boot.slot_suffix _b libc: Unable to set property "ro.boot.slot_suffix" to "_b": error code: 0xb setprop: failed to set property 'ro.boot.slot_suffix' to '_b'
If I have ADB access to device, how can I specify the boot partition and reboot. I tried with setprop but this failed, #> setprop ro.boot.slot_suffix _b libc: Unable to set property "ro.boot.slot_suffix" to "_b": error code: 0xb setprop: failed to set property 'ro.boot.slot_suffix' to '_b'
Evan Carroll (4661 rep)
Nov 15, 2020, 09:38 PM • Last activity: Nov 15, 2020, 11:56 PM
1 votes
0 answers
561 views
How can I change the partition (slot) that LineageOS Recovery targets?
If I boot into LinageOS Recovery, how can I tell what slot to target when I use `adb sideload`?
If I boot into LinageOS Recovery, how can I tell what slot to target when I use adb sideload?
Evan Carroll (4661 rep)
Nov 15, 2020, 07:55 AM
2 votes
0 answers
278 views
Persist changes to /system partition on A/B device (Android 9)
I’m trying to add the [F-Droid Privileged Extension](https://gitlab.com/fdroid/privileged-extension) using the OTA .zip to a [Fairphone 3](https://en.wikipedia.org/wiki/Fairphone_3) on which I’ve [installed /e/ OS](https://doc.e.foundation/devices/FP3/). I tried modifying the `update-binary` sc...
I’m trying to add the [F-Droid Privileged Extension](https://gitlab.com/fdroid/privileged-extension) using the OTA .zip to a [Fairphone 3](https://en.wikipedia.org/wiki/Fairphone_3) on which I’ve [installed /e/ OS](https://doc.e.foundation/devices/FP3/) . I tried modifying the update-binary script because the [mount points assumed in the script don’t quite seem to work on this device](https://gitlab.com/fdroid/privileged-extension/-/issues/69) , but although the files seem to be copied fine to the system partition(s) in recovery mode, when I reboot the phone, all the changes have disappeared. Is there anything else I need to do so that files copied to /dev/block/by-name/system_a or /dev/block/by-name/system_b in recovery mode stay around?
Socob (254 rep)
Jul 9, 2020, 06:06 PM • Last activity: Jul 16, 2020, 09:10 PM
1 votes
0 answers
1784 views
please explain the: >"adb shell sm partition disk:179,64 mixed 80" command
it is taken from https://android.stackexchange.com/questions/145457/i-want-to-split-one-microsd-card-into-two-parts-part-adoptable-storage-and-par what is 80 at the end? 80%? I ran that on an Adoptable Storage card and it erased many installed programs :/ lesson learned https://www.reddit.com/r/Moto...
London (11 rep)
Apr 25, 2020, 06:12 PM
3 votes
2 answers
2493 views
Treble devices not same as A/B devices and vice-versa. Why?
This XDA blog [How A/B Partitions and Seamless Updates Affect Custom Development on XDA](https://www.xda-developers.com/how-a-b-partitions-and-seamless-updates-affect-custom-development-on-xda/) has some Q&A's, of which : > * My device supports A/B partitions, does that mean I can make use of a Proj...
This XDA blog [How A/B Partitions and Seamless Updates Affect Custom Development on XDA](https://www.xda-developers.com/how-a-b-partitions-and-seamless-updates-affect-custom-development-on-xda/) has some Q&A's, of which : > * My device supports A/B partitions, does that mean I can make use of a Project Treble Generic System Image? > > Not necessarily. Project Treble and A/B support are unrelated. The **Motorola Moto Z2 Force doesn’t support Project Treble, yet it supports the A/B partition scheme**. > > * My device supports Project Treble, does that mean I have an A/B partition scheme? > > This is not always the case. The Honor 9 Lite is a prime example as it **supports Project Treble yet does not have an A/B partition scheme**. (Emphasis added) I thought Treble and A/B devices are synonymous in the sense having one implied other. That's not the case **Why is this? What are the differences?**
beeshyams (41525 rep)
Apr 14, 2020, 10:38 AM • Last activity: Apr 15, 2020, 06:55 AM
Showing page 1 of 20 total questions