Once you’ve updated the Nexus 5 to the latest LMY48B factory image on Android 5.1.1 Lollipop, you will have to gain root access on it again since the factory image wipes it away. I’ll show you how you can root the Nexus 5 on Android 5.1.1 Lollipop LMY48B firmware build number.
- You want to install the LMY48B factory image if you already have root access because updating from the official OTA can brick your device. Once done, follow this guide to gain the root access again.
- Only follow this guide for the Google Nexus 5 and no other Google Nexus device.
BEFORE WE BEGIN
- You do void the Nexus warranty by following the guide.
- You should enable the USB Debugging Mode. First, unlock the Developer Options by going to Settings > About Device > tap the build number 7 times. Now you can find the Developer Options from the Settings now and the USB Debugging is inside the Developer Options.
- Download the Google USB Drivers  to the Windows computer. If you find the guide isn’t working, try rebooting the computer to get those drivers to work and come back to the guide.
- You must unlock the Nexus 5 bootloader before you start this guide. There’s no way to do it with a locked bootloader.
HOW TO ROOT NEXUS 5 ON ANDROID 5.1.1 LOLLIPOP FACTORY IMAGE
- Download and install the Android SDK  from the official Developers website.
- You can set up ADB and Fastboot  on Windows following our guide. If you already have it, there’s no need to do it again.
- Download the SuperSU  you want to have from Chainfire.
- Transfer the SuperSU file over to the internal SD card storage on the Nexus 5 device.
- Download the ClockworkMod recovery  you want. Transfer the CWM file over to the same folder that you have the ADB.
- Completely power off the Nexus 5 by holding in the Power button.
- Boot the Nexus 5 up in Fastboot mode by pressing the Power and Volume Down buttons together and keeping them firmly held down until you see the menu.
- Open the folder where you have ADB and CWM and right-click the mouse while holding down the Shift key and choose to open the command windows here from the new menu.
- Now type this command: fastboot flash recovery recovery-clockwork-touch-22.214.171.124-hammerhead.img
- Now watch the new menu on the device change and choose the recovery option. Now you are entering the recovery mode.
- Choose the “flash zip from SD card” option, followed by choose zip from sdcard”.
- Browse for the SuperSU file you transferred earlier to the root of the storage and confirm to upload it.
- Once complete, navigate to the main menu in recovery and choose to reboot the system.
Congratulations! Now you have gained root access from inside recovery thanks to the SuperSU and you can flash a custom ROM again.