fastboot flash command - Nexus S General

I've always wonder, Does the fastboot flash command require a wipe? For example when going from ROM to ROM we need to wipe system, boot cache and data. I am wondering if this is required when you are flashing actual IMG files into the partitions. This is different from flashing ROM where most of the time tar files are used.

No. But it depends what you're flashing and what you could already have on the phone. Flashing through fast boot simply overwrites the existing partition. But if you flash a radio image and you have an incompatible ROM already loaded it will not work.

Related

Restore a Data.img from nandroid backup? SOLVED

Never done this before, but is it possible to restore just the data.img bit from a nandroid after flashing new ROM? Obviously boing a full nandroid restore will wipe the ROM just installed won't it.
everytime I upgrade the latest CM Rom, I get an error unless I do a full wipe which is a pain.
so can I flash the data bit from the nandroid I did just before installing the new ROM?
If so is this the right command
fastboot flash data data.img
To answer my own Question - YES. I only ever used nandroid to restore back to a full working ROM after a Fail.
So - in case it helps anyone else
Get the nandroid that you did before the wipe and ROM Update.
Put the data.img file into the tools folder of your SDKfolder
Boot into Fastboot and connect so you see Fastboot USB on the phone.
in command prompt type
fastboot devices (just to make sure it sees your phone)
fastboot flash userdata data.img
Then reboot the fone. Voila - you should have your homescreens etc all back to how they would be if you hadn't wiped
Dayz xx

[Q] stock kitkat 4.4.2 rom zip

Hi everybody,
does anyone have or can do a flashable zip with the latest stock android 4.4.2 image?
If not, even the flashable zip with just the stock kernel would be enough.
Thanks a lot
Flashable stock rom 4.4.2 KOT49H , odex & deodex are posted HERE.
jase33 said:
Flashable stock rom 4.4.2 KOT49H , odex & deodex are posted HERE.
Click to expand...
Click to collapse
Well, i forgot to say i need the tilapia rom.
However, thanks for taking the time to answer.
andreapier said:
Well, i forgot to say i need the tilapia rom.
However, thanks for taking the time to answer.
Click to expand...
Click to collapse
I'm bumping this up (only for this time)...
It seems strange that nobody can help with my request...
Doesn't seem like anyone has created a flashable zip for the latest KOT49H build for Tilapia. You could just as easily download the latest factory image and flash it via fastboot
Eregoth said:
Doesn't seem like anyone has created a flashable zip for the latest KOT49H build for Tilapia. You could just as easily download the latest factory image and flash it via fastboot
Click to expand...
Click to collapse
Do i need to wipe data if i flash it via fastboot?
Or is it just like plain ota?
andreapier said:
Do i need to wipe data if i flash it via fastboot?
Or is it just like plain ota?
Click to expand...
Click to collapse
If you using a custom kernel and want to revert back to stock kernel, you only need to flash the boot.img from the factory image archive. This does not wipe your data.
If you are on a custom ROM, then it would probably be wise to wipe your data. Flash boot.img, system.img and userdata.img (the last file wipes user data automatically). Remember to also format the cache partition.
If you are on a stock ROM with a custom kernel, root access or any modified system files, you only need to flash system.img and boot.img. Formatting the cache partition wouldn't hurt either, just to be safe. This does not wipe your data.
Keep in mind that not wiping data ("dirty flashing") is generally a bad idea if you are flashing from one version to another, e.g. 4.4 (KRT16S) to 4.4.2 (KOT49H).
If this is the case, then you should first download the correct factory image for your current version and flash the system.img and boot.img (if you have made any changes to the system partition or kernel), and then flash the right OTA update, either with a custom recovery or with the stock recovery via ADB. This also does not wipe your data.
Hope this wasn't too confusing
Eregoth said:
If you using a custom kernel and want to revert back to stock kernel, you only need to flash the boot.img from the factory image archive. This does not wipe your data.
If you are on a custom ROM, then it would probably be wise to wipe your data. Flash boot.img, system.img and userdata.img (the last file wipes user data automatically). Remember to also format the cache partition.
If you are on a stock ROM with a custom kernel, root access or any modified system files, you only need to flash system.img and boot.img. Formatting the cache partition wouldn't hurt either, just to be safe. This does not wipe your data.
Keep in mind that not wiping data ("dirty flashing") is generally a bad idea if you are flashing from one version to another, e.g. 4.4 (KRT16S) to 4.4.2 (KOT49H).
If this is the case, then you should first download the correct factory image for your current version and flash the system.img and boot.img (if you have made any changes to the system partition or kernel), and then flash the right OTA update, either with a custom recovery or with the stock recovery via ADB. This also does not wipe your data.
Hope this wasn't too confusing
Click to expand...
Click to collapse
this is not confusing at all!
Infact thanks to your explaination i just understood what i have to do!
Thanks
andreapier said:
this is not confusing at all!
Infact thanks to your explaination i just understood what i have to do!
Thanks
Click to expand...
Click to collapse
Great! Glad I could help

[Q] Cannot install OTA 5.1 on 5.0.2 rooted

I have 5.0.2 (LRX22G) rooted + TWRP.
I flashed the original stock recovery from LRX22G, and still I cannot sideload OTA, I'm getting error "/system/bin/app_process32 has unexpected contents".
Is this because I'm rooted?
Is there another way to upgrade to 5.1 ? Can I just flash new bootloader, system, boot and recovery images (from the factory image LMY47D) and erase cache?
(Obviously I want to preserve my apps and data while upgrading...)
Found answer here:
http://www.theandroidsoul.com/fix-e...img-android-5-0-factory-images-nexus-devices/
The only missing (last) step for my setup:
flash latest TWRP, reboot into it, flash latest SuperSU, erase Dalvik and cache, reboot.
You can flash every partition for itself. No need to wipe. But I haven't done this so far so I can't tell if it will work.
But here is a guide.
http://highonandroid.com/android-sm...-android-5-1-manually-on-nexus-4-5-6-9-and-10
I always just manually flash all the images from the new factory image EXCEPT USERDATA. Never had any issues, and all my data stays the same as it was before flashing/updating.
And HOW exactly do you DO that (on a Zenfone 2e) because I cant find any Definitive Info on the phone variant. It seems that ASUS uses the same tools for the 2e as they do for the 2 (16 Gig) but they never say FOR Sure. I have a 2e and I'd REALLY like to be able to put the newer rom on it. I keep getting the same ...app_process32 Status 7 error.
So How would I go about GETTING the Factory Rom from ASUS ,
and 2 Where can I find the "Tools" i keep hearing about
Also, Im not a noob, I've used Fastboot and ADB before, I'm just not quite a "Pro"
hippopo said:
I have 5.0.2 (LRX22G) rooted + TWRP.
I flashed the original stock recovery from LRX22G, and still I cannot sideload OTA, I'm getting error "/system/bin/app_process32 has unexpected contents".
Is this because I'm rooted?
Is there another way to upgrade to 5.1 ? Can I just flash new bootloader, system, boot and recovery images (from the factory image LMY47D) and erase cache?
(Obviously I want to preserve my apps and data while upgrading...)
Click to expand...
Click to collapse
Hello,
you can flash yourself the content of the factory image.
Unzip the content , and then the newly extracted archive you will find.
you can do such tings ...
Code:
fastboot flash <partition> <path_to_img_file>
replace <partition> with system or bootloader
<path_to_img_file> should be the absolute path to your img fileSo if i were you I would simply flash the system partition and erase cache

Can't get back to Stock ROM (what am I doing wrong?)

History of what I did:
I first installed the first small OTA Update to 4.5.1 then unlocked the Bootloader and flashed TWRP v46 from xdvs23. And made a full TWRP Backup and flashed Magisk afterwards.
Everything worked fine until I debloated the System and wanted to make the OTA Update to 4.5.2 (1,5 GB), which didn't work. After I flashed it, the phone didnt boot anymore. So I restored the TWRP Backup, which doesn't work either.
Current status:
TWRP v58 is flashed and works. I can flash ExcperienceOS from Jamal, which works fine, too. But flashing the OTA file doesn't work and restoring my backup wont work either -_-
I would really appreciate help to get back to an OTA updatable version of OxygenOS!
If you still have the TWRP installed I would download the full 4.5.2 zip (Listed elsewhere on these forums) and use adb sideload to install it, then proceed again from there.
djsubterrain said:
If you still have the TWRP installed I would download the full 4.5.2 zip (Listed elsewhere on these forums) and use adb sideload to install it, then proceed again from there.
Click to expand...
Click to collapse
I did that several times. It doesn't work sadly... I get into a bootloop
You didn't erase your userdata partition by mistake did you? You could try going into fastboot mode and use the command:
fastboot format userdata
Obviously this will wipe the userdata partition but the phone is acting like there's no userdata partition anyway
djsubterrain said:
You didn't erase your userdata partition by mistake did you? You could try going into fastboot mode and use the command:
fastboot format userdata
Obviously this will wipe the userdata partition but the phone is acting like there's no userdata partition anyway
Click to expand...
Click to collapse
I might have, I will try that, thanks
Or just wipe everything, flash stock recovery, and flash Full OxygenOS zip.
https://forum.xda-developers.com/showpost.php?p=72799046&postcount=2
I formated the userdata and flashed the .zip from the link, but I still get a bootloop...
I still don't understand what I am doing wrong...
How about trying to wipe everything from wipe menu except internal storage and then flash the oos zip followed by lazy flasher zip from here - bit.ly/lazyflasher
If this doesn't work then try changing to a different version of TWRP!
Casual_Max said:
I formated the userdata and flashed the .zip from the link, but I still get a bootloop...
I still don't understand what I am doing wrong...
Click to expand...
Click to collapse
You didn't do these steps wrong by any chance?
Steps To Disable Forced Encryption i.e, Decrypt Data
1. At first time when you open twrp, it will ask you to allow system modification.
2. Allow it and then flash the no-verity-opt-encrypt.zip file .
3. Then Go to Wipe-->Format Data.
4. Type Yes to confirm wiping of Internal Storage.
5. Now you have decrypted the data sucessfully.
Note: Dont try to restore the nanodroid backup which you have taken before. It may end in bootloop.
Click to expand...
Click to collapse
From here:
https://forum.xda-developers.com/on...der-intall-t3626122/post72777899#post72777899
ok, there I see what caused my first bootloop. Thanks
But why doesn't flashing the Stock ROM .ZIP work on an wiped (fastboot format userdata) phone? What else do I have to do?
EDIT:
*** solved ***
I failed hard. Luckily the OnePlus Support is excellent and was able to fix my issue with a remote session using their official tools. The Phone and I are both happy again.
Thanks for all the help, though. I learned quite a lot while dealing with this issue. It's a very kind and nice community here

Techincal Question About Wiping System with Custom ROM

So I've seen with installing custom ROMs that there are steps that basically say, "Do not wipe system" in TWRP. I have noticed in doing things the dumb way that I can wipe every partition but the only way it becomes unrecoverable is if system is wiped, this is even if I install a custom ROM in its place. Can someone help me understand what has changed with A/B partition or OnePlus security settings where OOS system partition must be intact to allow one to run a custom ROM?
The reason I ask is that unless it is a byte for byte overwrite then we leave OOS files on parts of the custom ROM storage partition and if it is bit for bit write why would erasing the partition matter?
What seems more important for custom ROM is to not wipe data before rebooting in TWRP to flash magisk. So a clean flash is now flashing the ROM, flashing TWRP then reboot in TWRP and then only wiping data and art. Then flashing magisk. This is important to keep decryption working. That means not using factory reset feature either, always wiping with manually selected partitions.
Anyway wiping system is useless as the flashing script wipes it anyway.

Categories

Resources