[AT&T LG Optimus G] dvhexer:
Secondary(or Backup) GPT is not used for keeping a copy of old Primary GPT when it's changed. So running lgnpst twice, 3 times etc will not make any difference.

Secondary GPT must be always in sync with Primary GPT, so it can be used in the case when Primary is corrupted.

Primary GPT is located at the beginning of the disk and Secondary GPT must be located at the very end of the disk so they can be easily located.

The problem with 8G Nexus hack is that it puts Secondary GPT at 8G offset of the disk and not at the end of the disk. And the old "stock" Secondary GPT remains untouched. So in case of corrupted Primary, "stock" Secondary GPT will be used since this is what's at the end of the disk.

Of cause getting tot file for Nexus 4 16G would be the best solution.

But it is also very easy to fix GPTs with 'parted' utility.

'parted' is included in cwm recoveries. I used this recovery: http://xdaforums.com/showthread.php?t=2010984 Thanks sk8erwitskil.

I was hesitant to do this, was afraid to corrupt GPTs but all went very well. (did this 3 times already)

WARNING: Don't try repeat this if you don't understand what you're doing. It went smooth for me, but if you decide to do this, I'm not responsible for any possible damage.

Boot your N4 converted E970 into cwm. Connect to PC via USB

On PC:

adb shell

# /sbin/parted /dev/block/mmcblk0

GNU Parted 1.8.8.1.179-aef3

Using /dev/block/mmcblk0

Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) print

print

Error: The backup GPT table is not at the end of the disk, as it should be.

This might mean that another operating system believes the disk is smaller.

Fix, by moving the backup to the end (and removing the old backup)?

Fix/Ignore/Cancel? Fix

Fix

Warning: Not all of the space available to /dev/block/mmcblk0 appears to be

used, you can fix the GPT to use all of the space (an extra 15507456 blocks) or

continue with the current setting?

Fix/Ignore? Fix

Fix

Model: MMC 016G92 (sd/mmc)

Disk /dev/block/mmcblk0: 15.8GB

Sector size (logical/physical): 512B/512B

Partition Table: gpt

Number Start End Size File system Name Flags

1 524kB 67.6MB 67.1MB fat16 modem

2 67.6MB 68.2MB 524kB sbl1

3 68.2MB 68.7MB 524kB sbl2

4 68.7MB 70.8MB 2097kB sbl3

5 70.8MB 71.3MB 524kB tz

6 71.3MB 94.4MB 23.1MB boot

7 94.4MB 117MB 23.1MB recovery

8 117MB 118MB 799kB m9kefs1

9 118MB 119MB 799kB m9kefs2

10 119MB 120MB 799kB m9kefs3

11 120MB 121MB 524kB rpm

12 121MB 121MB 524kB aboot

13 121MB 122MB 524kB sbl2b

14 122MB 124MB 2097kB sbl3b

15 124MB 124MB 524kB abootb

16 124MB 125MB 524kB rpmb

17 125MB 125MB 524kB tzb

18 125MB 126MB 524kB metadata

19 126MB 143MB 16.8MB misc

20 143MB 159MB 16.8MB ext4 persist

21 159MB 1040MB 881MB ext4 system

22 1040MB 1627MB 587MB ext4 cache

23 1627MB 7817MB 6190MB ext4 userdata

24 7817MB 7818MB 524kB DDR

25 7818MB 7818MB 507kB grow

(parted) quit

quit

~ # reboot

I did check both Primary and Secondary GPTs after this operation. They were correct, Secondary was at the end of MMC and both pointed to each other and contained same partition array.

So it should be safe to use Secondary GPT in case of corrupted Primary .

Now, there are 7GB of unused space. I would love to extend userdata instead of creating an additional partition, but there are DDR and grow partitions staying in the way..

grow has all zeroes, seems to be just a space filler.

DDR is full of some data.

Does anyone know what is the purpose of DDR partition? Can it be moved to the end of the disk?

Partition type GUID is: 2C86E742-745E-4FDD-BFD8-B6A7AC638772 which is the same as Nokia 920 SSD partition, but no clue about this one either.