[Nexus 7 Q&A, Help & Troubleshooting] GedBlake:
Hi, David_1276...

Thankfully you didn't flash over the bootloader partition, because if you had, you would have a hardbricked Nexus 7 on your hands!

So, going off your description, you've overwritten the boot partition and/or the recovery partition with something that is not valid for either of those two partitions.

The easiest fix would be to simply reflash the Nexus 7 back to official Google factory stock, using fastboot. And then (perhaps) start afresh rooting it and maybe have another attempt at flashing Lineage. But the first objective would be to just get it booting properly again.

I'm assuming your PC/laptop is running some variant of Windows (I've no idea how any of the following would work with an Apple Mac or on a Linux system), and further, that your Nexus 7's bootloader is unlocked, as indicated by an unlocked padlock symbol at the bottom of the white Google splash screen upon boot.

Google Factory Stock Images

So, to reflash it back to Google factory stock, you'll need to download a factory stock image, which can be found at this link...

Nexus 7 WiFi only

https://developers.google.com/android/images#nakasi

There are two ways you can flash a factory image... You can either: just run the flash-all.bat file, which is part of the factory image, once unzipped... or unzip it (twice), and then flash each partition individually...

eg., this kind of thing...

fastboot flash bootloader bootloader.img
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img

However, a note of caution...

If your Nexus 7's bootloader is already on v4.23, then I recommend you do not reflash it - reflashing the bootloader is the riskiest part of this procedure, 'cos should the flash fail in some way, eg. as a result of a dodgy USB connection for example, the bootloader could become corrupted and potentially hardbrick the device. The latest and last bootloader version is v4.23 and if your device is already displaying that version number in the bootloader

screen (lower left hand corner), there's really no point in reflashing it again. However, if the version number is lower than v4.23, then you will need to bring it up-to date. The risk isn't huge, and providing you don't nudge or disconnect the USB cable during the 5 seconds it takes to flash it, you should be OK - but if it can be avoided at all, then it should be.

*****

Custom Recovery ~ TWRP

Once you've successfully reflashed your Nexus 7 back to Google factory stock, and should you wish to root it again or flash a custom ROM such as Lineage, you'll first need to flash a custom recovery, such as TWRP. Since at this point you won't be rooted, you'll need to use fastboot for this.

You can find the download links (and instructions) for the Nexus 7 TWRP .img files at this link...

https://twrp.me/asus/asusnexus72012wifi.html

There are two download mirror links at this website, one for Europe and the other for America. Select the one that works best for you.

To flash TWRP, your Nexus 7 should be booted into fastboot mode, and from your laptop/PC, type this command...

fastboot flash recovery [name-of-twrp.img file]

I usually rename the rather lengthy TWRP .img file to something short, like twrp.img, so the fastboot command is much easier to type, and would look like this...

fastboot flash recovery twrp.img

*****

Fastboot and ADB

On the subject of fastboot, you'll need the fastboot and ADB binaries for all of the above... That is, if you haven't already got them on your computer.

You can get them from here...

https://www.xda-developers.com/google-releases-separate-adb-and-fastboot-binary-downloads

Unzip the file, and copy these binaries into a folder (eg., Fastboot and ADB tools) on your computer, somewhere on the desktop. Anything you wish to fastboot flash, such as a boot image or a custom recovery image, MUST go in the same folder as these binaries... unless you've added this folder to the Windows PATH variable, then it doesn't matter what folder .img files go in.

--------------------------------------

Well, I think I've covered much of the basics. Sorry I couldn't go into more details right now. There are two reasons for this. First, I haven't flashed anything on my own Nexus 7 for a couple of years, so I'm a little hazy about some of the specifics. The second reason is time - I never seem to have enough of it these days, and because of this, it maybe a few days before I can get around to answering any follow-up questions you may have. So please be patient if I don't immediately reply to you.

--------------------------------------

Anyway, have a read of some of the threads on this Nexus 7 forum which cover some of this stuff in more detail, and perhaps take a look at my own posting history regarding the Nexus 7. I always try to be as exhaustive as possible when responding to XDA members with questions not too dissimilar from yours, so you may be able to glean something that might fill in any blank spots I may have missed.

Good luck, and I hope you get your N7 up and running again soon:).

Rgrds,

Ged.

Edit & Additional...

Just remembered - I forgot to include some instructions on how to actually run fastboot commands...

With your Nexus 7 booted into the bootloader (from a powered off state - long press VOL-DOWN and simultaneously press POWER-ON), and connected to your computer, move the Windows mouse pointer over the folder which contains the Fastboot and ADB binaries, and which should also contain any .img files you wish to flash, such as TWRP... Press SHIFT and right mouse click at the same time, then select 'Open Command Prompt Here' from the context menu. A command prompt window should open, and from here you can run fastboot commands as described previously. It's probably a good idea to first run...

fastboot devices

This command doesn't actually do anything, except to confirm you have a working fastboot connection between your computer and your Nexus 7. It does this by displaying your Nexus 7's unique serial number, so something like this...

019d2424b14050b fastboot

If a serial number fails to appear, you likely have a Windows driver problem, and proceeding with further fastboot commands without resolving it would be pointless. Hopefully this won't happen - let me know if it does...