[Nexus 6 Q&A, Help & Troubleshooting] paulmerrill:
Flashing New ROM and setting encryption off [Long]

I feel compelled to add this approach to flashing a Nexus 6 (shamu) to a new ROM with forced encryption off. I've spend about 2-3 days trying to sort this out with the help of the good people on the web. In addition, since I haven't seen this approach documented before I thought I would add to the collective wisdom.

NB - This worked for me but if it doesn't work for you, then I take no responsibility.

Requirements

1 x Nexus 6

1 x USB thumb drive with a dual USB 2.0 and micro USB connectors (http://www.verbatim.com/prod/flash-memory/usb-drives/everyday-usb-drives/dual-usb-flash-drive-for-otg-devices-sku-99138/ or equivalent.

Step 1

Backup your Nexus 6, this procedure will kill everything! You have been warned!

Step 2

Download your favourite ROM and Gapps. You MUST ensure that the ROM uses a kernel that does NOT set forced encryption TRUE. I know that the 8.1 release of Dirty Unicorns does not, I'm not sure about others. If you choose the wrong ROM, then on first boot the system will encrypt your phone and you'll need to go back to Step 1.

Once downloaded transfer the two zip files to the USB drive.

Step 3

Download the latest version of TWRP to your PC and rename the .img file recovery.img (you don't actually need to do this, I just prefer it that way).

Step 4

You need to have fastboot installed on your PC. If you don't have it, then search the web and you'll find you can download the program and drivers for the Nexus 6 pretty easily.

Step 5

Turn the Nexus 6 off that then restart in Bootloader mode (hold down volume down key and then power).

Plug the phone into your PC via a USB cable and run the following command from your PC

C:\> fastboot devices

You should see the serial number of your Nexus 6. If you don't then it may mean the PC drivers have not been installed properly. If you do see the serial number, then we are set to go. This is the point of no return!

C:\> fastboot format userdata
C:\> fastboot flash recovery recovery.img

The first line formats the userdata partition unencrypted, the second installs recovery.img which is the TWRP you renamed.

Step 6

Do not reboot into system as yet, you need to install the ROM and GAPPS.

Unplug the phone from your PC and plug in the USB key where you stored the ROM and GAPPS.

Toggle the volume key until you see Recovery, as you want to boot into recovery now.

Hit the Power key to select Reboot Recovery. This should cause TWRP to start.

Step 7

You need to select the micro SD storage key you have inserted, not the internal storage.

One you select it correctly, you will see the ROM zip file and the GAPPS zip file.

Flash the ROM file.

Flash the GAPPS file.

Clear cache.

Reboot to system.

Finish

That's it, the phone should reboot, the ROM will go through setup and your memory should be unencrypted. The speed difference is amazing, from 40-50MB/s in encrypted mode to 220MB/s in unencrypted mode (caching actually works!). You may not notice much difference until your battery gets low. Some (a lot?) of ROMs shut down 2 CPUs below 50% battery and I can tell you from experience that 2 CPUs + encryption is awful, the phone is unusable.