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.
bootctl
)The command to provide this information is bootctl
. As 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 bootctl
getvar
$ adb shell /bin/getprop ro.boot.slot_suffix
_b
/proc/bootloader_log
This command from adb shell
$ 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.
/proc/cmdline
You can also parse this out of /proc/cmdline
$ adb shell 'cat /proc/cmdline | tr " " "\n" | grep -i slot'
androidboot.slot_suffix=_b
Q & A