Search

Nexus 5 - Upgrade your Rooted Phone from Kitkat to Lollipop keeping all your Data

Contents[Hide]

dropcap-android-kitkat-rooted

nexus5-lollipopIf your Nexus 5 is rooted and using a custom recovery like TWRP, latest Lollipop OTA update will fail.

In fact, Google has changed its OTA update procedure. Instead of replacing thousand of files on the system partition, it replaces it has a binary structure. So, before replacing it, it checks that system partition is exactly as it is supposed to be. And if your phone is rooted ... this is not the case. So, OTA update procedure will refuse to execute.

But hopefully, with a little of effort, it is possible to smoothly upgrade without doing a factory reset. This guide explains how to upgrade your Nexus 5 from a rooted Kitkat to a rooted Lollipop while keeping all your data.

It is using Google developper tool fastboot and latest factory image published by Google. As it involves flashing a ROM, it is for advanced users only.

As a pre-requisite, you must have Android SDK or latest Android tools packages installed on your computer. A guide is available on the site for Debian and Ubuntu.

This procedure has been done from a Ubuntu Gnome 14.04 computer, but it should work on any computer with fastboot properly setup.

Before going further, you should do a complete backup of your phone with TWRP. Just in case ...

As this guide involves flashing a ROM, you need to know what you are doing. It is meant for advanced users only.
In case of major problem during the flashing process, which is very unlikely, a backup will be the only way to retrieve your data.
So, once again, make sure to have done a ROM backup.

1. Download factory image

First step is to recover latest Lollipop factory ROM for Nexus 5 from https://developers.google.com/.

At the time of this article, it was image LRX21O named hammerhead-lrx21o-factory-01315e08.tgz.

Extract this archive, open a console and go in the newly created hammerhead-lrx21o directory.

2. Flash factory image

The directory contains a flash-all.sh shell script that is supposed to do all the job ... but :

  • it fails as cache partition size is too small
  • it wipes all your data !

This script flashes different components in a specific order :

  1. bootloader
  2. radio
  3. Lollipop system partition
  4. boot partition

So, to be on the safe side and preserve our data, we will manually follow the same steps one by one but with some safe options without partition wipe.

Before starting, you should extract image-hammerhead-lrx21o.zip to your current directory. It will provide boot.img and system.img.

Once done, you should have these files in your current directory :

  • bootloader-hammerhead-hhz12d.img
  • radio-hammerhead-m8974a-2.0.50.2.21.img
  • system.img
  • boot.img

You are now ready to flash new Lollipop image. Please note that it is very important to reboot after flashing bootloader and radio ROM.


# fastboot flash bootloader bootloader-hammerhead-hhz12d.img
sending 'bootloader' (2579 KB)...
OKAY [ 0.295s]
writing 'bootloader'...
OKAY [ 0.480s]
finished. total time: 0.774s

# fastboot reboot-bootloader
rebooting into bootloader...
OKAY [ 0.056s]
finished. total time: 0.056s

# fastboot flash radio radio-hammerhead-m8974a-2.0.50.2.21.img
target reported max download size of 1073741824 bytes
sending 'radio' (45521 KB)...
OKAY [ 1.573s]
writing 'radio'...
OKAY [ 3.127s]
finished. total time: 4.700s

# fastboot reboot-bootloader
rebooting into bootloader...
OKAY [ 0.048s]
finished. total time: 0.048s

# sudo fastboot flash system system.img
target reported max download size of 1073741824 bytes
erasing 'system'...
OKAY [ 1.050s]
sending 'system' (981596 KB)...
OKAY [620.808s]
writing 'system'...
OKAY [ 66.789s]
finished. total time: 688.738s

# sudo fastboot flash boot boot.img
target reported max download size of 1073741824 bytes
sending 'boot' (8852 KB)...
OKAY [ 0.388s]
writing 'boot'...
OKAY [ 0.758s]
finished. total time: 1.146s

You can now restart your phone.

First boot will be very ... very long.

But, after few minutes, your Nexus 5 will be running an unrooted Lollipop with all your applications and data !

3. Root it Again

It is now time to re-root your Nexus 5.

Thanks to Chainfire, a new root procedure is already available for Nexus 5. But this procedure is very different from previous ones. You need to flash a temporary boot image that will patch you system partition with su.

You first need to download CF-Auto-Root-hammerhead-hammerhead-nexus5.zip and to extract the temporary boot image CF-Auto-Root-hammerhead-hammerhead-nexus5.img in Image sub-folder.

Make sure your Nexus 5 is in fastboot mode and run this command :

# fastboot boot CF-Auto-Root-hammerhead-hammerhead-nexus5.img

After rooting, your phone will automatically restart.

Your phone is now rooted, but you'll realize that your won't have any user interaction when SuperSU will ask for root access authorisation.

This can be corrected easily by installing latest SuperSU version from PlayStore. To do so :

  1. launch SuperSU
  2. select Settings / Reinstall - Cleanup for reinstallation from Play Store
  3. reboot your phone

Once done install SuperSU from Google Play and launch it.

At startup, it will ask for su binary update. Just validate Normal mode. You should get a sucess message.

Restart your phone once again ... this should be last time :-)

Your Nexus 5 is now running Lollipop and is fully rooted.

To finalise the procedure, it's time to install Busybox free from Google Play (if not already done) and to launch it to do a new Smart install.
This will recreate all the busybox symlinks that Lollipop installation has removed.

Your phone is now ready for a new life !

 android-nexus5-lollipop-rooted

 

Hope it helps.

Signature Technoblog

This article is published "as is", without any warranty that it will work for your specific need.
If you think this article needs some complement, or simply if you think it saved you lots of time & trouble,
just let me know at This email address is being protected from spambots. You need JavaScript enabled to view it.. Cheers !

icon linux icon debian icon apache icon mysql icon php icon piwik icon googleplus