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
I am using LineageOS 17.1.
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It only takes a minute to sign up.Sign up to join this community
The command to provide this information is
root (having run
adb root), you can use this like this,
$ adb shell bootctl get-current-slot
Note this is the slot's number, you resolve that to the letter with,
$ adb shell 'bootctl get-suffix $(bootctl get-current-slot)'
See also: How can I boot to a specific partition with ADB?, which also uses
$ adb shell /bin/getprop ro.boot.slot_suffix _b
$ fastboot getvar all
And find in the output:
(bootloader) current-slot: a
This command from
$ grep -i 'DEBUG: boot_' /proc/bootloader_log
Or like this,
adb shell "grep -i 'DEBUG: boot_' /proc/bootloader_log"
It return output like this,
avb_slot_verify.c:325: DEBUG: boot_b: Loading entire partition.
I believe that's in reference to the
b partition that it's booting from.
You can also parse this out of
$ adb shell 'cat /proc/cmdline | tr " " "\n" | grep -i slot' androidboot.slot_suffix=_b