yashsingh1/xdaforums huggingface dataset:
[Nexus 6P General] sirxdroid:
Try flashing the latest full factory image. You will lose your user data but at least you will have a functional phone.

---------- Post added at 09:54 AM ---------- Previous post was at 09:47 AM ----------

Another thing that should go into the guide/FAQ: EFS Backup

I asked the question here: http://xdaforums.com/nexus-6p/help/efs-backup-t3245739
[Nexus 6P General] dmarden:
So with the updated files [MENTION=3355398]mrRobinson[/MENTION] posted, what would be the most streamlined way to update everything to MDB08M (normal root) from MBD08K (normal root).

I had given a quick shot to flashing the stock MDB08K boot.img and then flashing the update.zip in TWRP, but that didn't work based on keys. I am guessing some version of img file flashing from the full MDB08M zip as opposed to trying to flash the patch/update OTA stuff.

Thanks in advance.
[Nexus 6P General] sirxdroid:
I can tell you what I did to go from D to M without losing any data. K to M should be similar. I flashed by hand, from the stock M image:

- bootloader

- radio

- vendor

- system

- modified boot.img from K (have not tried the modified M boot.img there's a report above that it doesn't work)

- flash TWRP (may not have to do this if you already have it, just double-check it's the latest version)

- boot into TWRP recovery

- flash SuperSU and any other system apps you may need

- boot normally

- verify that SuperSU works, update hosts file if you use AdAway or similar, install Busybox and any other system apps you may be using

It sounds like a lot but I found it's pretty fast, the slowest part is downloading the stock image from Google.
[Nexus 6P General] Heisenberg:
You need to update your adb/fastboot.

No, I'll add this to the FAQ.

I'll add this to the guide and the FAQ.
[Nexus 6P General] carelockh:
I would like to at least say, thank you very much for taking the time to make this guide. It really helped a lot for someone like me who is a first time nexus user and never used adb/fastboot methods of unlocking etc.

It was confusing at first, but I took the time to read carefully each section and take my time.
[Nexus 6P General] zervic:
You said no it doesn't, but my question is... Do any of the steps you need to take to be able to do the OTA update (i.e. Post 2, #1) cause you to lose user data? I understand the OTA update itself won't cause you to lose data.
[Nexus 6P General] adrman:
There only way you'll lose data is if you flash userdata.img or format userdata.
[Nexus 6P General] techbeck:
How long should the first boot take after the device is unlocked and a custom recovery installed?
[Nexus 6P General] efrant:
No.
[Nexus 6P General] sirxdroid:
3-4 min. if that. If you are looking at the boot animation for a while, you're probably stuck.
[Nexus 6P General] techbeck:
Anyway to get unstuck without reverting back to stock?
[Nexus 6P General] sirxdroid:
Depends what you did :) You can usually flash system.img and boot.img from the factory image of the version you are running and at least get unstuck and not lose your user data.
[Nexus 6P General] efrant:
I would boot back into the bootloader and type:

fastboot format userdata

fastboot format cache

fastboot reboot

It will obviously wipe any data you had of course.
[Nexus 6P General] sirxdroid:
I'd start with just system and boot first if you care to preserve your user data. It's worth trying. From my experience it's usually a mismatch between boot and system due to attempts to install SuperSU, e.g. wrong boot.img from systemless su with SuperSU installed by TWRP.
[Nexus 6P General] techbeck:
Dont care care about losing data. New phone, nothing loaded yet.

Worked, kinda. Now I am getting repeated process errors when it starts...probably revert back to stock and try again
[Nexus 6P General] wayne8821212:
ADB not working

Hi Heisenberg,

Thanks for the wonderful tutorial! It brings back memories of my days with my HTC Rezound. For some reason, I got derailed with ADB on this specific phone. When I do the "adb devices" command it doesn't return the serial number. I get nothing on my windows 10 ASUS nor on my windows 10 Dell all in one. In contrast, it works fine with my old HTC Thunderbolt and HTC Evo ( I misplaced my Rezound but found its older siblings LOL): As you can see below, when I used my Nexus 6P, I get back no serial number but when I use my Thunderbolt, I get a serial number. I enabled USB debugging and have followed your instructions to the letter. I'm at a total loss! Any ideas? Thanks!

C:\SDK\android-sdk-windows\platform-tools>adb devices

List of devices attached

C:\SDK\android-sdk-windows\platform-tools>adb devices

List of devices attached

HT11YS000242 device
[Nexus 6P General] sirxdroid:
[MENTION=1976266]techbeck[/MENTION] - It's easiest to fully flash the latest stock image from Google then. You start from a well known state.
[Nexus 6P General] efrant:
That sound like your boot image is a different version than your ROM.
[Nexus 6P General] sirxdroid:
You probably need the latest drivers, adb and fastboot.

Drivers: https://dl-ssl.google.com//android/repository/latest_usb_driver_windows.zip

I don't know what the easiest way to get the latest adb and fastboot on Windows is without installing the full SDK, I'm sure there's some zip floating around.
[Nexus 6P General] stoneyb245:
usually on a rom, but still stock,rooted , unlocked per guide, and on elemental kernel..

and received a ota tonight, is it safe to accept this , without losing root or running into kernel issues? ..
[Nexus 6P General] techbeck:
Stock ROM. Angler mdb08k
[Nexus 6P General] sirxdroid:
Just flash the complete M image and be done with it.
[Nexus 6P General] efrant:
It won't work. OTA updates will only work on a completely stock device. If you try to install it, it will fail.
[Nexus 6P General] techbeck:
What I just did. Not attempting to root again.
[Nexus 6P General] sirxdroid:
You can accept it but I doubt it will install if you put SuperSU in /system. If you used systemless root it will most likely install but wipe your kernel (and root).

These frequent monthly updates from Google are going to be a pain if you are not pure stock unrooted.

We really need an overlay/union fs for /system and figure out if we can root without modifying the ramdisk (boot.img)

---------- Post added at 03:59 PM ---------- Previous post was at 03:57 PM ----------

Don't be afraid of rooting if you really need it. It's simple. If you are on M, use the *modified* boot.img from K and flash SuperSU 2.52 via TWRP and your are done. This guide is very good and it's being corrected and updated all the time, it's safe to follow.
[Nexus 6P General] zervic:
Thanks man. I actually realized that was the case once i looked at all of the contents of the factory image (i.e. userdata.img) and connected the dots. Thanks again for your help and the quick reply. And thanks to [MENTION=4153349]Heisenberg[/MENTION] as well!
[Nexus 6P General] letom:
I seem to have run into some problems, when I go into recovery I get the following message:

"Your device sotware cannot be checked for courrption..." I can still enter TWRP fine so is this a problem?

When I try and boot into the system I get:

"Your device is corrupt, it cannot be trusted and may not work properly"

I havne't done anything to the system files so not sure why I am getting this. All I've done is unlock the bootloader, install TWRP, and make a backup. Was I supposed to decrypt my nexus or something? I'm on the latest version of TWRP and thus assumed the How To Decrypt Your Data Partition section wasn't needed :S Also it doesn't seem to go past the google boot animation.
[Nexus 6P General] sirxdroid:
The warnings are normal. If the phone boots and works OK, don't worry about them. Custom ROMs and kernels will get rid of them some day.

And no, do not decrypt.
[Nexus 6P General] wayne8821212:
Latest drivers, adb and fastboot

Yep I got the latest versions first by going to this page http://developer.android.com/sdk/index.html#download and went to the bottom of the page for SDK Tools and downloaded the zip, extracted to C:SDK, then launched SDK manager and installed SDK and Platform tools (one was already installed I think it was SDK tools....maybe I should uninstall that one and reinstall), I also installed Android Support Library, Google USB Driver (under extras). Thanks!
[Nexus 6P General] letom:
Thanks, so it seems as though I can't boot into the device as its been stuck at the boot animation for the past 10 mins, is it worth be wiping dalvik and cache? Or am I going to have to retore factory image?
[Nexus 6P General] Heisenberg:
Sounds to me like you skipped something, probably flashing the modified boot.img.
[Nexus 6P General] sirxdroid:
Wiping caches won't help. It's most likely a mismatch between boot and system. This usually happens if you swipe in TWRP when it asks if you want root installed.

Flash boot.img and system.img from the stock factory image of the version you are running.
[Nexus 6P General] Heisenberg:
The warnings stress normal but if you can't boot you've skipped/forgotten something.
[Nexus 6P General] techbeck:
Thanks for the help everyone. Reverted back to stock, and phone rebooted correctly. Installed OTA before I rooted as well.
[Nexus 6P General] sirxdroid:
I forget exactly but I think the warnings are in fact red triangle errors when something is not right. The "normal" warnings are yellow triangles. So I think when you see red there's no point even trying to boot, something is not right, mismatch between boot and system. It only happened to me once so I don't recall all the details.

Next person who runs into it should take a picture so we can document it :)

---------- Post added at 04:35 PM ---------- Previous post was at 04:34 PM ----------

I think these devices are pretty hard to brick completely. Famous last words.
[Nexus 6P General] techbeck:
What happened was I unlocked, flashed TWRP and loaded TWRP. TWRP installed SU before I had a chance to install the boot.img for root. I just messed up is all. Live and learn,
[Nexus 6P General] techbeck:
These days. I remember the start of Android, many bricked devices. I never bricked a device, but I know people who have and there was a lot of post online for it
[Nexus 6P General] sirxdroid:
Yep. That's what happens when boot and system don't match. But it's an easy fix, all you have to do is just reflash system.img and/or boot.img, no need for a complete flash.
[Nexus 6P General] Heisenberg:
TWRP doesn't flash SuperSU automatically, you need to swipe to confirm that action. Anyway, if you flash TWRP again, then flash the boot.img before booting into TWRP you'll be fine.
[Nexus 6P General] techbeck:
I did the system/boot flash and was getting errors let and right when I loaded the OS. Just took a min or two longer to do a full revert back to stock.
[Nexus 6P General] sirxdroid:
Yes, Wi-Fi routers too. But manufacturers wised up, they got tired of piles of bricked returns so they made it harder to brick and easier to fix at home.
[Nexus 6P General] GSUS969:
I seem to be having some issues - I can't use the command "fastboot flashing unlock". It tells me "FAILED <remote: oem unlock is not allowed>"

Thoughts? Help?
[Nexus 6P General] techbeck:
Yea, I must have hit something since the 2nd time, SU didnt install when I launched TWRP. And thanks for the info. Will remember for next time.

---------- Post added at 01:41 AM ---------- Previous post was at 01:40 AM ----------

Are you already unlocked? Fastboot screen should state if it is locked or not.
[Nexus 6P General] sirxdroid:
That's the wrong version of SuperSU to flash anyway, I don't think it will work even with a modified boot.img. It would be better for TWRP to stop offering to install SuperSU if it detects Android M, until the devs figure out a simpler/better way to root. In the past it was fine because all you had to do is install SuperSU in /system. But today it also requires a modified boot.img which TWRP cannot provide, so it should stop trying to do anything for root. Just warn for now.

---------- Post added at 04:45 PM ---------- Previous post was at 04:44 PM ----------

Did you enable "OEM Unlock" in the Dev Options in the ROM?
[Nexus 6P General] techbeck:
I used the moded boot image the second time around
[Nexus 6P General] Heisenberg:
That's good, but don't use the version of SuperSU that TWRP offers to install for you add it isn't compatible, you need to use the beta version that I link to in the guide.
[Nexus 6P General] techbeck:
I didnt. I DLed the one you posted in the OP.
[Nexus 6P General] Heisenberg:
I found that when trying to use adb you must have the phone in PTP mode. Select the usb method from your notification area on your phone and change to PTP and it should work. We don't actually need adb to undertake any of the processes in this guide but that should hopefully get it working anyway.
[Nexus 6P General] Heisenberg:
Cool, so you're all good now?
[Nexus 6P General] pahlerc1:
So I have successfully unlocked the bootloader and installed TWRP 2.8.7.2.. I know unlocking it wiped data and I am currently booted back up and downloading all my apps... I was going through settings and noticed my device is still encrypted.. Do I need to go into TWRP and format data to decrypt it before making a nandroid backup? Trying to follow this guide step by step to make sure this is as easy as it can be! So far so good thanks for this guide it's very thorough and has helped a lot!
[Nexus 6P General] Heisenberg:
You don't need to remove encryption anymore, TWRP can decrypt on the fly now.
[Nexus 6P General] twitchdatweek:
Heisenberg,

Hopefully I'm just missing a key element in this process. When you say install TWRP recovery, are you referring to the app on the phone called TWRP Manager? If so, it says the version isn't supporting Marshmallow currently. I did download the .img file and flash it as you said in the first steps. I just seem to be lost on the backup part.

Thanks,

Jeremy
[Nexus 6P General] sirxdroid:
Perhaps we should remove any traces of encryption removal form the guide and just tell people to install the latest TWRP. I'd encourage everyone to keep encryption on.
[Nexus 6P General] Heisenberg:
No, you don't use TWRP Manager, you follow the guide as instructed and flash the image with fastboot. Which backup part are you referring to?

Whether or not you or I would encourage people to keep encryption doesn't matter, it's still something that people might want to do so I'm keeping it in the guide. There's a bold note at the beginning of that section letting everyone know that it isn't necessary so that should be enough.
[Nexus 6P General] wayne8821212:
Mode

Oh ok.....I actually tried all five modes including PTP without success but I will try again. As long as it is not needed maybe I'll leave it be for now. Thanks!
[Nexus 6P General] GSUS969:
I have now and it's working well! Thank you!
[Nexus 6P General] Heisenberg:
Ok I understand what you mean now. If you boot into the bootloader (hold power + volume down) you can use the volume keys to scroll through several options, one of them will be recovery mode, scroll to that and then use the power button to select it and the phone will boot into TWRP. If you'd like to boot directly into TWRP from Android there are some apps that can help with this, here's one:

https://play.google.com/store/apps/details?id=com.siriusapplications.quickboot
[Nexus 6P General] techbeck:
Yup...now just trying to remember how to set the phone to auto unlock after you enter the the pin
[Nexus 6P General] twitchdatweek:
Roger, now I'm more up to speed. Unfortunately, when I'm booting up like that, it goes through the first steps then shows "no command" with the andoird logo guy opened up. I'm fairly certain I'm still missing another key integral part thus far. Sorry I'm struggling.

Thanks,

Jeremy
[Nexus 6P General] Heisenberg:
Ok, this is happening after flashing TWRP? Which version of TWRP are you flashing?
[Nexus 6P General] Heisenberg:
Update!

I've added a Quick Tips section to the OP.

I'd also like to thank [MENTION=1566190]efrant[/MENTION] and [MENTION=4966885]sirxdroid[/MENTION] for taking time out of their days to help provide some support in this thread, it's greatly appreciated.
[Nexus 6P General] twitchdatweek:
twrp-2.8.7.2-angler.img was the file name. I just chose the top of the list (newsest version) from the link you put in the guide.

Thanks,

Jeremy
[Nexus 6P General] :
Great work man. We'll have the ultimate guide in no time!

The title of Step 9 had thrown me off a couple of times. I kept thinking this step is to return to stock, which it is, but I believe most will use this step as guide to update to newer firmware.Extend the title to say "how to flash a new firmware update". That would have helped me at least ☺.

If I may suggest also, you could add a step 9.0 with a example guide of how to prepare the phone before flashing new firmware. Things like how to disable adaway system files. Disable fingerprints and pins, backup, sync, etc.
[Nexus 6P General] letom:
So I went ahead and got the factory image file and followed the steps in the OP, i also checked the md5.

I'm in cmd and it seems to be stuck at vendor.img flash, should it take this long ie been about 10 mins and hasn't got to the line "target reported max download..."?

I'm quite worried now because if I can't even flash factory then is this near brick status? Is there a way of safely stopping it without bricking your device?

Edit: so its been about 25 mins and no signs of going anywhere :( any help from anyone would be really appreciated
[Nexus 6P General] techbeck:
Anyone having issues with making changes to system/app? Also, cannot get adaway to work. Says downloading of hosts file failed. I have root I know that since other root apps are working fine
[Nexus 6P General] 09eric09:
It's been a while since I installed these files on a computer, the android-sdk-windows folder is about 16 gb after installing everything, does this sound right? It seems like a lot from what I remember.
[Nexus 6P General] letom:
I feel like a massive over reacting noob, I needed to hit enter (which I didn't for the others), now everything's fine and I'm back in the phone. I'm going to try and do TWRP again and see how that goes :) Thanks
[Nexus 6P General] wayne8821212:
Fast Boot Devices

Unfortunately PTP mode didn't work for me either. Also when I booted into the bootloader and issued the "fastboot devices" command, nothing happens either. I think I have a dud LOL! I may move to my IMAC to see if that works.
[Nexus 6P General] Heisenberg:
And it won't boot into TWRP? It's booting into the stock recovery?

I'm edit the title of section 9, and I'm in the process of writing up a detailed section on preparing for and taking an OTA.

Adaway works fine for me. I haven't made any manual changes to /system/app so I can't comment on that.

Lol, oops! You're not the first and you won't be the last.

I'm probably not the best person to help troubleshoot Windows problems, I refuse to use it, I'm a Linux dude. The only reason I still dual boot Linux and Windows on my machine is for gaming, that's all I use Windows for. The beauty of using Linux in this situation is you don't need any drivers, just install the SDK and away you go.
[Nexus 6P General] dmd3746:
If we are on MDB08L can we use MDB08M boot img?
[Nexus 6P General] techbeck:
Odd, what version you using? I am using 3.1. Cannot get it to install/edit the hosts file
[Nexus 6P General] letom:
So I've tired to reinstall the TWRP and the exact same thing has happened, I've booted into reocvery fine made a backup then restarted device for it to then say the device is corrupt (red warning) and stay in boot animation. Just to note I succesfully booted into the system prior to flashing twrp so basically there's something I'm doing wrong

1. boot fine into system

2. rebooot into bootloader

3. flash recovery (which I redownloaded)

4. reboot bootloader

5. Make full back up

6. restart phone which leads to continued boot animation

The instructions mention to use md5 check for TWRP, does anyone know where I can get this as it doesn't seem to be on their website or in the thread. I'm going to download a version prior to see if that works.
[Nexus 6P General] Heisenberg:
I'm on 3.0 but I doubt whether that'd matter, if 3.0 works for me then 3.1 should work for you.
[Nexus 6P General] wayne8821212:
Linux

I'm probably not the best person to help troubleshoot Windows problems, I refuse to use it, I'm a Linux dude. The only reason I still dual boot Linux and Windows on my machine is for gaming, that's all I use Windows for. The beauty of using Linux in this situation is you don't need any drivers, just install the SDK and away you go.[/QUOTE]

I may have to try that .............I did install Unbuntu Mate on one of my older laptops. I don't have a clue what I'm doing but I'll do some reading.
[Nexus 6P General] Heisenberg:
Have you installed SuperSU? If so, did you flash the modified boot.img?
[Nexus 6P General] Heisenberg:
There are some great guides available on how to install Linux (I use Mint) alongside Windows, there's a fair bit of work to be done but I think it's worth it.
[Nexus 6P General] ckc90745:
hi sirxdroid I just wanted to let you know i was able to get my phone working I had to follow all the steps to unroot the phone from this guide, even though the phone was not rooted, weird I am just glad I got my phone working again I want to root it but I am afraid to mess up again, thanks for your help
[Nexus 6P General] techbeck:
Weird since mine is not working at all. I am rooted, I know that for sure. Any ideas?
[Nexus 6P General] letom:
Nope haven't even got to flashing SU yet, is this necessary to flash TWRP?. I'm on 6.0.0 (MDA89D) build if that's useful. I'm now updating to the latest though. It's so weird that its only after flashing TWRP that my phone become corrupted and doesn't boot.
[Nexus 6P General] Heisenberg:
I really don't know. I remember having some similar issues with Adaway ages ago and I had to repeatedly force close the app and try again which eventually got it working. That's all I got, sorry.

The modified boot.img isn't necessary for TWRP, but is for root. Are you sure you didn't accidentally swipe to install the SuperSU that TWRP offers you?

Don't be afraid to root, you probably just overlooked something, try again and be careful to follow every step.
[Nexus 6P General] coldconfession13:
What does flashing the vendor.img do? I think I forgot to flash that when I flashed the image. It's working just fine though
[Nexus 6P General] :
[MENTION=4153349]Heisenberg[/MENTION]

Thank you. Please make that guide you're working on to include a guide for people who want to flash instead of ota.

Only 1 efs backup is needed for life? Do it once and forget?

I read this guide which could maybe be posted in the op? http://xdaforums.com/showthread.php?t=2556671

What files (firmware images, mods?) do I need to check for integrity of the checksum? Do updates from Google's site have to be checked?

Can a scammer write a different checksum and call it the clean checksum? Or are the numbers randomized or something? In other words, how can I trust the dev that the checksum he wrote is legit?
[Nexus 6P General] Heisenberg:
One EFS backup should suffice

The guide you linked to doesn't really fall within the scope of this guide. And to be honest I don't think it's written very well.

You should check the md5 of anything that you're flashing to your device (where possible). An md5 isn't about trusting a dev, the entire function of checking an md5 is to verify the integrity of the data that you're downloading. An md5 is like a digital fingerprint of a file, usually a download page will list it, that way you can check the md5 of the downloaded file to make sure it matches the md5 listed on the download page. If it matches you can be sure that the file didn't get corrupted during the download, if even a single byte of information within the file changes the md5 will be completely different. So a dev doesn't write an md5 checksum, it's generated automatically depending on the contents of the file, there's no way to change the contents of the file without the md5 changing too.