[GUIDE] Update stock rooted/modified rom to last 6.0 Marshmallow w/o losing your data

Search This thread

Mairo

Senior Member
Feb 28, 2013
558
139
just make a clean flash and don´t restore all your apps immediately. i´m satisfied with M, i just miss " swipe up" function.
Is it possible, using this method, to roll back to KTU84P from LMY48M? My phone has been so unstable since I upgraded -- random reboots, widgets not functioning properly, camera sluggish as hell -- that I'm seriously considering going back to KitKat if I can do so using the same procedure.

I waited a long time to move to Lollipop, hoping all the bugs would be gone, but my phone was much more usable on KitKat.
 

c3k

Senior Member
Sep 13, 2009
622
520
Is it possible, using this method, to roll back to KTU84P from LMY48M? My phone has been so unstable since I upgraded -- random reboots, widgets not functioning properly, camera sluggish as hell -- that I'm seriously considering going back to KitKat if I can do so using the same procedure.

I waited a long time to move to Lollipop, hoping all the bugs would be gone, but my phone was much more usable on KitKat.

Never tried a downgrade with this method (never downgrade at all? )

I'm pretty sure it will not work because you need to roll back the changes the two major release (lollipop and marshmallow) did in your /data partition...

Only way is a clean install IMHO
 

efrant

Retired Senior Moderator & Developers Relations
Feb 12, 2009
11,468
10,985
Montreal
Samsung Galaxy S20
....boot.img is the kernel...:rolleyes:


also have only selinux enforced...isn't a stock kernel....

The boot image is not the kernel. The kernel is part of the boot image. The boot image also contains the ramdisk. The boot image that Chainfire released includes a stock kernel. Only the ramdisk is modified. ;)

Sent from my Nexus 5 using Tapatalk
 
  • Like
Reactions: wizeup881

boxcar8028

Senior Member
Mar 15, 2011
955
220
Seattle, WA
Just curious witch root method are you guys using with Superuser 2.5, Chainfire's boot.img or ElementalX-N5-6.01. is one better then the other or should I wait until a more official root method comes out. thanks
 

cloudbank

New member
Jan 5, 2015
4
0
I tried this method going from LMY48B directly to factory MRA58K. I flashed SupserSU v2.50. Everything flashed ok, but when I rebooted, I was stuck at the new loading animation for 30+ minutes. No joy after several reboots, so I restored LMY48B. :(
 

thorrules

Senior Member
Jun 24, 2012
340
195
Cary, NC
I tried this method going from LMY48B directly to factory MRA58K. I flashed SupserSU v2.50. Everything flashed ok, but when I rebooted, I was stuck at the new loading animation for 30+ minutes. No joy after several reboots, so I restored LMY48B. :(

Did you flash the modified boot.img before flashing supersu? I would recommend first clean upgrading to Marshmallow and then try to root it. Saves time and helps isolate issues.
 
  • Like
Reactions: cloudbank

cloudbank

New member
Jan 5, 2015
4
0
Did you flash the modified boot.img before flashing supersu? I would recommend first clean upgrading to Marshmallow and then try to root it. Saves time and helps isolate issues.

I'm coming from a rooted LMY48B and was trying not to have to wipe it first. I didn't flash a modified boot - just the factory .img files (excluding userdata). Is it possible to do this upgrade without having to wipe everything first? Doesn't sound like it..
 

boxcar8028

Senior Member
Mar 15, 2011
955
220
Seattle, WA
I tried this method going from LMY48B directly to factory MRA58K. I flashed SupserSU v2.50. Everything flashed ok, but when I rebooted, I was stuck at the new loading animation for 30+ minutes. No joy after several reboots, so I restored LMY48B. :(

did you first flashed Chainfire's boot.img then SU 2.5?
I have used this method to update L-5.1 and 5.1.1 and had no problems before and it worked like a charm.

I was planning to update this evening to M-6.0 first and then root with Chainfire’s boot and SU.
 

cloudbank

New member
Jan 5, 2015
4
0
did you first flashed Chainfire's boot.img then SU 2.5?
I have used this method to update L-5.1 and 5.1.1 and had no problems before and it worked like a charm.

I was planning to update this evening to M-6.0 first and then root with Chainfire’s boot and SU.

I think i am confused about the order of operations -
1) can i use this method to go to M without losing data, or do i have to wipe/reinstall userdata.img?
2) do i flash the modified boot.img after flashing the stock factory boot.img or do i just replace it?

thx :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 185
    Requirements:
    • you need to have a pc with adb working
    • a stock firmware on your device (any)
    • unlocked bootloader
    • a working backup just in case

    Pro:
    • you will not lose your data / application

    Cons:
    • you will lose all system modification (root, busybox, custom kernel...)
    • you'll take all the risk of operation (I've tested on my device)

    Guide:
    some file names changes depending on version so please complete the {version_here} placeholder with the file you download
    * prepend "sudo" on command line if you are on a Linux machine
    1. download last version for your device here (if you want to root download the zip file in the section below to speed up the operations)
    2. extract
    3. extract image-{device_here}-{version_here}.zip in the same folder (no subdir)
    4. command line* (or reboot device with vol down pressed):
      Code:
      adb reboot bootloader
    5. command line*:
      Code:
      cd {your_path_here}
    6. command line*:
      Code:
      fastboot flash bootloader bootloader-{device_here}-{version_here}.img
    7. command line*:
      Code:
      fastboot reboot-bootloader
    8. command line*:
      Code:
      fastboot flash radio radio-{device_here}-{version_here}.img
    9. command line*:
      Code:
      fastboot flash system system.img
    10. command line*:
      Code:
      fastboot flash boot boot.img
    11. ONLY IF YOU FOUND A VENDOR.IMG IN THE ZIP command line*:
      Code:
      fastboot flash vendor vendor.img
    12. command line*:
      Code:
      fastboot flash cache cache.img
    13. command line*:
      Code:
      fastboot reboot

    Now you have the lastest stock image and all your data.

    Change recovery (TWRP) and root:
    Note that we haven't flash the stock recovery, but during every boot of an unmodified system there's a script that do that (supersu usually deactive this behavior during install).
    If you had TWRP installed and the SuperSU zip on your device, at the end of the above procedure you can boot directly from bootloader to recovery and go directly to last step:
    5
    I have got the system.img failing to load workaround here on attempting with a Nexus 5 and 5.1.0-lmy47i image, the trick was to use sparse file option of fastboost to a smaller value than 1GB like 512M, below is what I have done;

    1) got latest fastboot.exe and adb rev22 from Android Studio and up to date tools
    2) Using a helper rooting Software called Nexus Root Toolkit I have replaced copied newest fastboot files in \Nexus Root\data\
    3) In \Nexus Root\data\flashstock.bat change fastboot flash system %system_img% to fastboot -S 512M flash system %system_img%

    You should see this

    Code:
    Flash Stock + Unroot...
     ------------------------------------------------------------------
    
    
    target reported max download size of 1073741824 bytes
    sending 'bootloader' (2579 KB)...
    OKAY [  0.299s]
    writing 'bootloader'...
    OKAY [  0.503s]
    finished. total time: 0.802s
    rebooting into bootloader...
    OKAY [  0.003s]
    finished. total time: 0.003s
    
    target reported max download size of 1073741824 bytes
    sending 'radio' (45425 KB)...
    OKAY [  1.624s]
    writing 'radio'...
    OKAY [  3.125s]
    finished. total time: 4.750s
    rebooting into bootloader...
    OKAY [  0.002s]
    finished. total time: 0.003s
    
    target reported max download size of 1073741824 bytes
    sending 'boot' (8930 KB)...
    OKAY [  0.496s]
    writing 'boot'...
    OKAY [  0.758s]
    finished. total time: 1.256s
    rebooting into bootloader...
    OKAY [  0.002s]
    finished. total time: 0.002s
    
    target reported max download size of 1073741824 bytes
    erasing 'cache'...
    OKAY [  0.624s]
    sending 'cache' (13348 KB)...
    OKAY [  0.630s]
    writing 'cache'...
    OKAY [  1.084s]
    finished. total time: 2.339s
    rebooting into bootloader...
    OKAY [  0.001s]
    finished. total time: 0.002s
    
    target reported max download size of 1073741824 bytes
    sending 'recovery' (9648 KB)...
    OKAY [  0.516s]
    writing 'recovery'...
    OKAY [  0.801s]
    finished. total time: 1.318s
    rebooting into bootloader...
    OKAY [  0.002s]
    finished. total time: 0.003s
    
    erasing 'system'...
    OKAY [  1.086s]
    sending sparse 'system' (517642 KB)...
    OKAY [ 16.661s]
    writing 'system'...
    OKAY [ 34.579s]
    sending sparse 'system' (503978 KB)...
    OKAY [ 16.225s]
    writing 'system'...
    OKAY [ 34.701s]
    finished. total time: 103.255s
    rebooting into bootloader...
    OKAY [  0.002s]
    finished. total time: 0.003s
    
    target reported max download size of 1073741824 bytes
    erasing 'userdata'...
    OKAY [  8.373s]
    sending 'userdata' (137318 KB)...
    OKAY [  4.511s]
    writing 'userdata'...
    OKAY [  9.187s]
    finished. total time: 22.071s
    rebooting...
    
    finished. total time: 0.001s
    
    
    
    Booting up your freshly flashed stock device...
     ------------------------------------------------------------------
    
    Wait for your device to finish booting up...
    
            - It may appear to be boot looping; just wait...
    
            - It could take 5-10 minutes; please be patient...
    
    When its finally booted back up, please remember
    to re-enable USB debugging if you plan on using
    the toolkit to perform other operations.
    
    
    
    Press any key to exit...

    Attached are the latest fastboot files if you don't want to go thourgh all the hassle of downloading the whole android studio

    fastboot.exe - md5: d335a521b494edae60c131569126db82 - API 22
    adb.exe - md5: 9e6a80066408aaa565f61071e645450e - API 22
    AdbWinApi.dll - md5: 47a6ee3f186b2c2f5057028906bac0c6 - API 22
    AdbWinUsbApi.dll - md5: 5f23f2f936bdfac90bb0a4970ad365cf - API 22
    4
    thread updated
    4
    unROOT :
    1) Install adb + drivers (if you"re on Windows 10, adb may not working atm)
    2) Download the image factory of your current version (example : 5.1.1. LMY48B https://dl.google.com/dl/android/aosp/hammerhead-lmy48b-factory-596bb9c1.tgz )
    3) Extract boot.img, system.img & recovery.img
    4) In a command prompt from the adb directory use these commands :
    Code:
    fastboot flash boot boot.img
    fastboot flash system system.img
    fastboot flash recovery recovery.img

    If the OTA is knocking at your door :

    1) Just apply it and jump to the last part

    If you want to apply the update ASAP :
    (Get the latest OTA there : http://xdaforums.com/google-nexus-5/general/ref-nexus-5-stock-ota-urls-t2475327)

    1) Download the OTA.zip on your PC, rename the file update.zip, then place file in the same directory as adb.
    2) Make sure you have USB Debugging checking in the Developer Options, then connect your phone.
    3) Open the command prompt from the directory above on your PC and type the command: 'adb reboot recovery'
    4) When in recovery, you’ll see an android laying down. Press and hold POWER, and then press volume up and release. The menu will appear. Select “apply update from adb
    5) Using the command prompt type: 'adb sideload update.zip' The file will load and the update will begin. (if you"re on Windows 10, adb may not working atm)
    6) When completed, select reboot.

    Last part : back to the ROOT

    Go to
    http://xdaforums.com/google-nexus-5/orig-development/nexus-5-cf-auto-root-t2507211
    and follow instruction to root again.

    Voilà ! Your phone is up to date, rooted & you didn't loose any personal data. :)
    3
    if we already losing root and custom recovery, wouldn't it simply much easier to edit the flash-all.bat , remove the -W from that line at the end and simply run it as if we're running a clean install ? I mean all we have to do is to get into bootloader and run that edited flash-all.bat file .
    We won't lose the data either