[Nexus 7 Q&A, Help & Troubleshooting] Narwhal73:
Hey all,

A little background: I was a little late to the Lollipop scene, and seeing as my phone wasn't getting an update anytime soon, I thought I'd crack out my ol' Nexus 7 2012 Wifi-edition. This thing was running an old version of Paranoid Android and was pretty slow and unreliable, I'd assumed I'd flashed a bad kernel or made some bad configurations or something. I very promptly downloaded the Lollipop factory image, fired up fastboot and wiped the device and attempted to flash the image.

It didn't work. I then assumed the image was bad, so I figured, as I had done in the past for KitKat, I'd download an older image and just accept the OTA. Once again the image refused to flash. It got stuck at the bootloader every time, but stubborn as I am, I tried yet an older image. flashing different versions of Jellybean, I discovered that my Nexus 7 wouldn't take any bootloader version higher than 4.18, and that if the bootloader did flash, the system.img would fail.

The procedure for flashing went as follows:

Download and extract nakasi gzipped tar images

cd into the folder containing an image

Run ./flash-all.sh, manually erase partitions and flash the zip, or extract the zip archive and manually erase partitions and flash the contained images

I noticed that the script wasn't working at all, so I took to manually flashing each image myself, and discovered that the issue usually occured with system.img and bootloader-group-x.xx.img

Looking for a solution to my problem. I'm running out of images to flash, and I have no way of transferring files to the tablet. I tried loading CWM so I could flash an unofficial image to get the thing booting, but I received errors when I tried to mount the USB storage.

Any and all help would be appreciated, I'm thinking this is a flash memory issue (i.e. one or more partitions is corrupt or formatted incorrectly), and I don't have the slightest clue how to fix it. Thanks!

EDIT: Errors and the actual process output are probably relevant.

Note that I run an Arch Linux box, but also tried the equivalent procedure using my other Windows 8.1 machine, to no avail.

Using the 4.3 jwr66y image as an example, this was the full manual process:

nakasi-jwr66y $ fastboot erase cache
******** Did you mean to fastboot format this partition?
erasing 'cache'...
OKAY [ 0.978s]
finished. total time: 0.978s
nakasi-jwr66y $ fastboot erase recovery
erasing 'recovery'...
OKAY [ 0.787s]
finished. total time: 0.787s
nakasi-jwr66y $ fastboot erase system
******** Did you mean to fastboot format this partition?
erasing 'system'...
OKAY [ 2.526s]
finished. total time: 2.526s
nakasi-jwr66y $ fastboot erase userdata
******** Did you mean to fastboot format this partition?
erasing 'userdata'...
OKAY [ 0.027s]
finished. total time: 0.027s
nakasi-jwr66y $ fastboot flash bootloader bootloader-grouper-4.23.img
sending 'bootloader' (2100 KB)...
OKAY [ 0.287s]
writing 'bootloader'...
FAILED (remote: (InvalidState))
finished. total time: 0.423s

Using the 4.1.2 image as an example, this was the full manual process:

nakasi-jzo54k $ fastboot erase boot
erasing 'boot'...
OKAY [ 1.125s]
finished. total time: 1.125s
nakasi-jzo54k $ fastboot erase cache
******** Did you mean to fastboot format this partition?
erasing 'cache'...
OKAY [ 0.633s]
finished. total time: 0.633s
nakasi-jzo54k $ fastboot erase recovery
erasing 'recovery'...
OKAY [ 0.601s]
finished. total time: 0.601s
nakasi-jzo54k $ fastboot erase system
******** Did you mean to fastboot format this partition?
erasing 'system'...
OKAY [ 2.526s]
finished. total time: 2.526s
nakasi-jzo54k $ fastboot erase userdata
******** Did you mean to fastboot format this partition?
erasing 'userdata'...
OKAY [ 0.027s]
finished. total time: 0.027s
nakasi-jzo54k $ fastboot flash bootloader bootloader-grouper-3.41.img
sending 'bootloader' (2092 KB)...
OKAY [ 0.286s]
writing 'bootloader'...
OKAY [ 9.212s]
finished. total time: 9.498s
nakasi-jzo54k $ fastboot reboot-bootloader
rebooting into bootloader...
OKAY [ 0.003s]
finished. total time: 0.808s
nakasi-jzo54k $ fastboot flash boot boot.img
sending 'boot' (4896 KB)...
OKAY [ 0.643s]
writing 'boot'...
OKAY [ 1.967s]
finished. total time: 2.610s
nakasi-jzo54k $ fastboot flash recovery recovery.img
sending 'recovery' (5240 KB)...
OKAY [ 0.699s]
writing 'recovery'...
OKAY [ 1.120s]
finished. total time: 1.819s
nakasi-jzo54k $ fastboot flash system system.img
erasing 'system'...
OKAY [ 2.608s]
sending 'system' (446268 KB)...
OKAY [ 58.787s]
writing 'system'...
FAILED (remote: (Unknown error code))
finished. total time: 63.412s

Flashing the 4.1.2 image produced another strange error where the tablet would continually output (in a loop) the phrase "Neither USP nor CAC partitions found" after the flash failed.

EDIT: I managed to successfully flash bootloader 4.23 from the KRT16S factory image, but I still can't get the system.img from any KitKat or Lollipop factory image to flash. I keep getting "FileWriteFailed" error messages. Anyone know how I can fix this?