yashsingh1/xdaforums huggingface dataset:
[Moto G5 Plus Guides, News, & Discussion] jijo12345:
help needed..

Hi.. I'm using moto G5S plus [XT1804]. I was running on stock android 8.1.0 oreo. Recently I unlocked the bootloader and flashed havoc OS based on android 10. But VoLTE was not working. So I've decided to set back to stock rom, stock recovery, and relock the bootloader, to make it full stock again. But my stock backup got accidentally deleted. So I had no other way to revert back to everything stock. Then I downloaded the official LMSA software from motorola to fix that. It has the option to fix the phone in fastboot mode. And I set my phone in fastboot mode and flashed Stock 8.1.0 oreo ROM. But then I found out that IMEI=0,cellular radio not turing on, and all my sensors except fingerprint sensor and rear proximity sensor stopped working. Then I searched internet for some way to fix that., and I found a way to fix it.

1. Install the recent custom ROM

2. run commands

fastboot erase modemst1

fastboot erase modemst2

3. Re-install [clean flash] stock ROM manually without these commands

fastboot erase modemst1

fastboot erase modemst2

actually they bought back the IMEI, but the cellular radio still doesn't turn on and sensors that I mentioned above still won't work. Also the IMEI only came back temporarily. If I flash the stock ROM once more, it will still turn back to zero. And I never flashed anyone else's persist knowingly. In fact I've only came to know about persist folder after this problem has happened to me.

Then I saw this thread. And I ran the commands with root access. But according to this thread, the persist file of mine is looking good. The difference is I got OEM_2951 instead of rfs and OEM_2952 instead of rfs_shared. I replaced rfs and rfs_shared with respective terms for oreo stock ROM

and the

/persist/rfs/msm/mpss/dhob.bin

/persist/rfs/msm/mpss/shob.bin

/persist/rfs/msm/mpss/dhob.bin.bak

files was there, where it should be. And still I ran the commands to change the ownership. And I got no error messages. But still the issue is not solved. Can anyone help????
[Moto G5 Plus Guides, News, & Discussion] jk1joel:
IMEI is still 0 even after following instructions.

- Which version of STOCK rom are you on?

NPNS25.137-93-18 (installed via TWRP and image from page linked to by OP).

- Are you rooted, and running the commands under root privileges?

Yes

- Have you ever flashed someone else's, or another device's persist?

No

- What functionality are you missing and trying to restore (e.g. IMEI=0, VolTE, etc)?

IMEI=0

- Do you get any error messages when trying to execute the commands?

I get something that might be an error when erasing the modem partitions. Is the "(bootloader) has-slot:modemst1: not found" message an error? I'm not sure, and Googling the message just turned up a bunch of people having problems with their Moto phone, but no explanations of what the message means or whether it's bad.

$ sudo fastboot erase modemst1
(bootloader) has-slot:modemst1: not found
Erasing 'modemst1' OKAY [ 0.035s]
Finished. Total time: 0.225s
$ sudo fastboot erase modemst2
(bootloader) has-slot:modemst2: not found
Erasing 'modemst2' OKAY [ 0.035s]
Finished. Total time: 0.225s

When the phone is completely booted, here's what the relevant parts of my persist look like:

potter:/ $ su -
potter:/ # find /persist/*rfs | xargs ls -ld
drwxrwx--- 3 rfs rfs_shared 4096 2020-07-15 02:21 /persist/hlos_rfs
drwxrwx--- 2 rfs rfs_shared 4096 1969-12-31 19:04 /persist/hlos_rfs/shared
drwx--x--x 6 rfs rfs 4096 2020-07-15 02:21 /persist/rfs
drwx------ 3 rfs rfs 4096 2020-07-15 02:21 /persist/rfs/apq
drwx------ 2 rfs rfs 4096 1969-12-31 19:04 /persist/rfs/apq/gnss
drwx------ 7 rfs rfs 4096 2020-07-15 02:21 /persist/rfs/mdm
drwx------ 2 rfs rfs 4096 1969-12-31 19:04 /persist/rfs/mdm/adsp
drwx------ 2 rfs rfs 4096 1969-12-31 19:04 /persist/rfs/mdm/mpss
drwx------ 2 rfs rfs 4096 1970-02-14 23:41 /persist/rfs/mdm/slpi
drwx------ 2 rfs rfs 4096 1969-12-31 19:04 /persist/rfs/mdm/sparrow
drwx------ 2 rfs rfs 4096 1970-02-14 23:41 /persist/rfs/mdm/tn
drwx--x--x 5 rfs rfs 4096 2020-07-15 02:21 /persist/rfs/msm
drwx------ 2 rfs rfs 4096 1969-12-31 19:04 /persist/rfs/msm/adsp
drwx--x--x 4 rfs rfs 4096 2020-08-06 17:42 /persist/rfs/msm/mpss
drwx------ 2 rfs rfs 4096 2020-07-15 02:21 /persist/rfs/msm/mpss/datablock
-rw------- 1 rfs rfs 2600 2017-02-05 13:54 /persist/rfs/msm/mpss/datablock/id_00
-rw------- 1 rfs rfs 16384 2019-04-04 18:30 /persist/rfs/msm/mpss/dhob.bin
-rw------- 1 rfs rfs 16384 2019-04-04 17:52 /persist/rfs/msm/mpss/dhob.bin.bak
drwxrwx--x 2 rfs rfs 4096 1970-02-14 23:41 /persist/rfs/msm/mpss/mot_rfs
-rw------- 1 rfs rfs 5 2020-08-06 17:42 /persist/rfs/msm/mpss/server_check.txt
-rw------- 1 rfs rfs 53587 2017-02-03 11:57 /persist/rfs/msm/mpss/shob.bin
drwx------ 2 rfs rfs 4096 1970-02-14 23:41 /persist/rfs/msm/slpi
drwx------ 2 rfs rfs 4096 2020-07-15 02:21 /persist/rfs/shared
-rw-rw---- 1 rfs rfs 15 1969-12-31 19:04 /persist/rfs/shared/server_info.txt
potter:/ #

So I think that the permissions are correct. I have verified that all of the contents of those files match my backup.

Any ideas what's going on? Are my erase commands failing?
[Moto G5 Plus Guides, News, & Discussion] SyberHexen:
has-slot:modemst1: not found

These errors are harmless

Using this guide in reference for Moto g7 I came across some things which may help someone in the future..

if you paste directories and recursively chown them it messes up persist even though the structure and permissions are correct.

I was able to restore Persist to working order by flashing a different but same devices' persist backup and individually pasting in the important files from my original persist as example:

persist/rfs/msm/mpss/

dhob.bin

shob.bin

ticf.bin

persist/rfs/msm/mpss/mot_rfs/

imei_sv

persist/rfs/msm/mpss/datablock/

id_00

persist/factory/

fti <-- This contains unique device serial #

At this point i ran chown on each file using the correct user/group rather than recursively the whole directory structure.

Here i mapped permissions of the good persist and wrote a .sh to execute to fix my persist but it would always result with no IMEI, MEID, Serial, etc even though the file permissions and groups looked ok.
# Persist Permissions
chown -R system:system /persist/alarm
chown -R oem_5001:oem_5001 /persist/batt_health
chown -R bluetooth:bluetooth /persist/bluetooth
chown -R root:system /persist/bms
chown -R oem_5004:bluetooth /persist/bt
chown -R oem_5004:oem_5004 /persist/camera
chown -R 9004:9004 /persist/captouch_basedata.bin
chown -R system:system /persist/chargeonly
chown -R u0_a13152:112 /persist/coresight
chown -R system:system /persist/data
chown -R system:graphics /persist/display
chown -R system:system /persist/drm
chown -R oem_5004:oem_5004 /persist/factory
chown -R oem_2903:oem_2904 /persist/hlos_rfs
chown -R root:system /persist/hvdcp_opti
chown -R system:system /persist/iar_db
chown -R root:root /persist/lost+found
chown -R radio:radio /persist/mdm
chown -R system:system /persist/misc
chown -R system:system /persist/mobicore
chown -R oem_5004:oem_5004 /persist/paks
chown -R oem_5004:oem_5004 /persist/public
chown -R oem_2903:oem_2903 /persist/rfs
chown -R system:system /persist/secnvm
chown -R drmrpc:oem_5004 /persist/security
chown -R system:system /persist/sensors
chown -R system:system /persist/time
chown -R media:media /persist/vpp
chown -R oem_5004:oem_5004 /persist/wifi
chown -R 9003:9003 /persist/wmdrm

# Persist2 Permissions
chown -R system:9021 /persist2/elabel
chown -R radio:9021 /persist2/lifetime
chown -R root:root /persist2/lost+found
chown -R 9021:9021 /persist2/prelock
chown -R radio:9021 /persist2/user
[Moto G5 Plus Guides, News, & Discussion] Wolfcity:
First of all:

Nice to hear that [MENTION=7346927]NZedPred[/MENTION] 's guide is still helping users even with different devices.

Just a warning:

Don't ever flash or use a persist file from another device then yours! This may brick your device seriously.

Only use persist from your own device.

And: This guide/infos were made for the Moto G5+ (potter). It can be (must not) dangerous when using it for other devices.
[Moto G5 Plus Guides, News, & Discussion] SyberHexen:
Yea normally I wouldn't tinker here in persist but I recently got a few moto g7 play/power off ebay..

both came carrier locked.

The Tmobile device took 15 seconds to unlock via app pre-installed on device.

The sprint one has no hope to unlock and I've been testing theory that carrier locking lives (at least partially) in persist partition.
[Moto G5 Plus Guides, News, & Discussion] MohdAhmed:
Help needed.

I was on Havoc is 3.7.

After 14 days I lost network in my jio sim(simslot 1) but airtel was fine. Then I removed the sim and reinserted it. It was back to normal but after 10 hours the network went again. I did this for 2 days. Then I thought let's solve this issues so I installed the stock rom Oreo, and then when I got network in both sim, I changed jio to sim slot 2 ,it woked fine in stock rom, I was able to make and receive calls in both sim, then I flashed arrow os and when it booted up I wasn't getting volte on jio (sim slot 2) so I changed to slot 1, and still same. Then I thought I should go back to stock and insert the jio in sim 1 and come back. So I went to twrp and I forgot to wipe and just installed the stock rom, after installation I remembered I had to wipe, so I wiped and by mistake I installed arrow os (I know I was tensed and stupid) then I wiped again and installed stock rom and magisk (the phone was on charging) . The stock rom booted and I am not getting any network in any sim in any slot, restarting and changing slots didn't help, I wiped and flashed stock again, but still no network.

I have my efs and persist and original stock rom backup.

Please help me, how can I get my network again.

And worst part is it's my dad's phone.

Help would be very appreciated.
[Moto G5 Plus Guides, News, & Discussion] huttui:
C:\Program Files (x86)\Minimal ADB and Fastboot>adb shell

_n:/ $ su

_n:/ # chown -R rfs:rfs /persist/rfs

n -R rfs:rfs_shared /persist/hlos_rfs

ls -l /persistchown: bad user 'rfs'

1|_n:/ # chown -R rfs:rfs_shared /persist/hlos_rfs

chown: bad user 'rfs'

1|_n:/ # ls -l /persist

total 216

drwxrwx--- 2 system system 4096 1970-01-01 05:32 alarm

drwxr-xr-x 2 mot_pwric mot_pwric 4096 2018-10-11 09:03 batt_health

drwxrwx--- 2 bluetooth bluetooth 4096 2017-03-10 02:19 bluetooth

drwx------ 2 root system 4096 1970-01-01 05:32 bms

drwxr-xr-x 2 mot_tcmd bluetooth 4096 1970-01-01 05:32 bt

drwxr-xr-x 5 mot_tcmd mot_tcmd 4096 1971-06-03 14:00 camera

drwxrwx--- 2 system system 4096 1971-06-03 14:00 chargeonly

drwx------ 6 system system 4096 2017-05-10 10:30 data

drwxrwx--- 2 system graphics 4096 1971-06-03 14:00 display

drwxrwx--- 2 system system 4096 1970-01-01 05:32 drm

drwxr-xr-x 5 mot_tcmd mot_tcmd 4096 2017-03-10 02:20 factory

drwxrwx--- 3 3012 3013 4096 1970-01-01 05:32 hlos_rfs

drwx------ 2 root root 4096 1970-01-01 05:30 lost+found

drwxrwx--- 2 radio radio 4096 2017-03-10 02:19 mdm

drwxrwx--- 2 system system 4096 1970-01-01 05:32 misc

drwxrws--- 2 mot_tcmd mot_tcmd 4096 1971-06-03 14:00 paks

drwxrwx--- 2 system system 4096 1970-03-24 00:47 properties

drwxr-xr-x 11 mot_tcmd mot_tcmd 4096 1971-06-03 14:00 public

drwx--x--x 6 3012 3012 4096 1970-01-01 05:32 rfs

drwx------ 2 root root 4096 1971-06-03 14:00 sds

drwxrwx--- 2 system system 4096 1971-06-03 14:00 secnvm

drwxrws--- 2 drmrpc drmrpc 4096 2017-05-10 10:30 security

drwxrwxr-x 3 root root 4096 1971-06-03 14:00 sensors

drwxrwx--- 2 system system 4096 2018-10-11 09:09 time

drwxrwx--- 2 media media 4096 1971-06-03 14:00 vpp

drwxr-xr-x 2 mot_tcmd mot_tcmd 4096 1970-01-01 05:32 wifi

drwxrwxr-x 2 mot_drm mot_drm 4096 1970-01-01 05:32 wmdrm

_

can some1 guide me?
[Moto G5 Plus Guides, News, & Discussion] Rubister:
I've just restored working sim card functionality to a bootloader unlocked, rooted device that had lost IMEI and all other baseband information, and I was missing the .bak file. I flashed an older firmware for my device (by mistake) first, and upon booting up, saw an OTA update. I realized I'd goofed, so I went and got the latest firmware for the Moto E5, fastboot flashed it using the service xml file commands, (leave out recovery if you have a custom recovery, etc, if you're rooted you probably already know this) and when it booted back up I had all my baseband info restored and got my sim card working again. All is not lost if you do not have the .bak file. If you're reading this now and you have a device you'd given up hope on, give this a shot.
[Moto G5 Plus Guides, News, & Discussion] Rutambh:
I have my persist but Volte is not working for me! Please Help
[Moto G5 Plus Guides, News, & Discussion] ashitpatel:
im done with the phone, no backup , writed someone elses ef's or persists, no imei no network, any suggestion welcome.
[Moto G5 Plus Guides, News, & Discussion] Wolfcity:
Most probably you're done with your phone.

Device?

Firmware?

Unlocked?

Rooted?

If unlocked and on stock you could try a custom ROM. But first you have to provide more information.
[Moto G5 Plus Guides, News, & Discussion] ashitpatel:
First imei loss happened after going from pixel experience 10 to stock android 8, then tried every solution possible and messed up things.

Device Moto G5 Plus (XT1686)

Firmware Tried Stock Latest, Stock Nougat, Pixel Experience Latest Android 10, 9

Current Firmware NPN25.137-67-5 with TWRP and Magisk Root

Unlocked Yes

Rooted Yes

I tried changing imei through xposed modules , that changes imei but no network.
[Moto G5 Plus Guides, News, & Discussion] Wolfcity:
As you don't have a backup of your own stock persist file that could save you and tried the possible solutios from this thread (flash custom rom, backup efs files, go back to latest stock and restore efs there for example) you most probably have a paperweight in case of network now. Sorry, I don't think there's anything you can do.
[Moto G5 Plus Guides, News, & Discussion] Edijose45:
Phone bootloader unlocked - not yet rooted.

I have my IMEI.

But lost VOLTE.

Any simplest step restore VOLTE would be great!!
[Moto G5 Plus Guides, News, & Discussion] PratyushJayachandran:
Sorry for bumping up old thread.

Just wanted to ask how are you unpacking and repacking persist.img?

On unzipping persist from a phone with working VoLTE and one without working VoLTE but intact IMEI and radio, I found out that only the shob.bin is different in size. Rest all the files has same file size and permissions.

Since you observed that the IMEI is contained inside dhob.bin and dhob.bin.bak, I was wondering if replacing a working shob.bin will do anything.

If someone else knows how to pack and unpack persist.img, please do guide.
[Moto G5 Plus Guides, News, & Discussion] kishXXr:
I don't have any problem regarding this yet, but I just fixed my Moto G5 Plus' IMEI 0 and VOLTE not working through my first nandroid backup. Before this, I had given my phone to authorised service center, who screwed it's ability to charge while booted on, and because it was rooted, they weren't even responsible for it, so I took to repairing it. I flashed full stock ROM in fastboot, but the commands of erasing modemst and all may have been the issue for my IMEI to disappear. I tried to flash the persist fix zip but in vain. Finally after research I got to know a method, and flashed everything from oldest nandroid backup except data. Then tried to reboot, but it was in bootloop. Then again I installed twrp recovery through fastboot in bootloader and installed custom ROM + magisk, and voila! Everything back to normal! (Tested for 2 days)

So will any of my device's files make use for any research purpose here? (Just like a COVID recovered patient's blood is used to treat other patients 😁)

Plus, which application is used to edit/read the img files like persist, boot, system etc?
[Moto G5 Plus Guides, News, & Discussion] RadioActive Fox:
Hello everyone... Got my VoLte back.. After installing more than 10 roms and trying many technics finally got my network back with working Jio 4g.

I tried this method

Volte Fix For Moto G5 Plus

Download The Required Files From Here Fixed EFS + Fixed Persist Stock ROM (potter_NPNS25.137-92-4) or Both Files Here - http://cloud3.anshumanmishra.me/voltestuff/ 3. Backup your current EFS from TWRP (Check Step-2) (Important) The steps involved are -: Extract the Fixed EFS + Fixed Persist in...

telegra.ph

to fix my network of Moto G5 plus (XT1686) India.

Things you need:

Your trouble maker phone + Cable + Mac or PC

TWRP Recovery

Pixel Experience 10plus Rom

Naugat Stock Rom (India: https://docs.google.com/uc?id=0BwT0eILpNnLoeDFDanlvZzZ0dmM&export=download)

(Choose your rom Carefully, Based on your country)

Persist fixed & EPS fixed.zip https://androidfilehost.com/?fid=3700668719832237470

Downloaded PixelExperience Rom

Installed it through TWRP

Opened it normally

WHen you check IMEI (*#06#) you will notice your IMEI number displaying

Reboot to TWRP

Backup EPS. Copy that backup folder to Memory Card.

Wipe PHone memory (ALl except Memory Card)

Install stock ROM using Fastboot method or any other.

Before booting to this stock room, Restore Only EPS fixed (Not Persist Fixed)

After booting u will notice that there is no emi still!! Don't worry..

Restart phone, boot to TWRP..

Now Restore EPS fixed + PErsist Fixed and reboot to TWRP again..

Now Restore your Backed up EPS (Pixel Experiece).

Restart phone. YOu will get back your VoLte!!!!!!
[Moto G5 Plus Guides, News, & Discussion] liljkdawg:
You have no idea how long it took for me to find this. I was on Nougat, and flashed a custom Android 11 ROM, only to find out my fingerprint sensor didn't work. I figured out I need to flash stock oreo, but the TWRP flashable zips I kept finding never worked. This was exactly what I needed, once I flashed this, reflashed TWRP, formated the data to decrypt, then flashed the custom Android 11 ROM, everything worked out! Thank you so much for your simple instructions!
[Moto G5 Plus Guides, News, & Discussion] Wolfcity:
You're welcome. As users seem to need this tutorial from time to time I will make an own thread of it so that it's easier to find.;)
[Moto G5 Plus Guides, News, & Discussion] NZedPred:
Well every now and then I pop back to check this thread. Unfortunately I get a bit of a shock when someone posts something like this that gives the appearance of fixing something at the expense of ensuring it's otherwise broken permanently.

Have a look at the first post, last section entitled 5a) Why did flashing another device's persist fix Volte?

i hope you have a backup of your efs and persist... (refer to the second post).
[Moto G5 Plus Guides, News, & Discussion] bonchien:
I have a Moto G5 Plus on stock 7.0, rooted with TWRP recovery. No other modifications. What's the safest method to update to the latest stock firmware without losing my IMEI or EFS? I've backed up system, boot, EFS and persist with TWRP, but I would prefer the safest method for not losing anything and creating problems.

Can I do a dirty flash of the most recent Oreo using fastboot? Do I need to flash the latest Nougat first via fastboot so its a clean flash?

Is it safer to flash the TWRP stock Nougat then flash the TWRP stock Oreo files?

I keep reading, but I can't find a clear answer.
[Moto G5 Plus Guides, News, & Discussion] kishXXr:
*DISCLAIMER*: Don't find me responsible for phones converted into dummies.

READ FULLY BEFORE EXPERIMENTING!

First things first, you've done a great job by backing up your EFS and persist. Next, back up your apps and data using Migrate app just in case things go wrong. Next, find a suitable fastboot rom zip for you exact device and chipset, download and unzip it. You'll find instructions of flashing the zip probably with the download site. Next, if you go with flashing through CMD by typing yourself, make sure to NOT type the 'fastboot erase xxxxxx' which will surely erase confidential information. Next, try to reboot, even if it fails, reboot to bootloader, then flash TWRP recovery through fastboot and flash latest magisk. At this point you can reboot into system and I hope you get best results. If not, then revert back to present ROM.

If you use the flashfile batch file (.bat) in the fastboot ROM zip folder, it will automate the whole flashing process but will screw up your EFS and persist. Even if you do so, try to reboot and even if fail, reboot bootloader and flash TWRP, then magisk, reboot to system, again reboot to TWRP, place the EFS and persist backup which you made through TWRP in the TWRP folder of your storage. Go to backup in TWRP, select the backup folder, tick EFS, persist and everything will be fine.

If at any point the storage gets encrypted, to decrypt it you will have to format data in TWRP. :Sad: if you do this, you will lose all your apps, data and settings blah blah. So, in this case, Migrate backup may help. It has options to backup using root and TWRP or root and its own flasher. Do read it's instructions before anything.

Hope this helps!
[Moto G5 Plus Guides, News, & Discussion] Wolfcity:
Here you have a complete tutorial how to flash signed stock firmware and the needed links:

https://xdaforums.com/t/guide-moto-g5-plus-flashing-stock-firmware-rooting.4205293/
[Moto G5 Plus Guides, News, & Discussion] bonchien:
Thanks @Wolfcity and @kishXXr. So, I don't need to flash the final stock Nougat before flashing Oreo?

Also, flashing using fastboot is okay as long as I back up persist and EFS?
[Moto G5 Plus Guides, News, & Discussion] Wolfcity:
No, latest Nougat is not needed. This is only relevant for custom roms, some need Nougat as base, the most need Oreo.

In your case just follow the steps in the guide.

Be aware that TWRP and magisk will disappear, you're completely stock after the flash.

Bur it's no problem to install TWRP and magisk again afterwards (a rooting tutorial is also in that guide).

And backup everything you can, persist, efs and all other partitions available by TWRP like system,data and all the rest.

You can never have enough backups!
[Moto G5 Plus Guides, News, & Discussion] bonchien:
Thanks again, @Wolfcity and @kishXXr. Flashing went fine, and my IMEI was present upon reboot. I popped in an international SIM card, but it didn't connect to the network. Not sure if I didn't wait long enough, but I booted into TWRP and restored my EFS and persist backup, then rebooted. Waited a little bit, and the phone got a network signal and received a text. Seems to be working fine.
[Moto G5 Plus Guides, News, & Discussion] kishXXr:
@Wolfcity sir thank you for your time!

Happy for you man! Thank God you made a backup of the right things earlier. Please link the guide which you exactly used, so that other users with the same case as you get benefited.

Thanks!
[Moto G5 Plus Guides, News, & Discussion] bonchien:
I followed your guide here:

https://xdaforums.com/t/guide-moto-g5-plus-flashing-stock-firmware-rooting-12-2020.4205293/
[Moto G5 Plus Guides, News, & Discussion] Nykenztron:
Hi can you please enumerate the steps in simple format so that i can follow it, im facing same issue with my moto g5s plus XT 1084, i was trying to install custom rom, and installed twrp and took backup but somehow the persist was not backed up, efs was backed up though, so now i have imei but not network, my baseband has also been changed to A from R, please help me out, Im waiting for a solution desperately