5

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.

0

1 Answer 1

11

The right-most way (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

Using getvar

$ adb shell /bin/getprop ro.boot.slot_suffix
_b

From fastboot

$ fastboot getvar all

And find in the output: (bootloader) current-slot: a

Other ways

From /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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .