[Nexus 7 (2013) General] xxxmadraxxx:
OK. So, not for the first time, LineageOS has managed to completely knacker my Nexus. It's too long and boring to go into in detail but, basically, the situation I'm left with is:

* I can access the device through fastboot

* I can boot TWRP through fastboot

* I can flash Boot & System images

However, I can't install TWRP [or any recovery] for that matter because it seems my Recovery partition has vanished. If I try to flash any Recovery, I get:

````

fastboot flash recovery /path/to/recovery.img

Sending 'recovery' (7598 KB) OKAY [ 0.280s]

Writing 'recovery' FAILED (remote: 'partition table doesn't exist')

````

Same with Data partition. When I boot into TWRP it's showing as 0mb. I've tried the usual tricks of formatting it [from TWRP and Fastboot] but I get 'unable to mount storage' or [from Fastboot] that 'partition table doesn't exist' message again.

I've also tried the trick of changing the format of Data from ext4 to ext2 and back. That just produces the 'unable to mount storage' error again and doesn't do anything.

I've also tried:

```

ls -al /dev/block/platform/msm_sdcc.1/by-name

```

and I don't even seem to have a [user]data or recovery partition any more:

````

__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!

drwxr-xr-x 2 root root 600 Jan 27 19:06 .

drwxr-xr-x 4 root root 680 Jan 27 19:06 ..

lrwxrwxrwx 1 root root 21 Jan 27 19:06 DDR -> /dev/block/mmcblk0p26

lrwxrwxrwx 1 root root 21 Jan 27 19:06 aboot -> /dev/block/mmcblk0p12

lrwxrwxrwx 1 root root 21 Jan 27 19:06 abootb -> /dev/block/mmcblk0p19

lrwxrwxrwx 1 root root 21 Jan 27 19:06 boot -> /dev/block/mmcblk0p14

lrwxrwxrwx 1 root root 21 Jan 27 19:06 cache -> /dev/block/mmcblk0p23

lrwxrwxrwx 1 root root 20 Jan 27 19:06 fsg -> /dev/block/mmcblk0p8

lrwxrwxrwx 1 root root 20 Jan 27 19:06 m9kefs1 -> /dev/block/mmcblk0p5

lrwxrwxrwx 1 root root 20 Jan 27 19:06 m9kefs2 -> /dev/block/mmcblk0p6

lrwxrwxrwx 1 root root 20 Jan 27 19:06 m9kefs3 -> /dev/block/mmcblk0p7

lrwxrwxrwx 1 root root 21 Jan 27 19:06 m9kefsc -> /dev/block/mmcblk0p28

lrwxrwxrwx 1 root root 21 Jan 27 19:06 metadata -> /dev/block/mmcblk0p29

lrwxrwxrwx 1 root root 21 Jan 27 19:06 misc -> /dev/block/mmcblk0p24

lrwxrwxrwx 1 root root 20 Jan 27 19:06 modemst1 -> /dev/block/mmcblk0p2

lrwxrwxrwx 1 root root 20 Jan 27 19:06 modemst2 -> /dev/block/mmcblk0p3

lrwxrwxrwx 1 root root 21 Jan 27 19:06 pad -> /dev/block/mmcblk0p16

lrwxrwxrwx 1 root root 20 Jan 27 19:06 persist -> /dev/block/mmcblk0p4

lrwxrwxrwx 1 root root 20 Jan 27 19:06 radio -> /dev/block/mmcblk0p1

lrwxrwxrwx 1 root root 21 Jan 27 19:06 rpm -> /dev/block/mmcblk0p13

lrwxrwxrwx 1 root root 21 Jan 27 19:06 rpmb -> /dev/block/mmcblk0p20

lrwxrwxrwx 1 root root 20 Jan 27 19:06 sbl1 -> /dev/block/mmcblk0p9

lrwxrwxrwx 1 root root 21 Jan 27 19:06 sbl2 -> /dev/block/mmcblk0p10

lrwxrwxrwx 1 root root 21 Jan 27 19:06 sbl2b -> /dev/block/mmcblk0p17

lrwxrwxrwx 1 root root 21 Jan 27 19:06 sbl3 -> /dev/block/mmcblk0p11

lrwxrwxrwx 1 root root 21 Jan 27 19:06 sbl3b -> /dev/block/mmcblk0p18

lrwxrwxrwx 1 root root 21 Jan 27 19:06 ssd -> /dev/block/mmcblk0p27

lrwxrwxrwx 1 root root 21 Jan 27 19:06 system -> /dev/block/mmcblk0p22

lrwxrwxrwx 1 root root 21 Jan 27 19:06 tz -> /dev/block/mmcblk0p15

lrwxrwxrwx 1 root root 21 Jan 27 19:06 tzb -> /dev/block/mmcblk0p21

````

So where can I go from here. Everything I've found online says to flash stock ROM or reflash stock recovery.... etc. etc.

But how can I flash anything when the partitions don't actually exist and I just get 'FAILED (remote: 'partition table doesn't exist')' if I try to do anything with any of those partitions?

Is there anyway I can completely wipe the partition table on the device and set it up again from scratch? I'm not worried about loss of data or anything else. I've everything backed up. But I just need to <somehow> recreate my /data partition [at least] so I can write to the damned thing.

BTW --I had the device repartitioned 'flox' and I believe that LineageOS has encrypted the /data partition, which is why TWRP can't see it. I've tried running 'decrypt' from TWRP but get a 'command not found' error. I understand that this is because the 'decrypt' command only works with TWRP actually installed on the device, not when remote booted via fastboot. And I can't install it on the device because I have no recovery partition!

Similarly, I can actually boot to stock system but am presented with a dialogue asking me to enter my password to decrypt the device. When I do so, I get a message saying [from memory] something along the lines of "The password you entered was correct but your data is corrupted" with a button to do a factory reset. However, when I hit this, the phone just reboots into fastboot again.

Apparently the fix for this is to have the stock recovery flashed, so the factory reset will work. But, again, I have no recovery partition so can't flash stock recovery!

I've been going round in circles with this all afternoon and am on the verge of taking a sledge-hammer to the damned thing. Please someone tell me there's a way to force repartition my Nexus so I can start from scratch again.