Deleting file after system start not working with tasker. - Huawei Mate 9 Questions & Answers

Hi all,
because there is actually no persistend root on the Huawei Mate 9 (system modifivations are discarded after reboot) i would like to run system modifications directly after booting the device.
To do that i am going to use tasker.
For example i want to delete the "camera_click.ogg" file to avoid sounds when making photos with WhatsApp.
Using root explorer i only have to tap on mount system r/w and delete the file.
So i tried the following code in the android shell (which can be run within tasker):
Code:
su
mount -o rw,remount /system
rm -f /system/media/audio/ui/camera_click.ogg
But the system is still not writeable! And mountimg via root explorer only works again after a reboot...
Once with a similar code i got an error message like "resource busy".
What can cause this Problem and how can i delete this system file?
(note: i am not so familiar with Linux, only Raspberry Pi knowledge )
Thank you for helping in advance!

It is same dm-verity problem.
You have to modify boot to turn dm-verity off.

5[Strogino] said:
It is same dm-verity problem.
You have to modify boot to turn dm-verity off.
Click to expand...
Click to collapse
Thank you for your answer!
I will try this tutorial:
https://forum.xda-developers.com/mate-9/development/root-root-mate-9-t3556590
Hope it works...

Related

Read-Only Filesystem?

Hello, all!
I'm trying edit a file in /etc/ and adb says 'Failed to copy: Read-only filesystem'
Now, is this actually true? Or is this simply a permissions issue? I'm doing this on a non-rooted phone, so I can't 'touch' anything without permission errors, but is it a futile task if the filesystem is read only anyway?
I'm trying to do this from a non-rooted environment as I had intended on making this into an application, but I imagine that if I can't touch or push these files from an adb shell then I won't be able to from the application space either.
It's frustrating not to be able to edit the filesystem of my own phone, I'll be rooting if this is just a permissions problem and not an issue of a non-writable filesystem. Perhaps I could still make an application for rooted-only phones.. hrm..
Any thoughts on this?
/etc is an alias for /system/etc, and /system is a partition mounted as ro (you can confirm this yourself by running mount)
Ah, bugger. So this is hopeless (without modifying and then reflashing)?
Thanks very much.
you need to mount it read write,
mount -oremount,rw /dev/block/mtdblock3 /system
then it will be read/write
try adb remount. if it failes you need root sorry.
Hello, i have the same error and I have root. i have tried adb remount and the mount -oremount,rw /dev/block/mtdblock3 /system
still dotn work. I want to move a script to /
so i only have to type sh debian.sh
nvm I figured it out. i just put it on system and then just type sh debian.sh on the terminal and it works
Rafase282 said:
Hello, i have the same error and I have root. i have tried adb remount and the mount -oremount,rw /dev/block/mtdblock3 /system
still dotn work. I want to move a script to /
so i only have to type sh debian.sh
Click to expand...
Click to collapse
what is the error message? saying it dont work doesnt provide enough info for us to help....
it says sh: cant open aw.sh
so i still have to put the path or cd to where the file is. Is there a way to make /system my home?
no you cant make system your home, system is system, home is home. you can make a symlink if you are familiar with linux - might want to read up about shell commands
korndub said:
you need to mount it read write,
mount -oremount,rw /dev/block/mtdblock3 /system
then it will be read/write
Click to expand...
Click to collapse
Thanks it really worked!! for me i had the same problem as the other guy.
Rafase282 said:
Hello, i have the same error and I have root. i have tried adb remount and the mount -oremount,rw /dev/block/mtdblock3 /system
still dotn work. I want to move a script to /
so i only have to type sh debian.sh
nvm I figured it out. i just put it on system and then just type sh debian.sh on the terminal and it works
Click to expand...
Click to collapse
You *CAN'T* modify the / filesystem. It is part of your BOOT partition, which CANNOT be remounted rw. You would have to read, modify, and write the boot partition.
Rafase282 said:
Hello, i have the same error and I have root. i have tried adb remount and the mount -oremount,rw /dev/block/mtdblock3 /system
still dotn work. I want to move a script to /
so i only have to type sh debian.sh
nvm I figured it out. i just put it on system and then just type sh debian.sh on the terminal and it works
Click to expand...
Click to collapse
Maybe you're typing it in too literally. It should actually read like this:
mount -o remount,rw /dev/block/mtdblock3 /system
There was a typo with -oremount, there should be a space after -o.
Hope that helps.
PS. That command worked for me on a device where everything else failed.
dhkr123 said:
You *CAN'T* modify the / filesystem. It is part of your BOOT partition, which CANNOT be remounted rw. You would have to read, modify, and write the boot partition.
Click to expand...
Click to collapse
actually, / can be mounted rw, but changes are lost on reboot
new user
Firerat said:
actually, / can be mounted rw, but changes are lost on reboot
Click to expand...
Click to collapse
Hi I have my Asus Prime rooted and installed a virtuous Rom and I tried to put a fonts on the System/ fonts folder using root explorer using a instructions to fix some error on some games that need that tis fonts exist on the tablet but it said it cant because file system is read only I'm new and I don't know how to do this commands any help on how to do in a easy (explained) form.
egalpr said:
Hi I have my Asus Prime rooted and installed a virtuous Rom and I tried to put a fonts on the System/ fonts folder using root explorer using a instructions to fix some error on some games that need that tis fonts exist on the tablet but it said it cant because file system is read only I'm new and I don't know how to do this commands any help on how to do in a easy (explained) form.
Click to expand...
Click to collapse
I would recommended not posting in the g1 section. The Asus forums would be a lot more helpful.
egalpr said:
Hi I have my Asus Prime rooted and installed a virtuous Rom and I tried to put a fonts on the System/ fonts folder using root explorer using a instructions to fix some error on some games that need that tis fonts exist on the tablet but it said it cant because file system is read only I'm new and I don't know how to do this commands any help on how to do in a easy (explained) form.
Click to expand...
Click to collapse
Download EStrong File Manager and within the settings of it, enable mounting of the system as read/write.
Or, download Terminal Emulator and type this in:
Code:
mount -o remount,rw /dev/block/mtdblock3 /system
Or, try typing this in terminal/cmd:
Code:
adb remount
Or, if you plan on doing it all from recovery you could do:
Code:
adb shell "mount system"
and then you could do it all from there.
Next time, please post in the proper forum.
Read-Only /system... i just deleted the file, tich push should update/replace and then it worked... only had this bug when i was trying to modify Trebuchet.apk (homescreen)
Hi guys
Not being a linux expert, i'm stuck with the following problem..
i'm using a program who uses low level adb commands to write on the phone extSdCard...
problem: this extSdcard is seen as a readonly filesystem.
What has to be done to make this FS RW instaed of RO ?
This does not happen under windows where I can write to the extSd without problems
thks in advance for the tip

[HOW-TO] Backup your files before rooting

To fully root your EVO, you must apply a couple of updates over the top of your current installation. They will completely erase your user data.
To backup your files before rooting:
- Plug in your phone to your computer
- Make sure you have adb installed.
- Download the unrEVOked userland root.
- Open a terminal and cd into your downloads folder (e.g. cd ~/Downloads)
- Type the following:
Code:
adb install unrevoked.apk
adb shell
su
-- Look at your phone screen. Superuser Permissions is asking you if terminal has
permission to become root. Click allow. --
mkdir /sdcard/backup/
busybox cp -R /data /sdcard/backup/data
This will place a full copy of your userdata partition on your sdcard. To restore files back to your userdata partition after the root, simply use busybox cp to move them back. If your new ROM didn't include busybox, download and install it:
Code:
adb push busybox /system/bin/busybox
adb shell
chmod 755 /system/bin/busybox
I haven't tried copying all my userdata from the sdcard back to the data partition. I've simply used this method to backup and restore files I really didn't want to lose (like my bike calculator logs). I don't know if you could circumvent the wipe by copying your whole data backup back to the data partition after rooting. If you'd like to try and find out, please leave your results in the comments.
I've noticed that the files I've restored from my sdcard back to /data/data have root permissions. In Android, each app gets its own user account that has permissions to its data. If you don't fix the permissions, your apps won't be able to save their data. I don't know how to lookup which app gets which user account, but once you figure it out, you can do this:
Code:
cd /data/data/com.myapp
chown app_83.app_83 ./*
where myapp and app_83 are replaced with the values you are changing. joeykrim has posted a link which may help you do this automatically (fix_permissions.sh) in his thread.
theillustratedlife said:
I've noticed that the files I've restored from my sdcard back to /data/data have root permissions. In Android, each app gets its own user account that has permissions to its data. If you don't fix the permissions, your apps won't be able to save their data.
Click to expand...
Click to collapse
i never got that far, w/o restoring the correct permissions the apps won't load and puts android into a continuous boot loop and it will keep trying to load the apps but the permissions wont match.
theillustratedlife said:
I don't know how to lookup which app gets which user account
Click to expand...
Click to collapse
i think the permissions are kept in /data/system/packages.xml ...
theillustratedlife said:
joeykrim has posted a link which may help you do this automatically (fix_permissions.sh) in his thread, but the link currently appears to be down.
Click to expand...
Click to collapse
switched hosting providers, this link got lost in the shuffle. its http://www.joeyconway.me/evo/apps/fix_permissions.sh . updated my post. thanks!
Interesting. I've only used this trick to restore data selectively. I haven't tried moving the whole backup back into my /data partition.
Thanks for the heads up.

[Q] [HELP] /system read-only can't fix on adb no su response

i ported a LeWa OS ROM for my device and everything seemed to work perfectly, booted up without hassle, apps working, and everything was fine. not until i came to the point where i have to check the root capability. it seems like the /system partition was locked as read-only. i pre-rooted the rom with supersu and su binaries properly placed just like i do with other roms i ported. but this one is different. even on adb, the su isn't responding. although the request is showing on the phone and i click on grant, still there is no su response or whatsoever, that is why i cant remount it as rw.
so i was wondering if there is something i have to port from stock boot.img to port boot.img to permanently mount /system partition in RW capability.
i hope anyone can help me
How about making an insecure kernel so you can access root without requesting su?
xlSKYFiRElx said:
i ported a LeWa OS ROM for my device and everything seemed to work perfectly, booted up without hassle, apps working, and everything was fine. not until i came to the point where i have to check the root capability. it seems like the /system partition was locked as read-only. i pre-rooted the rom with supersu and su binaries properly placed just like i do with other roms i ported. but this one is different. even on adb, the su isn't responding. although the request is showing on the phone and i click on grant, still there is no su response or whatsoever, that is why i cant remount it as rw.
so i was wondering if there is something i have to port from stock boot.img to port boot.img to permanently mount /system partition in RW capability.
i hope anyone can help me
Click to expand...
Click to collapse
Download SuperSU and reinstall its binaries again.
Or you can try adbd Insecure app (not free)
janekmuric said:
Download SuperSU and reinstall its binaries again.
Or you can try adbd Insecure app (not free)
Click to expand...
Click to collapse
supersu or any of its binaries cannot help me. as every app that request root privileges hangs when grant permission is given. ill try adbd insecure app. gonna throw my money to this one
xlSKYFiRElx said:
supersu or any of its binaries cannot help me. as every app that request root privileges hangs when grant permission is given. ill try adbd insecure app. gonna throw my money to this one
Click to expand...
Click to collapse
I think the adb insecure app still requires su, you can upload the boot.img and i'll make it insecure (automatically root via adb, no su required)
Oooohh
xlSKYFiRElx said:
supersu or any of its binaries cannot help me. as every app that request root privileges hangs when grant permission is given. ill try adbd insecure app. gonna throw my money to this one
Click to expand...
Click to collapse
I didn't understand you correctly. Anyways from what I understand noe you can't give root to any app at all. Try using framaroot to re-root maybe it works. You have to find out the reason it hangs. I'm placing my bet on the corrupt or bad binary.
janekmuric said:
I didn't understand you correctly. Anyways from what I understand noe you can't give root to any app at all. Try using framaroot to re-root maybe it works. You have to find out the reason it hangs. I'm placing my bet on the corrupt or bad binary.
Click to expand...
Click to collapse
He's right, redownload the binaries again, if it still hangs, it might be the ROM.
Add this to build.prop if you want root via adb:
ro.secure=0
janekmuric said:
I didn't understand you correctly. Anyways from what I understand noe you can't give root to any app at all. Try using framaroot to re-root maybe it works. You have to find out the reason it hangs. I'm placing my bet on the corrupt or bad binary.
Click to expand...
Click to collapse
3DMapPlayer said:
He's right, redownload the binaries again, if it still hangs, it might be the ROM.
Add this to build.prop if you want root via adb:
ro.secure=0
Click to expand...
Click to collapse
sorry for the confusion but here is the case, i ported this (LEWA) ROM and i pre rooted with, placed the updated su binary to /system/xbin and the latest supersu.apk to /system/app. the phone boots properly and according to the rom. i installed root checker but when it checked for root it says the root is not installed properly but the supersu dialog box is appearing and i can press the grant button and a toast appears saying that it is granted superuser permissions. i tried to re-root using framaroots barahir exploit but it said "Half-Success" because the system partition is mounted read-only.
i tried using root explorer, when i try to mount system as r/w the supersu dialog appears and i can press the grant button again, also the toast appears saying that the app is granted superuser permission but then the application (root explorer) hangs, i tried other root explorer application still the same.
so what i want to achieve is to mount /system as read-write partition
i tried using ADB, but when i try to type su everything i type reappears
example: when i type 'su' the result is like this:
Code:
what i type: su
what show: su
what i type: busybox mount
what show: busybox mount
or simply, everything i type reappears and the command is not executed.
i tried to modify boot.img by editing build.prop and setting this values
#
# ADDITIONAL_DEFAULT_PROPERTIES
#
ro.secure=0
ro.allow.mock.location=1
persist.mtk.aee.aed=on
ro.debuggable=1
persist.sys.usb.config=mass_storage,mtp
persist.service.acm.enable=0
ro.mount.fs=EXT4
Click to expand...
Click to collapse
and also editing init.rc and setting this values
Code:
mount yaffs2 [email protected] /system rw remount
mount ubifs [email protected] /system rw remount
but still no luck. i hope you guys understand, sorry for my crappy english. not my language
i'll try to reflash the rom so that i can supply screenshots
also, here is a copy of my boot.img
Got it!
xlSKYFiRElx said:
sorry for the confusion but here is the case, i ported this (LEWA) ROM and i pre rooted with, placed the updated su binary to /system/xbin and the latest supersu.apk to /system/app. the phone boots properly and according to the rom. i installed root checker but when it checked for root it says the root is not installed properly but the supersu dialog box is appearing and i can press the grant button and a toast appears saying that it is granted superuser permissions. i tried to re-root using framaroots barahir exploit but it said "Half-Success" because the system partition is mounted read-only.
i tried using root explorer, when i try to mount system as r/w the supersu dialog appears and i can press the grant button again, also the toast appears saying that the app is granted superuser permission but then the application (root explorer) hangs, i tried other root explorer application still the same.
so what i want to achieve is to mount /system as read-write partition
i tried using ADB, but when i try to type su everything i type reappears
example: when i type 'su' the result is like this:
Code:
what i type: su
what show: su
what i type: busybox mount
what show: busybox mount
or simply, everything i type reappears and the command is not executed.
i tried to modify boot.img by editing build.prop and setting this values
and also editing init.rc and setting this values
Code:
mount yaffs2 [email protected] /system rw remount
mount ubifs [email protected] /system rw remount
but still no luck. i hope you guys understand, sorry for my crappy english. not my language
i'll try to reflash the rom so that i can supply screenshots
also, here is a copy of my boot.img
Click to expand...
Click to collapse
Flash the attached ZIP. It will reinstall SuperSU and all needed files.

Galaxy S7 Android 7.0 Rooted Can't Make App System App

Hi all, just updates my Galaxy S7 to the latest firmware (April 2017 security patch). I have rooted the phone with SuperSU and installed BusyBox.
For some reason, no matter what I try, I can't seem to make an app a system app.
/system/app mover gives me a "Could not remount /system" error.
I have used ES File Exlporer to move the app manually but when opening the app I don't have the options which are usually enabled when it's a proper system app.
I have also tried to change directory permissions and tried to run the following command:
mount -o rw,remount,rw /system
Which gives me a "device or resource busy" error.
Please help this is doing my head in.
Did you set the correct permissions on the app once moved?
*Detection* said:
Did you set the correct permissions on the app once moved?
Click to expand...
Click to collapse
Yes, changed permissions so all could read and write.
mick1988 said:
Yes, changed permissions so all could read and write.
Click to expand...
Click to collapse
Set permission 744 (-rwxr–r–) on it and see how it goes
mick1988 said:
Hi all, just updates my Galaxy S7 to the latest firmware (April 2017 security patch). I have rooted the phone with SuperSU and installed BusyBox.
For some reason, no matter what I try, I can't seem to make an app a system app.
/system/app mover gives me a "Could not remount /system" error.
I have used ES File Exlporer to move the app manually but when opening the app I don't have the options which are usually enabled when it's a proper system app.
I have also tried to change directory permissions and tried to run the following command:
mount -o rw,remount,rw /system
Which gives me a "device or resource busy" error.
Please help this is doing my head in.
Click to expand...
Click to collapse
try this and tell me if worked . mount -o rw,remount,rw /
after try this ls > f.txt if give you read only you must set permisive mode by comand setenforce 0

[HELP] Internal Storage not accessible a.k.a How to clear com.android.providers.media.MediaApplication data

Hi,
Since a few days I'm unable to see any data in my phone via gallery or file manager or any application, and I'm unable to save any data to internal storage. (example: I'm able to use whatsapp for texting, but I can't receive/send any audio/picture and I can't access the old ones).
And I keep getting this error message:"com.android.providers.media.MediaApplication keeps stopping."
I don't know if that's what causing it or if that's just a consequence of not being able to access internal storage.
I can still see all the used storage from settings though.
Phone has unlocked bootloader, but no root/custom rom/recovery.
I saw other Oneplus users started getting the same error these days... (I have a Oneplus 6, but others have different models like Oneplus Nord).
Someone resolved by wiping system and they were able to retrieve storage content and functionality, but they lost apps data, I'm trying to find another way since I have an unlocked bootloader.
An user on stackoverflow suggested I should clean the com.android.providers.media.MediaApplication app data to regenerate the database, but I couldn't figure out how to do it
I tried cleaning media and media.module packages (not media.MediaApplication) from adb but no luck even if successful.
I tried removing "com.android.providers.media" (not media.MediaApplication, I couldn't find that one) folder from data/data with twrp file manager but no luck...
Is there a way to specifically clean "com.android.providers.media.MediaApplication"?
If anyone has any other suggestion on things to try, post it here please.
Thank you in advance
you wrote you already did successfully - obviously that is not the cause. my suspect is broken encryption (you will figure out from recovery.log)
encrypted files look like this +NiZZaTrs3RFzYegpkEk if encryption is not the reason, it could be symlinks messed up. in android enable usb-debugging and check from adb shell.
(repeat this for each result)
Code:
readlink /sdcard
readlink ...
in TWRP recovery check for files like /data/system/uiderrors.txt
/data/log
(don't know exact names) you can adb pull files to PC and inspect with wordpad or Notepad++
last but no least you can capture logcat during boot for further analysis
Code:
adb logcat > logcat.txt
if you're going to factory reset device, install Magisk from TWRP and backup apps to usb flash drive with Migrate-NG beforehand. copy all your pictures + backups to PC
Code:
adb pull -a /sdcard
if you can't install Migrate or can't get usb-otg to work, get a backup to PC at least, I can tell you how to restore single apps from it later (ignore the confirmation request "WARNING adb backup is deprecated... Now Unlock your device and confirm...")
Code:
adb backup --twrp --compress data
alecxs said:
encrypted files look like this +NiZZaTrs3RFzYegpkEk if encryption is not the reason, it could be symlinks messed up. in android enable usb-debugging and check from adb shell.
(repeat this for each result)
Code:
readlink /sdcard
readlink ...
in TWRP recovery check for files like /data/system/uiderrors.txt
/data/log
(don't know exact names) you can adb pull files to PC and inspect with wordpad or Notepad++
last but no least you can capture logcat during boot for further analysis
Code:
adb logcat > logcat.txt
if you're going to factory reset device, install Magisk from TWRP and backup apps to usb flash drive with Migrate-NG beforehand. copy all your pictures + backups to PC
Code:
adb pull -a /sdcard
if you can't install Migrate or can't get usb-otg to work, get a backup to PC at least, I can tell you how to restore single apps from it later (ignore the confirmation request "WARNING adb backup is deprecated... Now Unlock your device and confirm...")
Code:
adb backup --twrp --compress data
Click to expand...
Click to collapse
Hi @alecxs , I really hope you are still active on this forum...
Probably you won't remember this discussion from back in the days (This was the previous part of our exchange if you would like to refresh your memory).
In the end I ended up using my phone in that state for more than one year with the plan of changing phone soon and not have to deal with the wipe and restoration on the same device (if that's not procrastination.... ).
Well, last week I dropped the phone and the screen died. I bought a pixel 7 as a replacement but now I would like to try to save the data of just a few apps. Most important one being Whatsapp, I don't really care about the rest...
So basically:
-the screen is dead but touch is still working and I was able to get scrcpy to work so I can still use it as a "normal' phone from my computer, so that shouldn't be an impediment.
-as previously stated the phone is not able to access internal storage, but I'm able to access it in recovery mode through adb so pulling files should not be an issue.
-I'm able to install and update apks through adb install.
-whatsapp was not able to execute backups during this year since it could not access internal storage, so I have only old ones.
-bootloader is unlocked, I have twrp but no root.
I still need to try your suggestion above, but wanted to ask this before cause maybe you have a different suggestion to extract a single app. Also, I don't really know how migrate works but if it saves the backup on the internal storage I think that's not gonna work cause every app that needs to save something (that isn't data) doesn't work.
Isn't there a way to just copy the data folder of the app on the new phone to transfer data (like what happens for mac apps)?
Thank you in advance
0xCuter said:
-as previously stated the phone is not able to access internal storage, but I'm able to access it in recovery mode through adb so pulling files should not be an issue.
Click to expand...
Click to collapse
yes, if that is true all fine, you can run the Migrate_EMERGENCY_FLASHABLE.zip from recovery and restore app data on other device with Migrate
alecxs said:
yes, if that is true all fine, you can run the Migrate_EMERGENCY_FLASHABLE.zip from recovery and restore app data on other device with Migrate
Click to expand...
Click to collapse
Hey, it's me again... So, I rooted my new phone and I found the emergency_flashable.zip in the migrate thread, now I just need to flash it, but I cannot use scrcpy in recovery mode to see the screen. I guess there is a way to flash the zip from adb without the need to use the screen, but better to ask since I don't want to do stupid stuff...
yes, you can do it from adb. best is MicroSD Card as target directory. copy the zip into the target directory, mount data system vendor product, then install zip. on the first trial it will fail because packages.list needed. but it will create one you can edit. delete unwanted packages before second trial. you can repeat as often you want, existing backups won't created twice.
Code:
adb push Migrate_EMERGENCY_FLASHABLE.zip /sdcard
adb shell
# mount /system_root
# mount /system
# mount /vendor
# mount /product
# mount /external_sd
# mkdir /external_sd/Migrate
# cd /external_sd/Migrate
# mv /sdcard/Migrate_EMERGENCY_FLASHABLE.zip .
# twrp install ./Migrate_EMERGENCY_FLASHABLE.zip
# exit
adb pull /external_sd/Migrate/packages.list
edit the file with editor and push it back
https://twrp.me/faq/openrecoveryscript.html
alecxs said:
yes, you can do it from adb. best is MicroSD Card as target directory. copy the zip into the target directory, mount data system vendor product, then install zip. on the first trial it will fail because packages.list needed. but it will create one you can edit. delete unwanted packages before second trial. you can repeat as often you want, existing backups won't created twice.
Code:
adb push Migrate_EMERGENCY_FLASHABLE.zip /sdcard
adb shell
# mount /system_root
# mount /system
# mount /vendor
# mount /product
# mount /external_sd
# mkdir /external_sd/Migrate
# cd /external_sd/Migrate
# mv /sdcard/Migrate_EMERGENCY_FLASHABLE.zip .
# twrp install ./Migrate_EMERGENCY_FLASHABLE.zip
# exit
adb pull /external_sd/Migrate/packages.list
edit the file with editor and push it back
https://twrp.me/faq/openrecoveryscript.html
Click to expand...
Click to collapse
One thing I forgot to ask: do I need to root my old phone as well or is twrp sufficient?
And to root I would just need to flash Magisk the same way I would flash the emergency flashable.zip right? Or can I just "twrp install [magisk_package]" without going into the shell?
No need to root old phone, TWRP already provides root access for backup purposes. the new phone should be rooted by flashing magisk patched boot.img because the TWRP install method is deprecated. I know I gave only short hints, so don't hesitate to ask for more detailed instructions in case you don't know what to do for some specific step...
alecxs said:
No need to root old phone, TWRP already provides root access for backup purposes. the new phone should be rooted by flashing magisk patched boot.img because the TWRP install method is deprecated. I know I gave only short hints, so don't hesitate to ask for more detailed instructions in case you don't know what to do for some specific step...
Click to expand...
Click to collapse
Thank You... Yes, the new phone is rooted.
One thing that's not needed for the process but I wanted to understand is: Is there a specific reason why we "twrp install" from shell or could in theory be possible to flash the zip file directly from pc storage?
0xCuter said:
or could in theory be possible to flash the zip file directly from pc storage?
Click to expand...
Click to collapse
the reason is, the backup is created locally in the same directory where the zip file is. never tried sideload but I guess it would try to store in /tmp which is RAM.
alecxs said:
yes, you can do it from adb. best is MicroSD Card as target directory. copy the zip into the target directory, mount data system vendor product, then install zip. on the first trial it will fail because packages.list needed. but it will create one you can edit. delete unwanted packages before second trial. you can repeat as often you want, existing backups won't created twice.
Code:
adb push Migrate_EMERGENCY_FLASHABLE.zip /sdcard
adb shell
# mount /system_root
# mount /system
# mount /vendor
# mount /product
# mount /external_sd
# mkdir /external_sd/Migrate
# cd /external_sd/Migrate
# mv /sdcard/Migrate_EMERGENCY_FLASHABLE.zip .
# twrp install ./Migrate_EMERGENCY_FLASHABLE.zip
# exit
adb pull /external_sd/Migrate/packages.list
edit the file with editor and push it back
https://twrp.me/faq/openrecoveryscript.html
Click to expand...
Click to collapse
I'm trying and when I do "mount /system" from the shell I get this:
mount: '/system' not in fstab
Click to expand...
Click to collapse
Is it normal?
it's either /system_root or /system so one of it will fail. I just listed both.
alecxs said:
it's either /system_root or /system so one of it will fail. I just listed both.
Click to expand...
Click to collapse
I suspected that... is it the same for product and external_sd?
Only system_root and vendor went through
/external_sd is the mount point for MicroSD Card, it may have a different name like /sdcard1 or something. if you have enough disk space on /data, no need for external SD.
/product is maybe not needed, just running with /system_root + /vendor is fine.
alecxs said:
/external_sd is the mount point for MicroSD Card, it may have a different name like /sdcard1 or something. if you have enough disk space on /data, no need for external SD.
/product is maybe not needed, just running with /system_root + /vendor is fine.
Click to expand...
Click to collapse
There is no external MicroSD on Oneplus 6... can I put the migrate folder in /sdcard?
Also, I think I should delete some stuff from storage to make space, since I already pulled it on the pc
/sdcard = /data/media can be used. you can split the packages.list file into few parts so it fits in remaining disk space.
alecxs said:
/sdcard = /data/media can be used. you can split the packages.list file into few parts so it fits in remaining disk space.
Click to expand...
Click to collapse
I tried the install and I get this, even though the zip file is in the same folder I'm in (it even autocompletes from terminal)
OnePlus6:/sdcard/Migrate # ls
Migrate_EMERGENCY_FLASHABLE.zip
OnePlus6:/sdcard/Migrate # twrp install Migrate_EMERGENCY_FLASHABLE.zip
Unable to locate zip file 'Migrate_EMERGENCY_FLASHABLE.zip'.
Installing zip file 'Migrate_EMERGENCY_FLASHABLE.zip'
Error installing zip file 'Migrate_EMERGENCY_FLASHABLE.zip'
Done processing script file
Click to expand...
Click to collapse
make sure you give a path to zip file on install, like ./ or full path. it will fail on first execution. check if packages.list was created successfully.
alecxs said:
on the first trial it will fail because packages.list needed. but it will create one you can edit.
Click to expand...
Click to collapse
you can always pull recovery.log afterwards to see what's going on.
Code:
adb pull /tmp/recovery.log
alecxs said:
make sure you give a path to zip file on install, like ./ or full path. it will fail on first execution. check if packages.list was created successfully.
you can always pull recovery.log afterwards to see what's going on.
Code:
adb pull /tmp/recovery.log
[/cod
[/QUOTE]
Click to expand...
Click to collapse
It launched with the full path. I didn't edit the package.list file and I launched it again.
I got a lot of "migrate.sh: failed:..." and just a few "migrate.sh: finish:..." mostly for system apps, but honestly I really only need to backup whatsapp...
...
Click to expand...
Click to collapse
migrate.sh: failed: com.intsig.lic.camscanner
migrate.sh: failed: com.android.theme.icon_pack.ci
migrate.sh: failed: com.google.android.apps.restor
migrate.sh: 397x packages failed / 0x already exist
# MIGRATE_STATUS: backup finished (27/424)
# DONE.
#
# exiting script
#
# # # # # # # # # # # # # # # # # # # # # # # # # #
Updater process ended with ERROR: 1
I:Install took 69 second(s).
Error installing zip file 'sdcard/Migrate/Migrate_EMERGENCY_FLASHABLE.zip'
Done processing script file
Click to expand...
Click to collapse
These are the things that have been backed up:
OnePlus6:/sdcard/Migrate # ls
Backup_android Backup_com.google.android.networkstack
Backup_com.android.bluetooth Backup_com.google.android.packageinstaller
Backup_com.android.cellbroadcastreceiver Backup_com.oneplus.screenshot
Backup_com.android.emergency Backup_com.qualcomm.qti.cne
Backup_com.android.inputdevices Backup_com.qualcomm.qti.poweroffalarm
Backup_com.android.location.fused Backup_com.qualcomm.qti.smq
Backup_com.android.phone Backup_com.qualcomm.qti.uceShimService
Backup_com.android.providers.blockednumber Backup_org.ifaa.aidl.manager
Backup_com.android.providers.settings Backup_se.dirac.acs
Backup_com.android.providers.telephony Backup_vendor.qti.hardware.cacert.server
Backup_com.android.proxyhandler Migrate_EMERGENCY_FLASHABLE.zip
Backup_com.android.server.telecom backup_app_and_data.sh
Backup_com.android.settings busybox
Backup_com.android.shell migrate.log
Backup_com.android.stk migrate.sh
Backup_com.android.systemui packages.list
Backup_com.google.android.ext.shared readme.txt
Click to expand...
Click to collapse

Categories

Resources