Unable to unlock/flash recovery

irha

Senior Member
Nov 18, 2010
213
31
48
I am trying to unlock the bootloader and flash TWRP for the first time. I followed the steps from here: https://wiki.lineageos.org/devices/s2/install

I turned on the unlock option in settings and unlocked via fastboot, rebooted it manually (it didn't reboot), and then tried to flash:
Code:
$ ./fastboot oem unlock-go
                                                   OKAY [  0.007s]
Finished. Total time: 0.007s
$ ./fastboot flash recovery twrp-3.3.1-0-s2.img
Sending 'recovery' (24618 KB)                      OKAY [  0.859s]
Writing 'recovery'                                 FAILED (remote: 'Partition flashing is not allowed')
fastboot: error: Command failed
$ ./fastboot reboot
Rebooting                                          OKAY [  0.001s]
Finished. Total time: 0.001s
$ ./adb reboot bootloader
$ ./fastboot flash recovery twrp-3.3.1-0-s2.img
Sending 'recovery' (24618 KB)                      OKAY [  0.779s]
Writing 'recovery'                                 FAILED (remote: 'Partition flashing is not allowed')
fastboot: error: Command failed
$ ./fastboot oem unlock-go
                                                   OKAY [  0.007s]
Finished. Total time: 0.007s
$ ./fastboot flash recovery twrp-3.3.1-0-s2.img
Sending 'recovery' (24618 KB)                      OKAY [  0.836s]
Writing 'recovery'                                 OKAY [  0.231s]
Finished. Total time: 1.071s
$ ./fastboot reboot recovery
Rebooting into recovery                            OKAY [  0.001s]
Finished. Total time: 0.001s
However, I got into the stock recovery page instead of TWRP. You can see above that the flash failed before I rebooted, but succeeded after that. Interesting observations:
- The above webpage indicates that the device should reset when I reboot, but it didn't, which means the unlock didn't work.
- When I went back to bootloader, the first attempt to flash failed, but when I ran another unlock it worked though apparently it did nothing.

Am I missing a step? I am using fastboot version 29.0.6-6198805 on Mac OS Mojave 10.14.6.
 

irha

Senior Member
Nov 18, 2010
213
31
48
Don't reboot to recovery via a command after flashing it.
Try rebooting using buttons, vol-up + power.
Thank you! That got me into TWRP with a dialog titled "Unmodified System Partition" with a slider to allow modifications. I am googling to see what this dialogue is about and how to get TWRP to permanently get installed.
 

irha

Senior Member
Nov 18, 2010
213
31
48
That's normal. Just enable modifications and that's it.
OK, I don't remember seeing it before (I haven't flashed in at least a couple of years). I ran `adb reboot recovery` and it did go back into TWRP, so I am assuming that it did get persisted. For some reason "Never show this screen..." option didn't work, which is fine, but does it indicate that something is still readonly?
 

irha

Senior Member
Nov 18, 2010
213
31
48
I was able to sideload the ROM and opengapps nano and it is booting up for the first time. I skipped the optional step to install root (AddonSU), I guess I can do it later too if I feel the need to get root. Thanks a lot for your quick help.
 
  • Like
Reactions: kalehrl
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone