I've got a brand new Motorola Moto G7 Power running Android 9. I also have Ubuntu 19.04 running on my desktop. I want to root the phone.

I've managed to unlock the bootloader using Motorola's online instructions and the adb and fastboot utilities that come with Linux. The next step is to flash a custom recovery application on the recovery partition.

I'm trying to flash twrp-3.3.0-0-river.img, a new image that I grabbed from here. When I tried to use fastboot to flash the image, I got this error:

steven@steven-OptiPlex-7020:-/Desktop$ fastboot flash recovery twrp-3.3.0-0-river.img
target reported max download size of 536870912 bytes
sending 'recovery' (27584 KB)...
OKAY [  0.741s]
writing 'recovery'..
(bootloader) Invalid partition name recovery
FAILED (remote failure)
finished. total time: 0.742s

Screenshot of the terminal output

After this failed attempt, I attempted to put my phone into recovery just to see what would happen. What I got was a screen displaying the Android mascot on its back with its chest plate opened and a black exclamation point inside a red triangle. The words "No Command" were displayed underneath the graphic. After waiting a few minutes, the phone, on its own, booted normally. My phone's OS seems to operate perfectly fine.

I can only surmise that whatever was originally on my recovery partition from the manufacturer has been wiped and there is now nothing on the recovery partition at all. So, I decided to see if I could boot into the TWRP image directly without flashing it. So, I ran this in the terminal window: fastboot boot twrp-3.3.0-0-river.img. I received this as a response:

steven@steven-OptiPlex-7020:-/Desktop$ fastboot boot twrp-3.3.0-0-river.img
downloading 'boot.img'...
OKAY [  0.728s]
OKAY [  0.893s]
finished. total time: 1.621s

Screenshot of the terminal output

There didn't seem to be any errors. The phone, however, switched from the bootloader screen to the Motorola splash screen, and then just shut off with no further response.

So, what am I missing? How can I flash this image onto the recovery partition of my phone?

  • Thanks for the reply. Though, can you elaborate, please? I'm new to all of this. I assume Nougat is an older version of Android? How do I downgrade to another version of Android if I can't flash things? I mean, I would need to flash a new ROM onto my phone to do as you suggest. But, my very problem is that I CAN'T flash things.
    – tensor
    May 1, 2019 at 21:09
  • Your device don't have recovery partition, it is inside ramdisk. thats why fastboot flash recovery fails - see first screenshot "Invalid partition name"
    – alecxs
    May 2, 2019 at 10:34
  • OK, thanks. But, why are manufacturers doing things this way? Why bundle recovery inside of the boot image and not just have it be its own partition in memory?
    – tensor
    May 2, 2019 at 16:55

2 Answers 2


G7 Power, being a new device, has the new A/B partition layout, requiring new installation procedures that differ from standard A-only devices. This is clearly outlined in the thread where you got your image from:

This device has 2 "slots" for ROMs / firmware. TWRP will detect whichever slot is currently active and use that slot for backup AND restore. There are buttons on the reboot page and under backup -> options to change slots. Changing the active slot will cause TWRP to switch which slot that TWRP is backing up or restoring. You can make a backup of slot A, switch to B, then restore the backup which will restore the backup of A to slot B. Changing the slot in TWRP also tells the bootloader to boot that slot.

Decryption only works when TWRP is permanently installed.


To temporarily boot this recovery:

fastboot boot twrp-version-build-river.img

To permanently install it:

  • Temporarily boot TWRP
  • Put the TWRP image in your external SD Card or, in case you don't have one, push it to /data with adb this way: adb push twrp-version-build-river.img /data/
  • Tap Advanced -> Install Recovery Ramdisk -> Navigate to /data or /external_sd and select TWRP -> Swipe to Install
  • If you previously installed Magisk: Select Fix Recovery Bootloop from Advanced to fix/avoid recovery bootloops
  • Done! Optionally you can delete TWRP from /data or from your external SD Card now.

Read more carefully next time...

  • Thanks. But, that's my problem. Read where I wrote this in my original post: So, I decided to see if I could boot into the TWRP image directly without flashing it. So, I ran this in the terminal window: fastboot boot twrp-3.3.0-0-river.img I received this as a response: There didn't seem to be any errors. The phone, however, switched from the bootloader screen to the Motorola splash screen, and then just shut off with no further response. I can't run the image. My phone doesn't display anything. It just shuts off.
    – tensor
    May 2, 2019 at 1:39
  • Any ideas of how to get around this problem?
    – tensor
    May 2, 2019 at 1:40
  • So I only answered the less relevant half of the question (i.e. how to install permanently)... I don't see why it would do that (probably related to you using Ubuntu and the fastboot that comes with it, not sure), but I think you should redirect the question to that thread instead.
    – Andy Yan
    May 2, 2019 at 2:07
  • should i use windows instead? I couldnt find the drivers for windows. when i put my phone into bootloader mode, windows 7 cant find the drivers for it
    – tensor
    May 2, 2019 at 2:13
  • I managed to use fastboot to flash my device. I used the magisk approach you suggested.
    – tensor
    May 2, 2019 at 16:57

The twrp.img you trying to boot from is for Moto G7 (river). It is the wrong recovery, thats why it fails.

What you want is TWRP for your device Moto G7 Power (ocean).

Note: You can root your phone with Magisk without the need of TWRP, as written here.

For devices without TWRP one can port TWRP from similar device, the steps are these:

  • unpack your boot.img
  • find recovery inside ramdisk
  • unpack recovery
  • unpack twrp recovery
  • replace kernel, fstab and *init.rc
  • repack ported recovery
  • try if it is fine from fastboot boot recovery.img
  • replace recovery inside ramdisk
  • repack boot.img
  • try if it is fine from fastboot boot boot.img
  • flash boot.img from fastboot (A/B)
  • Oh yes, how silly as me to have missed the device codename mismatch. +1
    – Andy Yan
    May 2, 2019 at 13:32
  • OK. Thanks. I used your first suggestion and it worked like a charm.But, now here's another question. How do I UNroot my phone? would I just flash the original boot image that came with my phone? where can i find it? this link was on the page you linked to mega.nz/#!L0sHzSKY!323GrDQ8BTsPmKvrSoU7DV-2kJuVris0cWN8Xt3u_6o but i think that that is a full rom image. how do i extract the boot image from it?
    – tensor
    May 2, 2019 at 17:11
  • Yes. Use the stock boot.img you have downloaded before. But Magisk have Unroot option and backup of stock boot.img too, it will restored automatically. forum.xda-developers.com/showthread.php?t=3473445 didgeridoohan.com/magisk
    – alecxs
    May 2, 2019 at 18:59

You must log in to answer this question.

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