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

First post here on XDA and I'm hoping someone with more experience than me will be able to give me a hand! Until last week or so, I was running an up-to-date version of Lollipop (5.1.1), when my tablet started randomly freezing up on me, requiring "soft resets" to get it going again, or simply shutting off on me. Thinking it was software related, I tried wiping the cache with no success, so ended up doing a full factory reset. The issues *seemed* to clear up for a day or so, but came back, and so figuring it was Lollipop related, I wiped out the OS and installed CM12.1 (which was my first experience working with ADB and fastboot, and first time installing a non-stock ROM) with a TWRP recovery. A few days later, the freezing and shutting down issues began popping up again, with the shutdowns *usually* happening during sleep, but the freezing happening at anytime from initial "Google" logo to boot animation, to the middle of running an app. I had made a backup on TWRP when I got CM12.1 configured the way I wanted it, so I performed a soft reset when it froze on me, and booted into the bootloader. The tab kept freezing in the TWRP window before I could select a restore, so out of desperation I tried just doing a factory reset from within TWRP. Long story short, something must have happened during that reset, because it kept hanging on the boot screen. I thought I may have unknowingly messed something up, so I tried downloading and flashing a stock KitKat (4.4) ROM from Google's site, but kept encountering bootloader errors during the flashing and ended up only being able to boot to the bootloader screen (apparently got a faulty 4.3 bootloader in that ROM, which gave me a headache until I was able to get straightened out). I have been able to get a stock bootloader (4.23) up and running now, along with a stock recovery (going with Lollipop now, so stock for LMY47V) going, but that's it. I've tried flashing the stock lollipop image via shell script (I'm running a Fedora 23 machine), via individual commands, and via "fastboot update -w factory_image.zip" without success. ADB sideload still works via recovery, but I wasn't able to sideload the OTA packages for 5.1 either. The common errors that pop up seem to indicate an error (corruption? fragmentation?) on the cache partition, but I'm not a dev when it comes to Android, so I'm at a loss here... I keep getting "E: failed to mount /cache (Invalid argument)", and other errors associated with accessing/opening files further down the /cache tree. Would this error be more likely to be a hardware issue, or would it be a software/firmware issue? I've had similar errors before with USB drives, when they would start to bad and partitions begin failing, but have always been able to rebuild them and get my data back. If something like this is happening on my N7 and the cache partition has indeed become somehow corrupted and failed (but not physically....), is it possible at all to rebuild partitions on Android in a similar manner? I've scoured the web, but haven't been able to find anything that can help me out with something like that, so I figured my best bet before condemning the N7 to the junk drawer was to see if any of the pros around here had any words of wisdom that *might* get me back up and running. Thoughts and advice much appreciated!!

Thanks!

(Oh, I apologize for the lengthy post, but I wanted to be sure to provide enough background info..... Sorry for the lengthy read!!)