[Nexus 4 General] bgoel4132:
First of all i would like to thank [MENTION=4411844]Gigadroid[/MENTION] for his great contribution towards unbricking my device.

I encountered some things that i would like to mention i read those in several posts but no one replied to those so i would mention all those problems that other mentioned along with the solution i found.

These links might not work in many countries as in India i also tried using a vpn to download the links but that didn't came out to be that helpful so i found a tool to download mega.nz files, it is megadownloader and it works perfectly without any flaws so irecommend you all to use this tool.

If in near future links go down then you can search for mega downloader and you will surely find so.

Now i had trouble getting my device in download mode, so i found a easy solution to that which power off your device connect usb then first press volume up key and then the volume down key and hold the both for a while and bingo the download mode screeen pops up. The method mention by gigadroid worked for many but not for me so i figured it out hope it work for others too.

Till now the process mention by OP worked great and the imei number, mac address didn't wiped out for me.

Now the main problem begin for me which took mein 3 days to configure, getting the lost 8gb of our beloved nexus back.

now what if you get extra line along with it, actually i got 4 lines along with it, i searched the thread and found that i should pass a command

unmound /sdcard

after passing this command it flashed an error as my sd card was already unmounted, so what i did is ingnored that 4 lines and continued further but, that didn't help me get out of the situation as on passing

/dd if=/system/sgpt16G.img of=/dev/block/mmcblk0 bs=512 seek=30777311 conv=notrunc
/dd if=/system/pgpt16G.img of=/dev/block/mmcblk0 bs=512 seek=0 conv=notrunc
parted /dev/block/mmcblk0

i got an error that sgpt16G.img and pgpt16G.img can't be found.

So now what i did is i copied

these files from the extracted files of zip you downloaded earlier directly to the /system using ES file explorer

then i rebooted the device in the clockworld mod recovery mentioned in op

and passed the following commands in cmd

adb shell
mount /system
cp /system/dd /
chmod 755 /dd
umount /data
umount /cache

if till here it showed any error in unmonting data then chill your data is already unmounted, ignore this error command and proceed further.

Now type the following commands

/dd if=/system/sgpt16G.img of=/dev/block/mmcblk0 bs=512 seek=30777311 conv=notrunc
/dd if=/system/pgpt16G.img of=/dev/block/mmcblk0 bs=512 seek=0 conv=notrunc
parted /dev/block/mmcblk0

Then type p and press enter and the output should look like this:

# 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) p
p
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 15.8GB 14.1GB ext4 userdata
24 15.8GB 15.8GB 524kB DDR
25 15.8GB 15.8GB 507kB grow

Now in my case parted did reported an error so what i did is typed

fix

each time it asked for, now if you got out of the adb shell then type

adb shell
parted /dev/block/mmcblk0p

and bingo now your partition should appear the same as mentioned by OP.

Rest the process is same if you lost imei or mac address

i tried my level best to explain you all the errors i encountered hope it will solve the problem for many .

:):):)