switchrom problem - G1 Q&A, Help & Troubleshooting

if follwed all the steps in :http://forum.xda-developers.com/showthread.php?t=541183. (i got to download switchrom.txt as switchrom.sh and i downloaded it to root of my sd card AND to a folder System>sd) when i do the command:
sh /system/sd/switchrom.sh -s <name>(i put drizzy-hero) and it says sh: can't open ' /system/sd/switchrom.sh' any help? im running drizzy's champion v2 cyan. recovery1.4

francoghini said:
if follwed all the steps in :http://forum.xda-developers.com/showthread.php?t=541183. (i got to download switchrom.txt as switchrom.sh and i downloaded it to root of my sd card AND to a folder System>sd) when i do the command:
sh /system/sd/switchrom.sh -s <name>(i put drizzy-hero) and it says sh: can't open ' /system/sd/switchrom.sh' any help? im running drizzy's champion v2 cyan. recovery1.4
Click to expand...
Click to collapse
So I assume that you are going into Recovery and then you enter "mount system/sd" and you then enter the "sh system/sd/switchrom.sh -s drizzy-hero" then hit enter?
You have to remember to mount the sd.
"mount system/sd" to access the system/sd directory
"mount sdcard" to access the sdcard
You can't access any files without doing that first.

ohhh thank you i will try again

doesnt work same error

francoghini said:
...(i got to download switchrom.txt as switchrom.sh and i downloaded it to root of my sd card AND to a folder System>sd) ...
Click to expand...
Click to collapse
how did you copy it to a folder system/sd? its important because i think you may have copied it to the wrong folder.
Code:
mount system/sd
mount sdcard
cp /sdcard/switchrom.txt /system/sd/switchrom.sh
this should be done in the console in recovery. if you do it in the terminal emulator you will need su first.

nvm its not working im running the commands correctly from the folder system/sd/ but it says storing nandroid backupumount can't umount /sdcard: Device or resource busy

anybody have any ideas? if you need me to ill post the .log

Step by Step
francoghini said:
anybody have any ideas? if you need me to ill post the .log
Click to expand...
Click to collapse
To Bookmark
Perform a nandroid backup from Recovery 1.4
Go to Console (ALT+X)
enter "mount system/sd"
enter "sh system/sd/switchrom.sh -s ROMNAME"
It should now read "Storing ROM ROMNAME, proceed? (y/n)"
enter "y"
It should then start saying "Storing app data..." followed by "Storing nandroid backup..."
During this time it is compressing the app, app-private, app_s (if applicable), and dalvik-cache in a tar file which is then stored in /sdcard/switchrom/ROMNAME/ directory.
After it is all completed it should read "Done bookmarking the ROM named ROMNAME."
Do NOT do a nandroid restore as it will revert to the latest nandroid backup. If you wish to do a restore use the switchrom script instead..
To Restore
Reboot into recovery
Go to Console (Alt+X)
enter "mount system/sd"
enter "sh system/sd/switchrom.sh -r"
It should now read a list of roms that you have backed up. Enter the number indicating the desired ROM to restore.
It should now read "Restoring ROM ROMNAME, proceed? (y/n)
enter "y"
It should then read "Cleaning up system/sd ..." This is deleting the app, app-private, app_s, dalvik-cache directories from your sdcard.
It then should read "Restoring ROMNAME app data in /system/sd ..."
Following next should be "Restoring nandroid backup..."
Things to keep in mind.
Always make sure you have enough battery remaining to do a backup/restore.
Always make sure you have enough space on your sdcard.
Always keep at least ONE nandroid backup in your nandroid folder should the switchrom script fail.
The script COPIES the files that are backed up in the nandroid directory to the switchrom script. If you don't have a large sdcard this may cause you to lose space fairly quickly.
To delete a stored rom enter "mount system/sd" then "sh system/sd/switchrom.sh -d" then the number of your ROM that you wish to delete.
Always keep an archived copy of your backups on your PC in case your sdcard fails at some point. A good habit would be backing up the Switchrom directory at least once a week.
Also make sure you have sufficiant battery life remaining. If you use an older switchrom script and you get a unable to umount /sdcard message this is normal.

i checked the switchrom directory and saw it had a the file in it then i checked the restore thing see if it was set up in the recovery console and it is=] i guess i was using an older version . i downloaded the attachment that was on the post though. wait no i checked the nandroid folder and its empty=[.
Going to try to clean up sdcard and try again
UPDATE: i cleaned it up same thing, in the middle of storing nandroid backup... it has the same error and tells me to check out the .log

francoghini said:
i checked the switchrom directory and saw it had a the file in it then i checked the restore thing see if it was set up in the recovery console and it is=] i guess i was using an older version . i downloaded the attachment that was on the post though. wait no i checked the nandroid folder and its empty=[.
Going to try to clean up sdcard and try again
UPDATE: i cleaned it up same thing, in the middle of storing nandroid backup... it has the same error and tells me to check out the .log
Click to expand...
Click to collapse
Post the Nandroid.log file in a text format.

how do i check the log? i did it before but i forgot ik it has to do with the adb

i even flashed amon ra's recovery and switchrom still gives me that error how do i check the log?

how do you use switch rom from RA recovery
I'm confused as to what commands to type for RA recovery image with switchrom built in .having same problem as the other guy.
The way you use it on RA recovery 1. 2. 3 is drop down to console by turning phone off. then holding home key and end call key to boot in recovery ,go to console and type "switchrom" now type
/sbin/switchrom ( command) then enter
Commands. -r restore
-s store
-d delete

Related

Need advice - Fastest Eclair Rom on top of Cyanogen

Hello,
I am currently running Cyanogen Mod 4.2.14.1 on my G1. My additional specs are listed below. I am looking for a fast but stable ROM that I can flash on top of Cyan's Rom without the need to wipe or change my Radio/SPL, etc. I just really don't want to go through losing all my data. Any advise would be greatly appreciated. Thanks!
SD Card: 6 Class Fat32/ext3/Linux-Swap
SPL: HBOOT-0.95.0000
Radio: 2.22.19.26i
Rom: CyanogenMod 4.2.14.1
Recovery: Cyanogen's Recovery 1.4
You can't flash a completely different ROM on top of another. It might cause some un wanted issues.
Suggestion:
Make a backup of your stuff.
Full Wipe
Flash a Different ROM.
Restore your stuff.
Bummer. Welp, Cyan it is then. Don't need a bunch of issues messin' around. Thanks for the reply!
I believe that xRom by JAC is based off the same kernal which means no wipe going to it... you could use switchrom to backup and restore without wiping to go back to cyanogen if you dont like it...
Let me ask this then. I always use Nandroid for my backups. Can I just do a nandroid backup, flash xrom, and if I don't like it...do a nandroid restore to get back to Cyanogen?
your app data might not be compatible coming back.. do you know how to use switchrom? its not that hard once you learn it... and it backs up the app data before doing a nandroid...
google xda switchrom.sh
download the switchrom.txt file
rename to switchrom.sh
move to root of sdcard
go to terminal emulator type: (hit enter after each line)
su
cp sdcard/switchrom.sh /system/sd
reboot recovery
enter recovery console: (hit enter after each line)
mount /system/sd
sh /system/sd/switchrom.sh -s (todays date)<this will be the backup name
*this stores your rom* notice -s
to restore the backup--enter recovery console
mount /system/sd
sh /system/sd/switchrom.sh -r
it will give you a choice... choose the most recent (or stable) rom
I do one of these backups every weekend JIC I mess something up (which I did last night... last back was 01/28/10 so not too bad..
Well, your instructions are impecable! Never used it but I'm gonna give it a whirl. Thanks so much for the detailed assistance
junkdruggler said:
your app data might not be compatible coming back.. do you know how to use switchrom? its not that hard once you learn it... and it backs up the app data before doing a nandroid...
google xda switchrom.sh
download the switchrom.txt file
rename to switchrom.sh
move to root of sdcard
go to terminal emulator type: (hit enter after each line)
su
cp sdcard/switchrom.sh /system/sd
reboot recovery
enter recovery console: (hit enter after each line)
mount /system/sd
sh /system/sd/switchrom.sh -s (todays date)<this will be the backup name
*this stores your rom* notice -s
to restore the backup--enter recovery console
mount /system/sd
sh /system/sd/switchrom.sh -r
it will give you a choice... choose the most recent (or stable) rom
I do one of these backups every weekend JIC I mess something up (which I did last night... last back was 01/28/10 so not too bad..
Click to expand...
Click to collapse
Wow Just USe AmonRA LAst recovery It Lets you Use Switchrom Eazy You Can Save your Rom =D i Can Give you a youtube video that will Help U =D Youtube video

[Q] Recovery Flashing Error

After I got my nexus back from HTC for a faulty power button, my nexus has been rooted via a replaced motherboard. Now I have already root my phone and unlocked the bootloader, however when I try to flash the recovery image I get
sending 'recovery' (4074 KB)... OKAY
writing 'recovery'... FAILED (remote: image update error)
Also I can somehow access recovery, and it looks as it should. However when I try to backup my rom it says "Run 'nandroid-moblie.sh' via adb!" and similar things when I try any other the other options. Could someone please help with this?
How are you trying to flash it? Fastboot is the best foolproof way to do flash the recovery. I have never really seen that error before, what recovery are you trying to flash?
Your nandroid error is most likely because the sdcard thinks it's still mounted, or is mounted. Also, I don't know if this still happens but make sure you only do a backup, not backup +ext if you don't have an ext partition on the sdcard.
he's obviously using fastboot...
Did you make sure recovery.img had the right MD5 hashes as amon_ra posted?
I have check the MD5 checksums, and they match up. Also, i am using fastboot to flash, and I am trying to flash RA-nexus v2.0.0. Are you suggesting that I remount the sd card to get it to flash the recovery image?
cajer said:
I have check the MD5 checksums, and they match up. Also, i am using fastboot to flash, and I am trying to flash RA-nexus v2.0.0. Are you suggesting that I remount the sd card to get it to flash the recovery image?
Click to expand...
Click to collapse
I would suggest you try in command line with the adb commands as follows:
adb shell
su
mount -o rw,remount /dev/block/mtdblock4 /system
cat /sdcard/flash_image > /system/bin/flash_image
chmod 775 /system/bin/flash_image
flash_image recovery /sdcard/recovery.img
rm /system/etc/install-recovery.sh
rm /system/recovery-from-boot.p
reboot recovery
You need flash_image for this, check the wiki for the file...don't forget to put the recovery in the root of the sdcard and rename it to recovery.img for convenience purpose
gravufo said:
I would suggest you try in command line with the adb commands as follows:
adb shell
su
mount -o rw,remount /dev/block/mtdblock4 /system
cat /sdcard/flash_image > /system/bin/flash_image
chmod 775 /system/bin/flash_image
flash_image recovery /sdcard/recovery.img
rm /system/etc/install-recovery.sh
rm /system/recovery-from-boot.p
reboot recovery
You need flash_image for this, check the wiki for the file...don't forget to put the recovery in the root of the sdcard and rename it to recovery.img for convenience purpose
Click to expand...
Click to collapse
What do I do with flash_image? Also this device came back stock with frg 83, which I am trying to flash the recovery on. When I type in adb shell, I get "error: device not found" even though I can see it through "fastboot devices".
cajer said:
What do I do with flash_image? Also this device came back stock with frg 83, which I am trying to flash the recovery on. When I type in adb shell, I get "error: device not found" even though I can see it through "fastboot devices".
Click to expand...
Click to collapse
flash image has to be placed in the root of your sd card as well as the recovery!
As for the adb shell, try enabling USB Debugging in Setting > Applications > Development
Make sure you're rooted too (use SuperOneClick if you're not already)
I can get through that string of commands until
rm /system/etc/install-recovery.sh
rm /system/recovery-from-boot.p
reboot recovery
Then it says "No such file or directory". I have already rooted, and both the flash_image and recovery file have been placed in the root directory of the sd card.
Well, after you did that string of commands, does the problem persist?
Also, do you have at least 400MB free on your SD card?
Well, I can't get
rm /system/etc/install-recovery.sh
rm /system/recovery-from-boot.p
reboot recovery
to work as it responds with "No such file or directory". Even if I go through after the errors, the recovery still gives 'nandroid-moblie.sh' via adb!" and similar messages. Do I need to find a way to put the file install-recovery.sh in my sd card root directory if so, where can I get it? In addition when I try to flash recovery with nexus one superboot I get "(remote: signature verify fail)" even though the MD5 sum matches up.
Yes I have over 5 gbs on the sd card.
rm = remove
The steps you are trying to perform with the 2 rm command is to remove the 2 files that automatically rewrite your recovery.
If you reboot without succeeding in removing these files, the recovery image you just flashed will be written over by the stock recovery...
Since you have rebooted, and are still having the problem, you need to do the whole list of commands again... be careful how you type...
Sent from my Nexus One using XDA App
Danger, it seems as I can't remove those two files as I get the error message "rm failed for /system/etc/install-recovery.sh, No such file or directory". Any ways to successfully remove them?
Sounds like the files aren't actually there then, unless you're making a typing error...
Did your recovery update after the last attempt? Did it look different, what is the recovery version that is listed on the recovery screen?
Sent from my Nexus One using XDA App
I have been flashing different themed recoveries to see if any data transfers, and the background changes. But as before the actions all say "Run 'nandroid-moblie.sh' via adb!" or something similar.
cajer said:
I have been flashing different themed recoveries to see if any data transfers, and the background changes. But as before the actions all say "Run 'nandroid-moblie.sh' via adb!" or something similar.
Click to expand...
Click to collapse
if the rm doesn't work it's fine.
But what about your flashing command? It simply works or outputs an error too?
When u flashed themed ones, did the background change?
The background did change when I flashed the themed ones, however it still outputs errors like "Run 'nandroid-moblie.sh' via adb!" when i try to run any of the options under recovery. The fastboot flashing command gives this "writing 'recovery'... FAILED (remote: image update error)" error.
cajer said:
The background did change when I flashed the themed ones, however it still outputs errors like "Run 'nandroid-moblie.sh' via adb!" when i try to run any of the options under recovery. The fastboot flashing command gives this "writing 'recovery'... FAILED (remote: image update error)" error.
Click to expand...
Click to collapse
When you try running a NAND backup or restore a previous NAND?
When restoring, the backup must be at the exact position where it was when you did it: /sdcard/nandroid/HT#####/BCD######
I was trying to backup my current image, and this happens with all other actions even the shut down action on the recovery page just with "Run 'reboot -p' via adb!"
lawl xD that seems useful...
well, that's extremely odd to be honest...uhm...I think you should try and contact amon_ra if possible...He knows the code of his recovery and might know what's wrong...
I really have no clue, sorry =\
PS: Have u tried clockworkmod recovery?
Alright I will try contacting amon_ra, and I will try clockwork tomorrow. I was going for amon_ra recovery to get Sense HD on it with sd partition. Thanks for the help though I learned more stuff about my phone.
EDIT: Wow, clockwork installed like a charm, and I didn't even have to do anything. I'm now a clockwork convert.

Deodex failure, need help please.

Hi guys
I'm new to deodexing, following a guide for XUltimate.
I copied my system\app dir to a folder called origi_app, and my system\framework to a folder called origi_frame on my int SD card, then copied these two folders to my PC XUltimate dir.
Ran option 3, then 4, both finished with sucessful.
This gave me two new folders in the XUltimate dir...
done_app & done_frame
I copied these back to my int SD card, then following the guide, ran ADB from cmd prompt..
Typed: ADB Shell
Got a $
Typed: SU
This gave me a Permission Denied ??
So as per the guide, I tried Root Explorer...
Selected All the .apps in done_App, selected copy and then tried to paste into the system\app dir.... this then gave me a failed to copy due to lack of space error and the phone started to vibrate and com.android force closing repeatedly...
Were did I go wrong, why did I get permission denied trying to get the SU cmd?
The full adb guide was as follows:
adb shell
su
stop
mount -o rw,remount /dev/block/mmcblk1p21 /system
rm /system/app/*.odex
rm /system/framework/*.odex
cp /sdcard/done_app/* /system/app/
cp /sdcard/done_frame/* /system/framework/
mount -o ro,remount /dev/block/mmcblk1p21 /system
reboot
As above, got as far as SU then got permission denied!
So thankfully I did a nandroid backup before and am currently restoring it...
EDIT: My Backup has just finished restoring from CWM... rebooted but it is now on original startup setup and getting force closes for lots of apps???
Had to re add my APN settings to re download MY Backup and am currently restoring apps and data from it now! Fingers crossed. I thought the whole point of a cwm back up was to create an exact image of the whole system, files, date and settings etc?
Well, restored via My Backup, but rom manager and Sky news kept force closing, so wiped the whole thing and flash a custom js8 from from Doc's kitchen... glad I did... just miss the cirlce battery mod I had before.

[Q] Cant flash ClockworkMod Recovery (cannot open for read: No such file or directory

When i type the dd if=/data/recovery.img of=/block/mmcblk0p6 bs=4096 to flash over the clockworkmod, into my command promt it says 'cannot open for read: No such file or directory' and i dont know what im doing wrong.
I mean everything else seemed to workout fine. i downloaded the recovery image it said to save it but it was already saved to my computer after i downloaded it so i dont know if this could be the problem.
Then i used the adb push recovery.img/data command to push the recovery image to my phone, i think this might be where i messed up. After i put in the command a long list of text pops up on the command prompt. It starts out showing 'Android Debug Bridge version 1.0.26' then is followed by a long list of adb commands. Idk know if this is what its supposed to show.
Next i did the adb shell, su, dd if=/dev/block/mmcblk0p6 of=/sdcard/mmcblk0p6.backup bs=4096 command and that worked fine it said 2560+0 records out, 2560+0 records in 10485760 bites transfered in 0.413 secs and i actually found that file on my sdcard. So i think i did that right.
Next i tried to use the command 'dd if=/data/recovery.img of=/block/mmcblk0p6 bs=4096' and like i said earlier it just says 'cannot open for read: No such file or directory'
Lastly i tried the rm /data/recovery.img command and it said rm failed for /data/recovery.img, No such file or directory in the command prompt.
Im sorry i am new at this but i thought i followed the directions perfectly and any help anyone could give me would be greatly appreciated.
First off, before someone else says it, you shouldn't start a new thread for something we already have a topic for. But anyways,
Sounds to me like recovery.img never got pushed to /data. Not sure if its a typo in your post but 'adb push recover.img/data' should be 'adb push recovery.img /data'. The space is important. On your phone use a root file explorer and go to your /data partition and see if recovery.img is there. You may need to either change permissions for /data or just put recovery.img on your sdcard and move it to /data with a root explorer.
Sent from my LG-P925 using Tapatalk
Well im sorry im new to this kind of thing, i didnt want to make anyone mad i just wanted some help and i apologize if ive ticked somone off. How would i change the permissions for the data? And could you tell me how to use the root explorer to put the recovery image in the right place? Again i appreciate any help you can offer.
Is recover.img in the same folder as adb? Because the instructions assume your recovery.img is in the same folder you are working from. So if you have to cd to your adb folder to use adb then recovery.img should be in that folder as well. Look at your cmd window, whatever directory/ folder it says you are in that is where you should put recovery.img.
If you saw a bunch of commands it means the .img did not go through your command did not work. You dont have the recovery.img in /data either put the file on your sdcard and use a root explorer to move it to /data or try the adb push again, you most likely made a typo or something.
You would put recovery.img on your sdcard through your computer. Open root explorer and navigate to your sdcard, long press on the recovery.img select move, go to/ data on the root of the phone, not the one on either sdcard it MUST be /data not /mnt/sdcard/data or anything like that once there paste file to /data and finish up in adb shell.
Alright i copied the recovery image to the /data folder and finished up in command prompt and everything worked out like it was supposed to. what was i supposed to do next to put it into cwm recovery mode? I held power, volume down, 3d button but i just went into normal recovery mode. then i went to rom manager to try and put it into cwm recovery that way but it just rebooted my phone. And when i went back into the /data folder i couldnt find the recovery image there anymore and i did a search on my root explorer and couldnt find it anywhere.
Hold vol down + 3D + power when lg logo appears release power but keep vol down +3D held down until recovery pops up. If you still don't boot into cwm try flashing recovery.img again. Do NOT use rom manager at all to install cwm on this phone.
Well ive tried to take the recovery image from the sd card to the /data folder but when i run 'rm /data/recovery.img' on the command prompt then reboot my phone, i turn it off then try and put it in recovery mode but its just regular recovery mode not cwm recovery mode. And everytime i run the 'rm /data/recovery.img' when my phone boots back up the recovery image is no longer in the /data folder or anywhere. But if i dont run the 'rm /data/recovery.img' after moving the recovery image to the /data folder it stays in the folder. Is it supposed to dissapear from the /data folder?
And i tried putting the recovery image in the same folder as abd which is the platform tools folder then flash it over and i got the same message. (cannot open for read: No such file or directory.)
Im sorry for all the questions and I am thankful for your help. I feel like i cant be the only person having this problem, well i hope im not that would make me feel really stupid. Thanks.
powers.jereme said:
Well ive tried to take the recovery image from the sd card to the /data folder but when i run 'rm /data/recovery.img' on the command prompt then reboot my phone, i turn it off then try and put it in recovery mode but its just regular recovery mode not cwm recovery mode. And everytime i run the 'rm /data/recovery.img' when my phone boots back up the recovery image is no longer in the /data folder or anywhere. But if i dont run the 'rm /data/recovery.img' after moving the recovery image to the /data folder it stays in the folder. Is it supposed to dissapear from the /data folder?
And i tried putting the recovery image in the same folder as abd which is the platform tools folder then flash it over and i got the same message. (cannot open for read: No such file or directory.)
Im sorry for all the questions and I am thankful for your help. I feel like i cant be the only person having this problem, well i hope im not that would make me feel really stupid. Thanks.
Click to expand...
Click to collapse
rm is the command to remove. So yes, recovery.img is supposed to disappear after that command. Put it back on /data and run the whole process from the CWM thread again making sure you do every step. Sounds like you may have accidentally skipped a step.
Sent from my LG-P925 using Tapatalk
Double post.
Ugh...keep selecting quote instead of edit on Tapatalk...Triple post...
Alright ill try that again, so i should put the file back on the /data folder and then still do the step where you try to flash over cwm from the cwm thread, even though its already there? Thanks
powers.jereme said:
Alright ill try that again, so i should put the file back on the /data folder and then still do the step where you try to flash over cwm from the cwm thread, even though its already there? Thanks
Click to expand...
Click to collapse
Yea just do it all again. Worst case is you flash cwm back over cwm
Sent from my LG-P925 using Tapatalk
I got it to work Urabewe was right i just needed to put the recovery image in the correct folder and everything worked perfect. Thanks guys.

[GUIDE] Upgrade 4.5.15 rooted & encrypted -> 5.0.2 WITHOUT DATA/SETTINGS LOSS

as usual, if anything goes wrong, no responsibility etc
The official update tutorial for rooted users doesn't keep app data, only internal storage! This tutorial keeps EVERYTHING
This method allows updating from 4.5.15 (unlocked, encrypted, rooted) to 5.0.2 without any data (sys settings + app data + user data) loss
A FAQ section is present at the end of this post and will be regularly updated.
List of files to download while doing the following steps:
OOS 5.0.2 ROM
Codeworkx TWRP recovery
Latest Magisk
Terms and software used in this guide:
Fastboot / Bootloader = bootloader of the phone, it's a very low level mode of the phone that allows booting into recovery. Can be accessed by using the advanced reboot menu (enable in dev options) or by "adb reboot fastboot".
Recovery = a small operating system on the phone that allows you to do various operations even when the main OS (Android) is broken. This includes flashing ROMs, modifying stuff on the storage, etc. It's the Android swiss army knife. If you can get a phone to boot TWRP, then you can do almost anything.
Magisk = rooting software that uses a systemless method to keep SafetyNet working. Systemless = instead of modifying the system, every change is put in a separate image that is mounted "over" the system. When the system tries to access a file modified by Magisk, instead of reading it from the partition, it reads it from Magisk. It's recommended to use Magisk instead of SuperSU as of 2018.
ADB = tool that allows controlling the phone from your PC through USB. You can use it when you're in Android if USB debugging is enabled in the settings, or when you're in TWRP. Here, we mostly use it for transferring files directly (without MTP) and running commands (using "adb shell")
Note: For this guide you will be required to download and install Magisk. If you don't want your phone to be rooted, then at the end of this guide reboot into TWRP, wipe both caches and re-flash the OS. This will uninstall Magisk and any other root patch. Beware: it will reflash stock recovery, so if you ever want to re-root, you'll need to reboot to fastboot and flash TWRP manually.
Convention for commands that you will have to run:
a command line starting with "C:" means that it should be run on your PC
a command line starting with "~ #" means that it should be run on your phone (through adb shell) while in TWRP
a command line starting with "OnePlus5:/ $" means that it should be run on your phone (through adb shell) while in OxygenOS
Although the commands start with "C:", this is just for readability purposes. You should run everything from inside an empty directory with enough disk space and writing access.
Your phone will have to be plugged in to your PC from the beginning to the end. Also, make sure it has at least 80% battery before beginning, just in case.
I know, the tutorial is huge. This is simply due to the fact that if I just wrote "make a nandroid backup of this and that, flash, and restore the backup while doing this", then some people may encounter problems because not everyone knows how to do a nandroid backup, restore it, etc. Also, there are a lot of things that need to be done precisely that way and not another way, which explains why the tutorial is huge. Also, you may notice that there is a lot of commands to run throughout the tutorial, this is because that way, I'm sure that at the end, you will have done everything like I did it on my phone, so that if you have a problem it's much easier to figure out where it comes from.
Summary of what you need to do (this is only a SUMMARY to give you a preview of what the whole thing looks like, you shouldn't follow it except if you're really an expert since a lot of things need to be done precisely, instead you should follow the easier complete steps below):
Make a Nandroid backup of /data
Backup files on internal storage
Wipe everything (internal storage + /data + system + caches), and then format data (important!)
Push and flash the OOS zip
Wipe caches and reboot (to Oreo!)
When it reboots, make sure everything (features, like Wi-Fi and fingerprint sensor) works. Don't "save anything" though, everything you do will be erased when we'll restore your backup. This is just a "test drive" for Oreo.
Reboot to TWRP, wipe Data and restore the /data backup
Run the three commands to fix Wi-Fi and fingerprints
Reboot (to System) and check everything works (don't do anything, don't change any setting, just make sure it works)
Reboot to TWRP, rename the "Android" folder to "Android_oreo" on sdcard, delete everything else on sdcard and restore your internal files
Rename the freshly restored Android (nougat) folder to "Android_nougat" and rename "Android_oreo" to "Android".
Flash Magisk, wipe dalvik+cache and reboot to System
When in Android, everything should work except some apps won't have their data. This is normal. Open a terminal (either on your phone using Termux or from your PC using adb shell), elevate using su and rename "Android" to "Android_oreo" and "Android_nougat" to "Android" (this is so that it correctly restores permissions)
If everything works fine, delete the "Android_oreo" folder
First, if you have Xposed Framework (systemless or not) installed, uninstall it. Next, if needed, uninstall any Magisk module that is "Nougat-only" to prevent any problems afterwards.
Boot the phone to bootloader/fastboot (either using advanced reboot, or by using volume down button when you start your phone) and boot to the TWRP recovery by doing
Code:
C:\> fastboot boot twrp-3.2.1-0-oreo-8.1-codeworkx-cheeseburger.img
from your PC.
Next, in TWRP, make a backup of /data (using the Backup button). Then, still while in TWRP, run the following commands:
Code:
C:\> adb shell
~ # cd /sdcard
/sdcard # tar cvf twrp.tar TWRP
/sdcard # md5sum twrp.tar
<< md5 checksum of twrp.tar >>
/sdcard # exit
C:\> adb pull -p /sdcard/twrp.tar
When the above command has finished, make sure that the checksum of the received twrp.tar file matches the one previously displayed.
If it doesn't match, delete the file and run adb pull again. Don't continue following this guide until you have received a 1:1 (checksum-wise) backup of /data.
Code:
C:\> adb shell
<< WARNING: dangerous command! double check the following line is correct before pressing enter! >>
~ # rm -rf /sdcard/TWRP
~ # rm /sdcard/twrp.tar
That was for /data. Now, the backup for the internal storage:
Code:
~ # cd /sdcard
/sdcard # du -csh
<< you should see here the total size of sdcard, that'll give you an idea of how long it'll take >>
/sdcard # tar cvf sd.tar element1 element2 element... elementN
<< in the command above, replace "element1..N" by a space-separated list of what you want to have in the backup.
Keep in mind that your list HAS to contain the element "Android" (case is important). It contains the app data.
Let's say for example you want to keep only the photos you have taken (and nothing, nothing else that was on internal storage).
The photos are in the folder DCIM, so the command will look like this:
tar cvf sd.tar Android DCIM
(because you want DCIM, and Android has to be in the list, no matter where)
>>
/sdcard # md5sum sd.tar
<< md5 checksum of sd.tar >>
/sdcard # exit
C:\> adb pull -p /sdcard/sd.tar
When the above command has finished, make sure that the checksum of the received sd.tar file matches the one previously displayed.
If it doesn't match, delete the file and run adb pull again.
Keep in mind that anything you don't put in that list will not be backed up and will be lost!
Now, you have a backup for all the important stuff so we can start doing the real sh*t.
Now, the important step:
Go back to the TWRP home screen, press "Wipe", "Advanced Wipe" and there check "Dalvik / ART Cache", "Cache", "System", "Data" and "Internal Storage". Confirm using the slider at the bottom of the screen. Press the home button, then "Reboot" and "FastBoot". Now, type the same fastboot command as in the previous step to boot the recovery image. You'll enter the recovery as before.
Now, on your PC, in the terminal, type
Code:
adb push -p OnePlus5Oxygen_23_OTA_029_all_1801292040_d71af3d.zip /sideload
(note: here, we are not using "adb sideload", we are really using "adb push"). In TWRP, click Install, in the file manager go to /sideload and select the OOS zip file. Confirm by sliding. If you get an error, go back to home, click Mount and ensure System is not checked. Then try installing again. If it still does not work, reboot to fastboot, type command again, get to the recovery and install again.
When the zip-file is installed, go home, click "Wipe", "Advanced Wipe" and check both caches and confirm. Then, go home, click "Wipe" and then "Format Data". Then, go home, click "Reboot" and then "System". Your phone will now reboot to Oreo. It will take a long time, but do not turn off the phone. Let it run. On my phone, it took on average 2 minutes for that boot.
You'll be greeted by the "first boot" page. It'll ask you if you want to restore a backup or start anew, choose start anew. Connect to your Wi-Fi network and Google account. Follow all the instructions until you get to the home screen. There, make sure everything works (especially Wi-Fi and fingerprint sensor). Don't save your fingerprints yet, they will be erased afterwards. If everything works, you can continue following these instructions. If not, post a comment down there.
Now that you're at the home screen, go in the settings, About Android and click the build number 8 times to enable Developer Options. Go in there and enable advanced reboot. Then, reboot your phone into fastboot/bootloader using the power button. Type the exact same command as before to start TWRP. Once that you are in TWRP, run the following commands:
Code:
C:\> adb push -p twrp.tar /sdcard/
C:\> adb shell
~ # cd /sdcard
/sdcard # tar xvf twrp.tar
/sdcard # cp /data/misc/wifi/WifiConfigStore.xml /sdcard/
In TWRP, click "Wipe", "Advanced Wipe" and check only the "Data" partition. Confirm. Press home, then "Restore" and choose the backup in the list. Confirm to restore. Back to the terminal, we need to run the following commands otherwise Wi-Fi and fingerprints won't work:
Code:
/sdcard # cp WifiConfigStore.xml /data/misc/wifi/
/sdcard # rm /data/misc/wifi/wpa_supplicant.conf
<< WARNING: dangerous command! double check the following line is correct before pressing enter! >>
/sdcard # rm -rf /data/system/users/0/fpdata
/sdcard # rm /data/system/users/0/settings_fingerprint.xml
Note: the command above are ran from your PC in an adb shell while the phone is still in TWRP.
Reboot the phone to system and ensure Wi-Fi and fingerprints are still working. Right now you should already see your old home screen and all your apps, but the internal storage isn't there yet. Reboot in fastboot, run the command to get in TWRP.
Once TWRP has booted, run the following commands:
Code:
C:\> adb push -p sd.tar /sdcard/
C:\> adb shell
~ # cd /sdcard
<< WARNING: dangerous command! double check the following line is correct before pressing enter! >>
/sdcard # rm -rf Alarms Albums DCIM Download Movies Music Notifications Pictures Podcasts Ringtones
/sdcard # ls
<< now, look at the list of files that were printed, and rm anything left that is not called "Android" or "sd.tar"
<< WARNING: dangerous command! double check everything is correct before pressing enter! >>
if when you do rm <the thing> it tells you it's a directory, then do: rm -rf <thething>
if there's a folder called SomeFolder, do "rm -rf SomeFolder"
next, run this:
/sdcard # ls
Android sd.tar <-- expected output
/sdcard # mv Android Android_oreo
/sdcard # tar xvf sd.tar
/sdcard # mv Android Android_nougat
/sdcard # mv Android_oreo Android
If you don't have Magisk somewhere on your sd card, download it and upload it using MTP or adb. Then flash it using the Install button. Clear dalvik/cache and reboot to system.
When the phone has booted (again, it might take time), make sure USB debugging is enabled and run the following commands:
Code:
C:\> adb shell
OnePlus5:/ $ su
<< here, you might see a Magisk screen asking for superuser access. Allow. >>
OnePlus5:/ $ cd /sdcard
OnePlus5:/sdcard $ mv Android Android_oreo && mv Android_nougat Android
Now, try some apps and make sure all the data is there (especially games and Netflix/Hulu/etc). If everything is there, and the phone works properly, go back in the terminal and type:
Code:
OnePlus5:/sdcard $ rm -rf Android_oreo
Optionally, start the TWRP app and flash it, it can always be useful. You can also reboot to fastboot to do that.
Now reboot your phone (normal reboot) one last time.
There, working OOS 5.0.2 / Android 8.0.0 phone with no data loss.
Frequently Asked Questions
How long does the whole thing take?
Highly depends on the amount of data you have on your phone. Since it the USB port only supports USB 2.0, it may take 4 or 5 hours in total.
Will doing this void my warranty?
No.
Will I be able to install future OTA updates using the regular download-reboot-flash-twrp procedure?
Yep. Just use the regular method as you would have on Nougat.
Will I lose my data?
If you follow all the instructions, no. Even if you don't follow them, as soon as you have made a backup of /data and internal storage, then no matter how bad you screw up you could always get a working phone back.
I followed the instructions and now my phone doesn't work
Boot in TWRP, wipe everything, reflash.
questions will be added there in the future
Having WiFi and fingerprint issues
You sure it is a good idea to just delete those files? I would have guessed that I need to replace these (nougat version from backup) with the oreo version to have it working just like before the restore.
Code:
/sdcard # rm /data/misc/wifi/wpa_supplicant.conf
/sdcard # rm -rf /data/system/users/0/fpdata
/sdcard # rm /data/system/users/0/settings_fingerprint.xml
I'm having the issues with wifi and fingerprints. Neither one is working. I'll try to figure out how to fix this.
@zdimension Thanks for this guide, I don't have time to test it yet, but I have a question
pdluke said:
Code:
/sdcard # rm /data/misc/wifi/wpa_supplicant.conf
/sdcard # rm -rf /data/system/users/0/fpdata
/sdcard # rm /data/system/users/0/settings_fingerprint.xml
Click to expand...
Click to collapse
At this point in the procedure, adb shell is still using root (before flashing magisk) ? How is that possible ? Does the adb /sideload preserve root ?
olivier380 said:
@zdimension Thanks for this guide, I don't have time to test it yet, but I have a question
At this point in the procedure, adb shell is still using root (before flashing magisk) ? How is that possible ? Does the adb /sideload preserve root ?
Click to expand...
Click to collapse
These commands should be run while the phone is in TWRP. Also note that adb /sideload is not used here, only adb push.
pdluke said:
You sure it is a good idea to just delete those files? I would have guessed that I need to replace these (nougat version from backup) with the oreo version to have it working just like before the restore.
Code:
/sdcard # rm /data/misc/wifi/wpa_supplicant.conf
/sdcard # rm -rf /data/system/users/0/fpdata
/sdcard # rm /data/system/users/0/settings_fingerprint.xml
I'm having the issues with wifi and fingerprints. Neither one is working. I'll try to figure out how to fix this.
Click to expand...
Click to collapse
If you delete them, they will be generated automatically at the next system boot. But you could also make a backup of those three files before wiping /data, store that somewhere, restore Nougat /data and then restore your backup of those three files. The result would be the same.
Note: actually, not exactly. Erasing the first file won't change anything since it's not used anymore in Oreo, but the two other files contain the fingerprint configuration (list of saved fingerprints). So,
Either you remove the files and you have to save your fingerprints again at next boot
Either you restore them from an Oreo backup and you'll get the fingerprints you had saved during the "first boot" procedure when you rebooted the phone right after flashing the OS
But the result is mostly the same: everything works. Deleting the files ensures you get something clean. If you restore from an Oreo backup I can't guarantee the result (as it may interfere with other files from the Nougat backup).
10 bucks to make a script to do this all for me haha.
@zdimension Thanks for the clarification Another thing you might add to the files to download would be Magisk (optionally). In this kind of guide, I've always find it useful to download everything first.
olivier380 said:
@zdimension Thanks for the clarification Another thing you might add to the files to download would be Magisk (optionally). In this kind of guide, I've always find it useful to download everything first.
Click to expand...
Click to collapse
Oops, forgot to add it
I added the link, and also instructions for how to un-root afterwards for those who would want it.
To improve the guide, here are some ideas :
- You should highlight that rm -rf is a very dangerous command, and that it needs to be checked twice (especially the targeted folder)
- It could be useful to use the du -csh command to check the size of a folder (to estimate the backup time for example).
- As a safety measure, one could md5sum the tar file before and after using adb pull
What do you think ?
olivier380 said:
To improve the guide, here are some ideas :
- You should highlight that rm -rf is a very dangerous command, and that it needs to be checked twice (especially the targeted folder)
- It could be useful to use the du -csh command to check the size of a folder (to estimate the backup time for example).
- As a safety measure, one could md5sum the tar file before and after using adb pull
What do you think ?
Click to expand...
Click to collapse
Thanks for the ideas! I updated the post (and I added a changelog at the bottom for future reference).
Followed guide for successful upgrade from 4.5.15 encrypted, unlocked bootloader w/ Magisk root.
One note, after the first complete wipe and flash of the full ROM, it was getting stuck on first boot and never completed. Discovered that I needed to not just wipe the Data partition but Format it in TWRP, to clear out the old encryption I think. Magisk wouldn't install either until I did this.
@debork thanks for the positive feedback (all the merit goes to @zdimension of course)
@zdimension there are many people in the other thread https://forum.xda-developers.com/oneplus-5/how-to/official-oxygenos-4-5-2-7-1-1-ota-t3627003 that tried (unsucessfully) to upgrade from 4.5.15 to 5.0.1, maybe a link to this topic could be useful for them (if it's not too late).
Regarding the
Go back to the TWRP home screen, press "Wipe", "Advanced Wipe" and there check "Dalvik / ART Cache", "Cache", "System", "Data" and "Internal Storage".
Click to expand...
Click to collapse
I think it should be highlighted in red, since it is the actual "clean flash" (AFAIU, correct me if I'm wrong).
if we only have the BL unlocked non root and stock recovery can we only ota without any loss of data ?
debork said:
Followed guide for successful upgrade from 4.5.15 encrypted, unlocked bootloader w/ Magisk root.
One note, after the first complete wipe and flash of the full ROM, it was getting stuck on first boot and never completed. Discovered that I needed to not just wipe the Data partition but Format it in TWRP, to clear out the old encryption I think. Magisk wouldn't install either until I did this.
Click to expand...
Click to collapse
Thanks for feedback, I will add that to the guide (although it worked with just Wipe for me )
zdimension said:
Thanks for feedback, I will add that to the guide (although it worked with just Wipe for me )
Click to expand...
Click to collapse
Have you rooted the 4.5.15 with Magisk or SuperSU (which is not compatible with Oreo anymore) ?
olivier380 said:
Have you rooted the 4.5.15 with Magisk or SuperSU (which is not compatible with Oreo anymore) ?
Click to expand...
Click to collapse
I stopped using SuperSU when it was sold to that shady company. Also, Magisk is better imo.
quick05 said:
if we only have the BL unlocked non root and stock recovery can we only ota without any loss of data ?
Click to expand...
Click to collapse
Official OnePlus support said that nothing is guaranteed if your bootloader is unlocked. But since you're on stock recovery + non rooted, you could always try. But backup everything first. Some people here on XDA have reported that it doesn't work, though.
Just followed your guide with no problems. Thank you very much!! I can confirm also that you need to format data after the wipe otherwise it gets stuck in a bootloop!
Thanks so much for this. I was able to successfully follow the guide and get upgraded to 5.0.1 without losing any data. In fact, I even messed up one step by failing to include the Android directory in the sdcard.tar backup (perhaps that should be more explicit), but it doesn't seem to have affected everything; all of my apps seem to have retained their data.
A few notes:
1. The file size of twrp.tar was ~14GB but when executing the pull command, it recognized it as only ~1.3 GB. As a result, the pull was not complete until it reached over 1000%. All the more reason to do the md5 check.
2. As others stated, I needed to format the data partition, not just wipe it.
3. I might recommend also including a "summary" version somewhere on what this guide does. Scrolling through the guide the first time, it seemed pretty daunting, but really all that you're doing is: backing up data partition and internal storage; wiping device; flashing Oreo ROM; tweaking a few files; and restoring backed up data and internal storage.
Thank you again so much! Glad to finally be on Oreo.
elight3 said:
Thanks so much for this. I was able to successfully follow the guide and get upgraded to 5.0.1 without losing any data. In fact, I even messed up one step by failing to include the Android directory in the sdcard.tar backup (perhaps that should be more explicit), but it doesn't seem to have affected everything; all of my apps seem to have retained their data.
A few notes:
1. The file size of twrp.tar was ~14GB but when executing the pull command, it recognized it as only ~1.3 GB. As a result, the pull was not complete until it reached over 1000%. All the more reason to do the md5 check.
2. As others stated, I needed to format the data partition, not just wipe it.
3. I might recommend also including a "summary" version somewhere on what this guide does. Scrolling through the guide the first time, it seemed pretty daunting, but really all that you're doing is: backing up data partition and internal storage; wiping device; flashing Oreo ROM; tweaking a few files; and restoring backed up data and internal storage.
Thank you again so much! Glad to finally be on Oreo.
Click to expand...
Click to collapse
Thanks for the feedback! I'll add a summary to the guide.

Categories

Resources