yashsingh1/xdaforums huggingface dataset:
[Nexus 9 Q&A, Help & Troubleshooting] Ghnuberath:
Just fixed this issue.

I had essentially the same problem this morning. Nexus 9 5.0.2 OTA soft bricked my device, and I couldn't use fastboot to flash stock because I hadn't checked the "allow oem unlock" checkbox. Factory reset didn't seem to do anything because my recovery partition also appeared to be toast. Everything on my device was 100% stock.

I was also not able to use fastboot to erase cache or userdata because it would report the same "permission denied" error. However, placing the device into a verified state FIRST allows you to erase the cache and userdata. Then a factory reset via the bootloader worked.

# this places the device into "verified" mode.
fastboot oem verified
# you may have to go back into fastboot mode, since the previous command restarts the device
fastboot format userdata
fastboot format cache
fastboot oem lock
# then I went back into the bootloader again and did a factory reset
[Nexus 9 Q&A, Help & Troubleshooting] Winesnob:
I tried this just to see if it would actually work, and this is what I got:

>fastboot format cache

Creating filesystem with parameters:

Size: 268435456

Block size: 4096

Blocks per group: 32768

Inodes per group: 8192

Inode size: 256

Journal blocks: 1024

Label:

Blocks: 65536

Block groups: 2

Reserved block group size: 15

Created filesystem with 11/16384 inodes and 2089/65536 blocks

target reported max download size of 518205818 bytes

erasing 'cache'...

(bootloader) Device State : Locked

FAILED (remote: Can not erase any partition while device state is locked!)

finished. total time: 0.150s

Utter failure. Bootloader is locked, fully stock. Could be that having TWRP installed permitted execution of fastboot commands in a locked state, but being fully stock will not allow fastboot actions.
[Nexus 9 Q&A, Help & Troubleshooting] funkybside:
Just read through the entire thread and I'm unclear on a couple things:

If I check the "Enable OEM Unlock", proceed to fastboot OEM unlock, then accidentally un check the "Enable OEM Unlock" and ~do nothing else~ -> does that trigger a failure mode? Or do you have to both re-check "Enable OEM Unlock" in addition to something like "fastboot OEM lock" before you are screwed?

Alternately, I'm most certainly in the total android idiot column which is my way of saying I'm unclear if there are any actions that implicitly will relock the bootloader I should be aware of. For example, if I were to check "Enable OEM unlock", fastboot OEM unlock, factory reset? How about installing the new 5.1.1 nexus 9 factory image after unlocking? etc.

Just trying to educate myself a bit here and after hours and hours of reading here and elsewhere I'm confused on those points.
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
You can't accidentally relock your bootloader. It takes a conscious decision to boot to bootloader, then type "fastboot oem lock". I suspect that what happens in most cases is that something goes wrong with flashing process, owner panics, and starts trying to undo what they think they've done. Unlocking bootloader being one of those things.

So no, there is nothing you can do that will accidentally relock your bootloader. And don't relock it for any purpose except RMA.
[Nexus 9 Q&A, Help & Troubleshooting] funkybside:
Cheers, thanks man. The OP wasn't clear to me if the situation was "Do not (relock AND undo OEM Unlock checkbox)" as opposed to "(Don't Relock) OR (Don't undo OEM checkbox)"
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
Welcome. And FWIW, there's a button for that. ;)
[Nexus 9 Q&A, Help & Troubleshooting] benpage:
This Works

Thanks you so much. I was sure that I bricked the thing.

BTW if your userdata is formatted as f2fs, run this instead:

fastboot format cache
fastboot format:ext4 userdata
[Nexus 9 Q&A, Help & Troubleshooting] shahidhussain:
It worked. My tablet is saved :) Thanks a lot.
[Nexus 9 Q&A, Help & Troubleshooting] ChristianJay:
Never relock the boot loader. The only advantage apparently is security, but so long as your not laying the tablet around the break room at DARPA I think your alright.

There's way too many of these "now I'm ****ed" threads about this lately.
[Nexus 9 Q&A, Help & Troubleshooting] Dornakul:
This fix did not work out for me.

However, now I am not in a bootloop but booting never ends. The Google logo stays there all the time.

Very frustrating. Maybe this post will continue:

http://xdaforums.com/nexus-9/help/help-device-bootloop-bricked-factory-t3110038#post60808720

Is there a difference between erasing cash and userdata via fastboot than by bootloader?
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
I'm not sure I understand your question. The commands (fastboot format cache and fastboot format userdata) are entered via PC terminal when your device is booted to bootloader.
[Nexus 9 Q&A, Help & Troubleshooting] Dornakul:
Yes, I understand that is one difference. But my question is: Does it have a different effect on the device to do it one way or the other?

There are 3 ways for a factory reset:

1) within the Bootloader

2) with fastboot erase userdata

3) within recovery "wipe"

What is the difference?
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
I've never used 1), so I don't know. Do not use "fastboot erase useredata", it will mess with your partition. Instead, use "fastboot format userdata". As far as 3) goes, yes it is completely different; among other things, it does not wipe your SDcard.

If anything will work, it will be fastboot format userdata. Try it, you've got nothing to loose at this point.
[Nexus 9 Q&A, Help & Troubleshooting] Dornakul:
I already tried it. My last resort. But now, it is not even boot loop but eternal boot. Google logo forever.
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
Sorry to tell you, RMA.
[Nexus 9 Q&A, Help & Troubleshooting] Dornakul:
Sorry, I don't know what you mean with RMA.

Should I Send it back to Google?

I bought it at Google. Do you think they will accept that?
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
RMmA=Return Material Authorization

Yes, contact Google and request an RMA.
[Nexus 9 Q&A, Help & Troubleshooting] Dornakul:
And is flashing an ota file from a Google site a breach of warranty conditions?
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
Tell them you were trying to install the OTA and something went wrong. It's true, and there have been a lot of bricks from this, unfortunately.
[Nexus 9 Q&A, Help & Troubleshooting] Winesnob:
Shouldn't be. Google built the adb sideload function into stock recovery, usable without any device modifications.
[Nexus 9 Q&A, Help & Troubleshooting] Leoncino:
Hi all, i have a stock nexus 9, i want to root it so i need to unlock the bootloader, what i need to do?

Also, what i need to do if i want to relock it ( i don't want to brick my nexus, help me xD)
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
Go here, to start > http://xdaforums.com/nexus-9/general/guide-how-to-unlock-bootloader-flash-t3035153
[Nexus 9 Q&A, Help & Troubleshooting] Leoncino:
Thanks, it's a very good tutorial, i have also nexus root toolit, is it good to do this?
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
Toolkits are easy to use, and generally effective. But there's a danger with their use. If you don't understand how to use ADB and fastboot, then you are stranded when you run into a problem.
[Nexus 9 Q&A, Help & Troubleshooting] Leoncino:
i want to use your tutorial, i like adb commands, but the tutorial doesn't talk about relocking
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
I am not aware of any tutorial for relocking bootloader on Nexus 9.

Here is a tutorial on how to safely relock bootloader on Nexus 6. You could be the first to try it > http://xdaforums.com/nexus-6/general/guide-safely-lock-bootloader-android-5-1-t3067302
[Nexus 9 Q&A, Help & Troubleshooting] Leoncino:
well, thank you so much, i rooted my device and installed elementalx app, now i can control everythink and it's amazing. For now i don't want to lock the bootloder, i will do that only in the future and only if a really need to do it.

But i want to know a little think: now i have unlocked my bootloader and i can do everythink, but with a locked bootloader, if for some problem the device doesn't start, can i flash somethink like a factory image or the unlocked bootloader is always needed
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
No. If your bootloader is locked, you can not use fastboot to flash the factory image.

With a locked bootloader, the only thing you can do is ADB sideload an OTA (Over The Air update). And that will only work if you are 100% stock. No root, stock kernel, and stock recovery (and even then, the OTA installation often fails).
[Nexus 9 Q&A, Help & Troubleshooting] Leoncino:
Can i receive OTA updates with my rooted device?
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
No. To receive OTA you must be stock, no root, stock kernel, and stock recovery. BUT Google usually releases the factory image within 24 hours of an OTA, and you can then update via fastboot, and it doesn't matter if you are rooted or not.
[Nexus 9 Q&A, Help & Troubleshooting] Leoncino:
This is great :) thank you for your patience
[Nexus 9 Q&A, Help & Troubleshooting] Leoncino:
Sorry for the double post, i don't understand one think: Peole bricked their nexus because they relocked the bootloader and they weren't full stock or for somethink else?
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
That's a very good question. Unfortunately, I do not know the answer, for sure. With 5.1.1, Android has increased the security of the ROM, a lot. I would be reluctant to experiment with relocking, unless I had no choice, and had to return the device for warranty.
[Nexus 9 Q&A, Help & Troubleshooting] Leoncino:
i found a video on youtube where a guy relocks the bootlader using the toolkit, can i share the link here?
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
1st, this isn't my thread. I'm just a user like you. Secondly, I don't see why not... :D
[Nexus 9 Q&A, Help & Troubleshooting] JakeWhaneMurray:
I just did the exact same thing to my tablet.

Looking to flash the new Android M Software I erased everything off my Nexus 9. Then I was having some problems with flashing the stock Android M Preview and ended up relocking my boot loader... I was pretty optimistic about this and then I read this thread and now I feel sick to my stomach. Just got this tablet 4 months ago and Im 19 making minimum wage and saved up for a while to get this. I can't believe something as simple as not ticking an option in the settings can make something I saved up this much for a piece of garbage. If someone has a way around this please shoot it my way! I won't be getting much sleep tonight I guess. Thanks either way guys.
[Nexus 9 Q&A, Help & Troubleshooting] Leoncino:
Ok guys, i wrote this guide to help everyone wants to relock the bootloader, it worked for me

1)remove all protections (lock screen etc.)

2)remove your google account

3)do a factory reset

4)IMPORTANT, SKIP ALWAYS ALL THE INITIAL CONFIGURATION OF ANDROID

5)download nexus root toolkit and follow the guide to how to install drivers

6)boot into android and be sure that oem unlock is checked

7)select debug usb and connect your device

8)now, if you installed the drivers, select flash stock + unroot ( be sure that normal dev on is checked) (nexus toolkit will download the factory image, so wait), also check force flash mode and post flash recovery)

9)now boot into android and be sure that oem unlock is checked and check debug usb( if it didn't reboot after the factory image installation, simply select reboot)

10)IMPORTANT, SKIP ALWAYS ALL THE INITIAL CONFIGURATION OF ANDROID

11)now select oem lock

12)your device is now locked, skip all the initial configuration, uncheck oem unlock and do a factory reset

13)DONE

I tryed it with my device and it works, enjoy ;)

THE IMPORTANT THINKS ARE TWO: OEM UNLOCK MUST BE ALWAYS CHECKED AND YOU MUST BE FULL STOCK IN ORDER TO RELOCK THE BOOTLOADER

It worked for me and i had a rooted device ;)

i Think you can choice only one think between warranty and unlocked bootloader, this because if you have a damage (for exemple a problem with your screen) you can't check oem unlock so you can't relock safely the bootloader and, so, you can't use your warranty
[Nexus 9 Q&A, Help & Troubleshooting] EDGRAHAM2.0:
fix?

SO I take it there isnt a fix yet?
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
No, there is not.
[Nexus 9 Q&A, Help & Troubleshooting] GedBlake:
Hi, all...

Ok... I've just come across these three articles, which may or may not help fix this problem for those who have it...

Description of problem...

** The bootloader is locked...

** AND the Developer Options setting - 'OEM unlocking - allow the bootloader to be unlocked' is disabled...

** AND Android won't boot such that this setting can be enabled.

** Consequently, you can't fastboot flash anything, such as an official Google factory stock image, in the event of a bootloop (for example).

---

If nothing else, the third article sheds some light on the Android boot process and what exactly the bootloader does, in terms of security and device verification. I had no idea that the Android boot process was so complicated:).

---

1.)

http://www.androidpolice.com/2015/0...ands-and-cleaner-syntax-for-reboot-bootloader

2.)

http://www.ibtimes.co.uk/android-m-...-img-error-adds-new-flashing-commands-1506790

3.)

https://source.android.com/devices/tech/security/verifiedboot/verified-boot.html

---

These articles may only be applicable to those running the Android M Developer Preview, and not regular factory stock Lollipop...

Whichever version of Android you're currently running, I suspect you'll have to update to the latest version of Fastboot and ADB to avail yourself of these new commands.

---

Possibly the most interesting commands referenced in these articles, and vis-à-vis this thread, are these two...

fastboot flashing unlock

...and...

fastboot flashing unlock_critical

---

I'm uncertain exactly what these do, and how they differ from the more usual...

fastboot oem unlock

They may not provide any solution at all, but they're probably worth trying... should your bootloader be locked and Android won't boot in order to set that now infamous setting in Developer Options:(.

---

For tolerably obvious reasons (ie, I don't want to brick my device... again!:) ), I'm not inclined to test or experiment with these new fastboot commands. My bootloader is currently unlocked and it's staying unlocked!!! I went through all that crap back in November of last year, and once was enough. I have no desire to go through it again:).

---

Anyway, I hope this is of some use, and even of it doesn't help immediately, it might provide some pointers to those who have a better understanding of bootloader related stuff than I do.

Good luck everybody.

Rgrds,

Ged.
[Nexus 9 Q&A, Help & Troubleshooting] hatbrox:
Indeed this OEM Unlock flag is a security measure but in my view, rendering the tablet useless won't return it to its legitimate owner.

I have no firm belief on this but I have a preference to let the thieve access my phone, use it with a sim card and/or wifi so I can track it.

(note: I use avast to put a pin on each app I want to protect, so accessing the phone just give you access to mundane apps like browser, news...)

I use Cerberus, it's not perfect (you could indeed get rid of it by installing a new OS) but most thieves believe a factory reset is enough (but is not).

My phone never got stolen, but I did forget it in the train and in a bar once and Cerberus helped me found it (in one occasion, someone found it and kept it but I got it back with the help of the local police)

I feel that before the OEM Lock, you had a chance to find your phone but the thieves also have a chance to take full ownership.

after the OEM lock, I have no chance to find my phone and the thieves have no chance to take ownership. so both the thieves and me would have to buy a new phone.

If this feature was advertised loudly and all manufacturers use it, I guess it would deter thieves.

But since Google still can't force manufacturers to update all devices to Lollipop 5.1, this is going to take many years.

Caj
[Nexus 9 Q&A, Help & Troubleshooting] daign:
sadly joined this club somehow.

Flashed M preview for a week or so. Started getting the "device failed" red error and got concerned. I went into Wug's toolkit to reflash 5.1.1 and it said my bootloader was locked. No matter what I do I'm stuck in animation bootloop now...

I never enabled the unlock option in my dev options because it was already unlocked. If it aint broke don't fix it?

So did M Preview do some sort of encryption on the device where I had to enable that gui feature?

Device is totally bricked and I'm really bummed.
[Nexus 9 Q&A, Help & Troubleshooting] demkantor:
Not sure if anyone has found a fix yet, but my offer still stands to try and help find one. It looks as if there are many with this issue across multiple devices.

I'm not willing to test on any of my own devices for obvious reasons but if any of you all want to pm me we can try a few things out
[Nexus 9 Q&A, Help & Troubleshooting] gentoolkit:
I seems that I made a horrible double mistake... I was running Android M on my Nexus 6 with TWRP and a slightly modified system partition. I decided to go back to stock Android M but accidentally flashed wrong system and recovery images (I did the same thing to my Nexus 5 a few hours earlier and got confused...). Now the bootloader is locked and I'm in big trouble.

Has anyone sent their device for repair?
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
Wrong thread. If it's indeed a Nexus 6, and not a typo, go here > http://xdaforums.com/nexus-6/help
[Nexus 9 Q&A, Help & Troubleshooting] daign:
tried a forced flash in Nexus Root Toolkit v.2.0.5 again.... No go. I'm giving up in the meantime. Picked up a Tab S 10.5 in the meantime. At least Samsung devices can be recovered using ODIN. Can't believe googles own OEM tablet with development software would brick so many devices with no response yet....

heres my log
[Nexus 9 Q&A, Help & Troubleshooting] goti(0):
if you are able to get in to recovery then push any Rom you want to flash and flash through recovery it did work for me two times.... if you are not able to get in recovery then try using NRT to get in to recovery and from there you can flash the rom
[Nexus 9 Q&A, Help & Troubleshooting] temuri:
I've tried to sideload CyanogenMod zip file, but TWRP is still saying that "No OS is installed" and nothing boots... Any idea?
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
At the risk of stating the obvious:

When you say "sideload" do you mean you ADB pushed the .zip file from your PC? Or did you mount your N9 as an MTP device and transfer it from your PC?.

Did you see an indication from your PC/command prompt that transfer was successful?

If yes to the above, then did you go to "Install" on TWRP?
[Nexus 9 Q&A, Help & Troubleshooting] temuri:
Hi,

> When you say "sideload" do you mean you ADB pushed the .zip file from your PC?

I went to TWRP recovery, Advanced->Sideload and pushed CM zip file from PC with 'adb sideload cm.zip'.

> Or did you mount your N9 as an MTP device and transfer it from your PC?.

TWRP is telling me that device is connected as MTP. I cannot boot N9, so not sure what you mean by "mount" - it's simply connected with USB cable.

> Did you see an indication from your PC/command prompt that transfer was successful?

Yes, PC tells me that transfer was successful.

> If yes to the above, then did you go to "Install" on TWRP?[/QUOTE]

I'm guessing that your impression is that I've actually pushed CM.zip into /sdcard directory and simply forgot to go to "Install" and flash it.

However, once sideload is activated by TWRP, it is actually installing the received image. I'm getting this in TWRP:

[IMG="Locked bootloader, sideloading CM"]https://lh4.googleusercontent.com/t0EkZV0LdYvbOi3EkokhavBt5BmuMn8CepKe07Hlxqwq-244TWrqDY3UQY1wnqmFXNlI5ZEaIWnUceq3If7k8A=w1886-h935[/IMG]

Tapping 'Reboot System' reloads N9 and it's stuck on Google logo with red "This is a development device not intended for production use" above.

Is it completely bricked?

Thanks!
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
[MENTION=5378335]temuri[/MENTION],

At this point I would suggest that you try to ADB push the .zip file. Here's a short thread on how > http://xdaforums.com/showthread.php?t=1601802&page=4

After you are successful in pushing the file, click on "Install" button in TWRP and select this file.
[Nexus 9 Q&A, Help & Troubleshooting] temuri:
Thanks,

Did that... TWRP reported success, but booting is still stuck on Google logo with that red notice above.

:((
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
Did you do a factory reset in TWRP?
[Nexus 9 Q&A, Help & Troubleshooting] temuri:
TWRP offered to wipe cache, which I did. I also did Factory Reset from N9's HBOOT. It then rebooted, went into TWRP, ran something, rebooted again and got stuck on Google logo as before.

What does this all mean - what's the state of my N9? I can flash CM but cannot boot, so is it possible to fix that (considering that bootloader is now locked)?
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
I'm not sure.

What I would suggest is to ADB push a AOSP based ROM, that does not require a GAPPS package like this > http://xdaforums.com/nexus-9/development/rom-saosp-t3128041

Same steps. Factory reset, install, etc.
[Nexus 9 Q&A, Help & Troubleshooting] temuri:
Did that, all steps successful, still won't boot.

Looks like I can throw it out of the window now.
[Nexus 9 Q&A, Help & Troubleshooting] cam30era:
You have a couple of options:

1) Wait a couple of days and see if anyone else has any suggestions

2) Contact HTC and request a RMA

3) Sell it "as is" on eBay, with full disclosure of what's wrong. Believe it or not, it is worth something....
[Nexus 9 Q&A, Help & Troubleshooting] mbirth:
Shouldn't a nandroid backup from a working N9 work if you install system + boot + vendor partitions via TWRP? Or maybe TWRP can even read the boot.img and system.img from the factory image?
[Nexus 9 Q&A, Help & Troubleshooting] JedixJarf:
Add one to the list! Was trying to return to stock and bam, bootlooping and unable to run oem unlock due to not having dev option checked.
[Nexus 9 Q&A, Help & Troubleshooting] evancg:
I've been flashing roms since the days of the Captivate and Epic 4G, and I've never bricked a device.

I never bothered rooting or flashing my Nexus 9 when I first got it in January, and I don't think I ever unlocked the bootloader - never felt the need. I haven't used it much the last month or two, but the other day I started using it, saw an update available (to 5.0.2, I believe) and thinking nothing of it, updated.

Now I'm stuck at the bouncing balls. I've tried Factory Reset in fastboot, tried wiping data and cache in recovery, and haven't gotten anywhere. I get "Permission Denied" when trying to fastboot oem unlock. I've contacted HTC Support but I'm waiting to hear back.

Until then, based on this thread, am I SOL? Truly a simple, straight forward update fully bricked my tablet?? Or am I missing something?
[Nexus 9 Q&A, Help & Troubleshooting] daign:
my experience has been 100% identical. I am now on my 5th android tablet and forth Android phone and I have ROMed/hacked/unlocked and rooted each device. My brother in law even works at Google and I explained to him that I flashed a development version of there rom on my Nexus tablet and it bricked. The moment I tried to revert is the moment mine bricked. Stock bootloader. Developer options unlock bootloader checked.

Turns out mine is still under warranty I'm going to call htc Monday. In the meantime I bought a tab is 10.5 to get me by... Hell even my Nexus Player is running a full Android functionality and that's not something it was never meant to do
[Nexus 9 Q&A, Help & Troubleshooting] mrkrabs:
http://xdaforums.com/nexus-6/help/info-nexus-6-nexus-9-enable-oem-unlock-t3113539

we need someone with a unlocked nexus 9 (actually ticked in dev options) to run the command located in the OP given above