[HOWTO] Nexus 4 Conversion from 8G to 16G of internal storage - AT&T LG Optimus G

This procedure is really dangerous so I have to warn that you can brick your phone. It directly modifies partition tables so if something goes wrong you may have a bricked phone. Do it at your own risk and I'm not responsible for any damage it may cause.
By following the procedure, you acknowledge and accept that the author is not liable for any loss, material or otherwise howsoever caused.
OK, you've been warned Now to the fun part.
This procedure does work but, please, follow it only if you are an advanced user or a developer.
It also has some unnecessary steps but I include them since they can help you to learn something.
Later, I might write an "update.zip" for cwm which automatically does all the work
This works only on top of the existing N4 8G conversion.
So if you're stock etc then you'll need to do N4 8G conversion first, that is to flash the tot listed in N4 conversion topic in LGNPST.
This is a link to the N4 conversion thread: http://forum.xda-developers.com/showthread.php?t=2099784
You also need cwm recovery installed. I did it in sk8's cwm touch recovery. So I suggest using it: http://forum.xda-developers.com/showthread.php?t=2010984
Also, you need an external sd card with at least 100MB(after doing all rom backups) of free space and I recommend to do a filesystem check of the sd card in windows/*nix/osx.
And another requirement is to have working adb and fastboot drivers for Nexus 4.
Before starting the procedure look through all the steps and please stop if you don't understand something. No rocket science here but it's just a dangerous thing to do.
- Download the following 3 files and copy them to your _external_ sd card root directory
Links:
Modified busybox dd : http://d-h.st/cFA
16G Primary GPT(includes MBR): http://d-h.st/yUQ
16G Secondary GPT: http://d-h.st/0dH
- if you care about the content of your internal sd card then back it up somewhere. After doing this conversion all your data and /sdcard will be purged.
- boot into cwm recovery.
- if you care about your current ROM/data do a backup to _external_ sd.
- connect the phone via USB to your pc and on your pc run 'adb shell'. Once in shell:
Code:
# cp /external_sd/dd /
# chmod 755 /dd
- Backup your existing partition tables. Make sure you put / in front of dd to use my modified dd
Code:
# /dd if=/dev/block/mmcblk0 of=/external_sd/pgpt8G.img bs=512 count=34
# /dd if=/dev/block/mmcblk0 of=/external_sd/sgpt8G.img bs=512 skip=30777311
- By default cwm mounts userdata and cache partitions. You need to unmount them
Code:
# umount /data
# umount /cache
- Make sure no partition from /dev/block/mmcblk0 is mounted. df should return only this with no extra rows:
Code:
# df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 911.7M 48.0K 911.6M 0% /dev
/dev/block/mmcblk1p1 59.4G 4.8G 54.6G 8% /external_sd
- Move content of DDR and grow partitions to their new locations. I doubt this step is required, but did it for safety. Seeking to the end of the mmc may take couple of minutes, don't freak out:
Code:
# /dd if=/dev/block/mmcblk0 of=/external_sd/DDR bs=512 skip=15267840 count=2015
# /dd if=/external_sd/DDR of=/dev/block/mmcblk0 bs=512 seek=30775296 conv=notrunc
- Install new partition tables. Seeking to the end of the mmc may take couple of minutes:
Code:
# /dd if=/external_sd/sgpt16G.img of=/dev/block/mmcblk0 bs=512 seek=30777311 conv=notrunc
# /dd if=/external_sd/pgpt16G.img of=/dev/block/mmcblk0 bs=512 seek=0 conv=notrunc
- At this point you have new partition tables installed. Verify this by running parted. You should see this:
Code:
# 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
(parted) quit
quit
Notice that userdata partition is 14.1GB in size
In case parted reports an error I suggest to return back to the old 8G partition tables, see below.
- Reboot the phone into bootloader: run reboot command and hold 'Up' button to enter bootloader menu
Code:
# reboot
- on your pc command line run:
Code:
fastboot erase userdata
fastboot -w
- In phone bootloader enter 'Recovery Mode' to load cwm
- In cwm restore your previous N4 rom from external sd or flash a new N4 rom
PS
In case parted reported an error, put the old 8G partition tables back. This should not happen but never say never:
Code:
# /dd if=/external_sd/sgpt8G.img of=/dev/block/mmcblk0 bs=512 seek=30777311 conv=notrunc
# /dd if=/external_sd/pgpt8G.img of=/dev/block/mmcblk0 bs=512 seek=0 conv=notrunc

reserved

Awww Look at the "community" sharing!!!

really easy process thank you!

This is the final straw for me, I'm gonna try the conversion tonight. Thanks a ton!

Damn, so was this the final problem with the conversion? Does this mean all the bugs have been worked out? If so, this is awfully tempting... haha

blenkows said:
Damn, so was this the final problem with the conversion? Does this mean all the bugs have been worked out? If so, this is awfully tempting... haha
Click to expand...
Click to collapse
For the most part, I think a few people still have issues with NFC, but I think that's just about ironed out too. Goodbye Quickmemo and Q-slide, I'll actually miss you!

Awesome work but I'll wait tell you make a update zip since I don't trust my computer have USB problems
Sent from my LG-E970 using xda premium

Right now I have the little voices in my head. The good guy is saying "NO DUDE! WAIT FOR AOSP! ITS JUST AROUND THE CORNER!". The other dude is saying "OMG JUST DO IT YOU WUSS!"

Mannnnnnn. Now I'm confused as to what I wanna do. Stock JB or convert? Great job. Looks good!
Sent from my LG Optimus G

Neroga said:
Mannnnnnn. Now I'm confused as to what I wanna do. Stock JB or convert? Great job. Looks good!
Sent from my LG Optimus G
Click to expand...
Click to collapse
More like Nexus 4 with SD card and LTE 4.2.2 or LGOG with 4.1.2?

xxgmon3yxx said:
More like Nexus 4 with SD card and LTE 4.2.2 or LGOG with 4.1.2?
Click to expand...
Click to collapse
You know, plus the millions of other possibilities that come along with a nexus.

C2fifield said:
You know, plus the millions of other possibilities that come along with a nexus.
Click to expand...
Click to collapse
No doubt... this phone will be supported for years to come! I'm never getting rid of it.

C2fifield said:
For the most part, I think a few people still have issues with NFC, but I think that's just about ironed out too. Goodbye Quickmemo and Q-slide, I'll actually miss you!
Click to expand...
Click to collapse
If NFC does not work for you, try to flash zip from the 'Notes' section of http://forum.xda-developers.com/showthread.php?p=37518694

Now can people accept the conversion lol so we can move on with our phones?
Sent from my LG-E970 using xda premium

blenkows said:
Right now I have the little voices in my head. The good guy is saying "NO DUDE! WAIT FOR AOSP! ITS JUST AROUND THE CORNER!". The other dude is saying "OMG JUST DO IT YOU WUSS!"
Click to expand...
Click to collapse
Haha, I feel you! I don't even trust myself with the conversion, though :/
But if a flash zip comes out, all hell might break loose!
Sent from my LG-E970 using xda app-developers app

TangoXray said:
Haha, I feel you! I don't even trust myself with the conversion, though :/
But if a flash zip comes out, all hell might break loose!
Sent from my LG-E970 using xda app-developers app
Click to expand...
Click to collapse
Just did it, it's all running smoothly, thanks again!

Seems to have worked here as well. Just restored my nandroid and its booting as we speak. And....... success. 12+ gigs of usable storage. Thanks a ton!!!!

thanks i just did it and works perfect

As I restore my backup, I have to wonder, why do we erase userdata and fastboot -w when a restore from backup works without a problem? Does the backup not look at the partition tables where booting straight up would and freeze up something?
Or is everything wiped from modifying the table and the fastboot part is just to make sure the partitions are empty?

Related

[Q] Backing up entire tablet partitions

I want to make sure I understand this. I know cwm will backup the OS, but what if I wanted to backup my entire nook? More specifically, what if I wanted to take a picture of my nook as when it was a fresh install. Here is my theory:
Code:
dd if=/dev/block/mmcblk0 of=/sdcard/backup.img
Will this work? Obviously I'd need an sdcard with a lot of storage, but will it backup everything so that, say, in the case all my tablet partitions get destroyed, I can just use dd to dump the img of the whole disk back onto the nook, and give me a squeaky clean nook? And how big would my sdcard have to be? at least 8gb? or at least 16gb? But yeah, my whole hypothesis behind this is to create a bootable sdcard that will do just that, backup everything from a complete stock, so that in the future if I messup my partitions, (like I did before), I can just dump images onto it, that will make it flawless.
At least I hope. Give me your thoughts. Thanks!
That would work, technically, but the CWM backup option does do a full backup AFAIK, at least, I have never had any issues with the backup missing something. Using dd is a way to ensure you get a bit for bit copy, I worry about size though. It has been a long time since I used that, if memory serves you get every bit even if that bit is free space. When I did this for backup on my Ubuntu box ages ago I had to run it through gzip or bzip2 to get the size reasonable. I'm not sure if that is possible on the Nook Tablet.
No is better if you backup partition one by one not the whole partition table. Anyways i don't recommend you to use dd as a "backup" method if there are other ways.
If you are looking for fresh install there are other ways to do it. like a normal standar user will do to "start-from-scratch" and root then boot into CWM from sdcard and backup your ROM. If you're advance user you will know how to pack it as a CWM flashable zip
I have a thread and use dd commands but for UNBRICK purposes not for "backup".
Be careful with what you do, just an advice.
~ Veronica
I would have to agree, I have personally also had issues restoring a partition table to a flash based device. You could end up with a useless backup.
Well, the reason I ask, is because for some weird reason, my partition table got corrupted. It was useless. i wish I would have backed up /rom. I got the serial number on the rom partition back, just not the mac address. but anyway, I had to clear the entire partition table and start anew. But I can't seem to get the partition table looking exactly like this:
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 16.3MB 15.7MB recovery
4 16.8MB 33.6MB 16.8MB boot
5 33.6MB 83.9MB 50.3MB fat32 rom
6 83.9MB 134MB 50.3MB fat32 bootdata
7 134MB 522MB 388MB ext4 factory
8 522MB 1164MB 642MB ext4 system
9 1164MB 1611MB 447MB ext4 cache
10 1611MB 2684MB 1074MB fat32 media
11 2684MB 15.6GB 12.9GB ext4 userdata
Click to expand...
Click to collapse
It never gets aligned correctly. And that's why xloader won't ever load. I can get into clockworkmod backup. But that's the reason why I want that backup of the table. Whatever type of table it is, you can't recreate it in gnuparted.
soshite said:
Well, the reason I ask, is because for some weird reason, my partition table got corrupted. It was useless. i wish I would have backed up /rom. I got the serial number on the rom partition back, just not the mac address. but anyway, I had to clear the entire partition table and start anew. But I can't seem to get the partition table looking exactly like this:
It never gets aligned correctly. And that's why xloader won't ever load. I can get into clockworkmod backup. But that's the reason why I want that backup of the table. Whatever type of table it is, you can't recreate it in gnuparted.
Click to expand...
Click to collapse
Actually you can recreate the partition table but that is very advanced.
About the command would be better:
Code:
# dd if=/dev/block/mmcblk0pX of=/sdcard/mmcblk0pX
* where X is a number 1 to 11 (partition #) but partitions 10 and 11 are media and userdata too big don't worry about those yet they can be recreated so backup from partition 1 to 9 better.
For big partitions like system, cache, factory, etc is better if you add bs=4096 at the end of the code:
Example: backing up SYSTEM partition
Code:
# dd if=/dev/block/mmcblk0p8 of=/sdcard/mmcblk0p8 bs=4096
INTERNAL PARTITIONS
xloader = mmcblk0p1
bootloader = mmcblk0p2
recovery = mmcblk0p3
boot = mmcblk0p4
rom = mmcblk0p5
bootdata = mmcblk0p6
factory = mmcblk0p7
system = mmcblk0p8
cache = mmcblk0p9
Click to expand...
Click to collapse
~ Veronica
lavero.burgos said:
Actually you can recreate the partition table but that is very advanced.
About the command would be better:
Code:
# dd if=/dev/block/mmcblk0pX of=/sdcard/mmcblk0pX
* where X is a number 1 to 11 (partition #) but partitions 10 and 11 are media and userdata too big don't worry about those yet they can be recreated so backup from partition 1 to 9 better.
For big partitions like system, cache, factory, etc is better if you add bs=4096 at the end of the code:
Example: backing up SYSTEM partition
Code:
# dd if=/dev/block/mmcblk0p8 of=/sdcard/mmcblk0p8 bs=4096
​
~ Veronica
Click to expand...
Click to collapse
How do you recreate the repartition table?
Code:
(parted) mklabel gpt
Because apparently Adam said it was different. But I dunno. I tried a gpt table. It didn't seem to work
soshite said:
How do you recreate the repartition table?
Code:
mklabel gpt
Because apparently Adam said it was different. But I dunno. I tried a gpt table. It didn't seem to work
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=1562130
... @meghd00t is the man for that, check last 2 pages of that thread.
If you really have f&%# up your device then that is your thread for support
~ Veronica
lavero.burgos said:
http://forum.xda-developers.com/showthread.php?t=1562130
... @meghd00t is the man for that
~ Veronica
Click to expand...
Click to collapse
Eh... I tried that one. It didn't seem to fix anything.. I know it said it fixed the partitions but it actually didn't do anything. I was pretty surprised.
But the strangest part is this:
Code:
3 524kB 16.3MB 15.7MB recovery
4 16.8MB 33.6MB 16.8MB boot
/recovery ends at 16.3mb and /boot starts at 16.8mb. And I can't recreate this at all. parted automatically places the boot partition at 16.3mb. Have any clue on that?
how did you "clear the entire partition table" ?
... so you're device is bricked right? and if you really wiped all the partitions you will need high level support.
A story of what exactly you have done so far will be helpful and i would suggest not to try anything else until you explain.
~ Veronica
lavero.burgos said:
how did you "clear the entire partition table" ?
... so you're device is bricked right? and if you really wiped all the partitions you will need high level support.
A story of what exactly you have done so far will be helpful and i would suggest not to try anything else until you explain.
~ Veronica
Click to expand...
Click to collapse
Part of it is on my dead nook topic:
http://forum.xda-developers.com/showthread.php?t=1597155
But then, my partition table was corrupt. It wouldn't work at all. So I made a new partition table in parted:
Code:
(parted) mklabel gpt
Which pretty much deleted everything. Which is what I wanted. But. It's hard to recreate the exact same partitions in parted. for example, MLO starts at 131kb and ends at 262kb. But when I make the partition:
Code:
(parted) mkpart primary () 131kb 262kb
** where () denotes unformatted filesystem
It says the file size is 132kb, whereas the xloader partition should actually be 131kb. How the heck does that happen? Because the xloader partition is meant to be super secure, then that partition doesn't pass consistency check. And if I make it end at 261kb, it still won't pass the consistency check.
I don't know what B&N did with their partition table. It really is a strange table.

[unbrick] - Fixing partition table, or completely dead nook

An Unbrick Guide for 16GB Tablet. I am not responsible for damage, otherwise this should fix any damage. But am more than happy to help.
meghd00t's 8GB and 16GB partition rescue sdcard: http://forum.xda-developers.com/showthread.php?t=1562130
For whatever reason the repartitioning card didn't work on my 16gb tablet, which is why I had to do it manually.
When to use this guide
1. If you used parted to remove your entire partitions and cannot recreate them in parted
2. If 1 is true, and you can't boot into Clockworkmod
3. If 2 is true and nothing will boot at all--the only exception being booting from the sd card--and it just won't turn on at all and get into any splash screen.
4. If everything else has failed
5. If all the above are true but you can boot Clockworkmod from an sd card. This is important.
If your nook will boot into cwm, then your partitions are fine. If you would like to, however, you can still use this to fix your nook, but I insist you try other methods around the development section before trying this one. This is a long process, and most other solutions for an otherwise dead nook can easily be solved, and a lot faster. This should only be used as a last resort. Otherwise if you just want to experiment around a bit, feel free!
------
Okay. So, visit Goncezilla's thread on making a bootable cwm-sd:
http://forum.xda-developers.com/showthread.php?t=1446987
Download the files on the first method ("METHOD 1- SDCARD")
Instead of a 50mb partition, just make a 2gb partition, make sure it's formatted to fat32 and enable boot, and lba flags. I reccommend at least a 2gb microsd. Anyways, unzip the files that are provided, but put them in the root folder of the sd card, not "SDCARD". Make a folder called blk.
Go to lavero.burgos' topic on "restoring partitions with dd":
http://forum.xda-developers.com/showthread.php?t=1570022
Download the provided files: mmcblk0p1, mmcblk0p2, mmcblk0p3, and mmcblk0p4. Place them in the "blk" folder.
Download the two files provided by meghd00t here:
http://forum.xda-developers.com/showpost.php?p=24805392&postcount=74
unpack gdisk and sgdisk to the root folder of the sdcard. unpack "scripts" into the same root folder of the sdcard. Don't worry about the mess. Now make sure your nook is off by pressing and holding the power button for like 15 seconds. Then, insert the the microsd card into your nook. Connect the cable to the nook and either to the wall adapter or to your box. Let it boot into cwm. Once in, open up a terminal. First thing you want to do:
Code:
$ adb start-server
$ adb devices
now make sure your device's serial number shows up, and that it shows your nook in recovery. Now, this next part is very important. VERY important. I wish I would have done this before. But even so, there is always hope!~ But still, make sure you follow this next step:
Code:
$ adb shell
~ # mount sdcard
~ # dd if=/dev/block/mmcblk0p5 of=/sdcard/blk/mmcblk0p5
This will backup your rom partition, which holds important information, like serial no. and MAC address. You'll be happy you did this before.
**Note, if it brings up an error, make sure the sdcard is mounted, try again, and cd over to /sdcard/blk to make sure that the rom partition is there safely. If it brings up an error and everything is mounted, try changing the extension name to "mmcblk0p5.img" when you use disk dump.
Optionally, it might be smart to backup the rom partition to your computer:
Code:
~ # exit
$ adb pull /sdcard/blk/mmcblk0p5 /path/to/backup
So now, you've got all the files you need. For the sake of argument, I'll assume you have made a cwm backup before your nook died. So, go ahead and destroy your nook completely:
Code:
~ # cd sdcard
/sdcard # ./sgdisk -Z /dev/block/mmcblk0
And now re-create it:
Code:
/sdcard # ./sgdisk /dev/block/mmcblk0 -a 256 -n 1:256:511 -n 0:0:1023 -n 0:0:31743 -n 0:0:65535 -n 0:0:163839 -n 0:0:262143 -n 0:0:1019903 -n 0:0:2273279 -n 0:0:3145727 -n 0:0:+12G -n 0:0:0
This is a lot easier than re-creating the partitions with parted by the way. I'd like to give a special shout out to meghd00t for compiling these static binaries for ARM. Thanks! This is a full stock partition, if you want meghd00t's 10gb media, 2.8gb userdata partitions:
Code:
/sdcard # ./sgdisk -c 1:xloader -c 2:bootloader -c 3:recovery -c 4:boot -c 5:rom -c 6:bootdata -c 7:factory -c 8:system -c 9:cache -c 10:media -c 11:userdata /dev/block/mmcblk0
Now follow up:
Code:
/sdcard # ./sgdisk -p /dev/block/mmcblk0
verify the list is correct. Now do this:
Code:
[b]/sdcard # cd /sdcard/sbin
/sdcard # ./genptable /tmp/genptable[/b]
This will create a partition table, the stock nook tablet modified gpt table in /tmp
Code:
/sdcard # mv /tmp/genptable /sdcard/blk
~ # dd if=/sdcard/blk/genptable of=/dev/block/mmcblk0
You now have your partition table back that will pass consistency checks! but we aren't done yet. We need to reformat everything:
Code:
/sdcard # cd sbin
/sdcard/sbin # ./mkdosfs -F 32 /dev/block/mmcblk0p5
/sdcard/sbin # ./mkdosfs -F 32 /dev/block/mmcblk0p6
/sdcard/sbin # ./mkdosfs -F 32 /dev/block/mmcblk0p10
/sdcard/sbin # cd ../../
~ # dd if=/sdcard/blk/mmcblk0p1 of=/dev/block/mmcblk0p1
~ # dd if=/sdcard/blk/mmcblk0p2 of=/dev/block/mmcblk0p2
~ # dd if=/sdcard/blk/mmcblk0p3 of=/dev/block/mmcblk0p3
~ # dd if=/sdcard/blk/mmcblk0p4 of=/dev/block/mmcblk0p4
~ # dd if=/sdcard/blk/mmcblk0p5 of=/dev/block/mmcblk0p5
Who just got their Serial number back. :]
Now this next part is confusing, but for some reason make_ext4fs didn't want to work for me, so I had to do it the painful way:
Code:
~ # parted /dev/block/mmcblk0
(parted) rm 7
(parted) rm 8
(parted) rm 9
(parted) rm 11
(parted) mkpartfs primary ext2 134MB 522MB
(parted) mkpartfs primary ext2 522MB 1164MB
(parted) mkpartfs primary ext2 1164MB 1611MB
Now the userdata partition all depends on how big you made your media partition. But I will go ahead and use the stock settings
Code:
(parted) mkpartfs primary ext2 2684MB 15.9GB
(parted) quit
~ # tune2fs -j /dev/block/mmcblk0p7
~ # e2fsck -fDp /dev/block/mmcblk0p7
~ # tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p7
~ # e2fsck -fDp /dev/block/mmcblk0p7
~
~ # tune2fs -j /dev/block/mmcblk0p8
~ # e2fsck -fDp /dev/block/mmcblk0p8
~ # tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p8
~ # e2fsck -fDp /dev/block/mmcblk0p8
~
~ # tune2fs -j /dev/block/mmcblk0p9
~ # e2fsck -fDp /dev/block/mmcblk0p9
~ # tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p9
~ # e2fsck -fDp /dev/block/mmcblk0p9
~
~ # tune2fs -j /dev/block/mmcblk0p11
~ # e2fsck -fDp /dev/block/mmcblk0p11
~ # tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p11
~ # e2fsck -fDp /dev/block/mmcblk0p11
~
~ # parted /dev/block/mmcblk0
[b]
(parted) name 7 factory
(parted) name 8 system
(parted) name 9 cache
(parted) name 11 userdata
[/b]
(parted) print
Now verify that your table looks like, or at least similar, to this. Basically, you want to make sure everything is formatted correctly:
Code:
Model: MMC 016G4A (sd/mmc)
Disk /dev/block/mmcblk0: 15.9GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 16.3MB 15.7MB recovery
4 16.8MB 33.6MB 16.8MB boot
5 33.6MB 83.9MB 50.3MB fat32 rom
6 83.9MB 134MB 50.3MB fat32 bootdata
7 134MB 522MB 388MB ext4 factory
8 522MB 1164MB 642MB ext4 system
9 1164MB 1611MB 447MB ext4 cache
10 1611MB 2684MB 1074MB fat32 media
11 2684MB 15.9GB 12.9GB ext4 userdata
If something looks a bit off, go back and repeat the appropriate step.
Code:
(parted) quit
~ # umount sdcard
~ # exit
Go ahead and shut down the device. Remove the sdcard, and turn it back on with the power button.
Status: xloader, bootloader, recovery, and boot partitions were all flashed and should be working perfectly. Which means you have probably noticed yourself booting into cwm, which is a good sign!!
Now, insert an sdcard that has your original cwm backup. And go ahead and restore your backup. Wipe /cache. Reboot the nook. You should see a splash screen. Dead nook... alive!11!
That's pretty much it. I'm just happy my nook is working. Hopefully this will help someone out who has a dead nook and has no clue how to fix it, like I did. If you have any questions, let me know so I can try to help. If you notice an error or inconsistency in my guide, please let me know so I can fix it before someone breaks their nook because of me. Sorry about reformatting the ext4 partitions guys. Since make_ext4fs wouldn't work for me, that was the only other way I knew how to do it. If someone can post what they did to reformat to ext4 using make_ext4fs, I'll edit the post to accomodate everyone else.
Thanks to: meghd00t, lavero.burgos, AdamOutler, tselling, and CelticWebSolutions.
Thanks for finding time to make this.
All i can say is Bravo!
We need more of this guides coming up.
2TU!
Nice guide.....
Sent from my Non-B&N Tablet running CM7
Very nice guide for dead nook, may i advice you to put a link for meghd00t recovery for 8GB NT so 8gb users work with the proper cwm recovery for them. I will be linking to this guide in my Unbrick thread.
Also would be good if you advice people to try alternative methods if they don't have dead dead nooks and with this i mean people that their boot block(s) is working and they have just flashed wrong recovery or flashed a rom that they should had not. This is advanced and if people have messed enough with their devices to competely wipe the partitions and more then im sure they will have fun with this .
Big thanks to meghd00t for build the tools and the cwm recovery for 8GB NT.
~ Veronica
lavero.burgos said:
Very nice guide for dead nook, may i advice you to put a link for meghd00t recovery for 8GB NT so 8gb users work with the proper cwm recovery for them. I will be linking to this guide in my Unbrick thread.
Also would be good if you advice people to try alternative methods if they don't have dead dead nooks and with this i mean people that their boot block(s) is working and they have just flashed wrong recovery or flashed a rom that they should had not. This is advanced and if people have messed enough with their devices to competely wipe the partitions and more then im sure they will have fun with this .
Big thanks to meghd00t for build the tools and the cwm recovery for 8GB NT.
~ Veronica
Click to expand...
Click to collapse
Thanks!
I did try to say when to use the guide at the beginning but I will be more specific most definitely, to make sure users don't get confused!
demetris_I said:
Thanks for finding time to make this.
All i can say is Bravo!
We need more of this guides coming up.
2TU!
Click to expand...
Click to collapse
It was kind of hard, because I couldn't remember where all the topics I used went to. Like Goncezilla's cwm sd files. I couldn't find them anywhere! I apologize for taking so long though. I'm really lazy...... not my greatest strength1!
Thank you though! I'm glad I finally figured it out1; :]
okey, so I get this error:
/sdcard # ./sgdisk -Z /dev/block/mmcblk0
/sbin/sh: ./sgdisk: not found
EDIT: never mind it didn't mount the sdcard had to restart the computer and nook then it worked.
EDIT2: now I got this error
/sdcard # /sdcard/sbin/genptable
Usage /sdcard/sbin/genptable <raw_output_file>
/sdcard # mv /tmp/genptable /sdcard/blk
mv: can't rename '/tmp/genptable': No such file or directory
Pete1612 said:
okey, so I get this error:
/sdcard # ./sgdisk -Z /dev/block/mmcblk0
/sbin/sh: ./sgdisk: not found
EDIT: never mind it didn't mount the sdcard had to restart the computer and nook then it worked.
EDIT2: now I got this error
/sdcard # /sdcard/sbin/genptable
Usage /sdcard/sbin/genptable <raw_output_file>
/sdcard # mv /tmp/genptable /sdcard/blk
mv: can't rename '/tmp/genptable': No such file or directory
Click to expand...
Click to collapse
Did you do the genptable script?
EDIT: Aw, son of a..!! I messed up, hang on, give me a second.
EDIT 2: oKAY, I fixed it. I'm sorry about that, my mistake. i bolded the text so you can see what I fixed.
okey that worked and now I get this if I do dd:
~ # dd if=/sdcard/blk/mmcblk0p1 /dev/block/mmcblk0p1
BusyBox v1.19.4-cm7 static (2012-02-04 22:27 +0100) multi-call binary.
Usage: dd [if=FILE] [of=FILE] [ibs=N] [obs=N] [bs=N] [count=N] [skip=N]
[seek=N] [conv=notrunc|noerror|sync|fsync]
Copy a file with converting and formatting
if=FILE Read from FILE instead of stdin
of=FILE Write to FILE instead of stdout
bs=N Read and write N bytes at a time
ibs=N Read N bytes at a time
obs=N Write N bytes at a time
count=N Copy only N input blocks
skip=N Skip N input blocks
seek=N Skip N output blocks
conv=notrunc Don't truncate output file
conv=noerror Continue after read errors
conv=sync Pad blocks with zeros
conv=fsync Physically write data out before finishing
Numbers may be suffixed by c (x1), w (x2), b (x512), kD (x1000), k (x1024),
MD (x1000000), M (x1048576), GD (x1000000000) or G (x1073741824)
EDIT: It has to be dd if=/sdcard/blk/mmcblk0p1 of=/dev/block/mmcblk0p1 you forgot the of=
EDIT2: mkpartfs primary ext2 2684GB 15.9GB I think the 2684GB is supposed to mean mb
EDIT3: so after doing your tutorial my partition table looks like this:
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 16.3MB 15.7MB recovery
4 16.3MB 33.6MB 17.3MB boot
5 33.6MB 83.9MB 50.3MB fat32 rom
6 83.9MB 134MB 50.3MB fat32 bootdata
7 134MB 522MB 388MB ext4
8 522MB 1164MB 642MB ext4
9 1164MB 1611MB 447MB ext4
10 1611MB 14.5GB 12.9GB fat32 media
11 14.5GB 15.9GB 1443MB ext4
as you can see a bunch of names for the partitions are missing, how can I name them
Pete1612 said:
EDIT: It has to be dd if=/sdcard/blk/mmcblk0p1 of=/dev/block/mmcblk0p1 you forgot the of=
Click to expand...
Click to collapse
Yeah, yeah laugh away. I always forget it, I'm just half dumb okay? <.<;
Pete1612 said:
EDIT2: mkpartfs primary ext2 2684GB 15.9GB I think the 2684GB is supposed to mean mb
Click to expand...
Click to collapse
The laughter doesn't stop. ;_;
Pete1612 said:
EDIT3: so after doing your tutorial my partition table looks like this:
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 16.3MB 15.7MB recovery
4 16.3MB 33.6MB 17.3MB boot
5 33.6MB 83.9MB 50.3MB fat32 rom
6 83.9MB 134MB 50.3MB fat32 bootdata
7 134MB 522MB 388MB ext4
8 522MB 1164MB 642MB ext4
9 1164MB 1611MB 447MB ext4
10 1611MB 14.5GB 12.9GB fat32 media
11 14.5GB 15.9GB 1443MB ext4
as you can see a bunch of names for the partitions are missing, how can I name them
Click to expand...
Click to collapse
Ooh. I forgot about that!!! Thanks for reminding me actually. You know, you've helped me with a lot of errors I've made. :l Just go back into parted and do this:
Code:
(parted) name 7 factory
(parted) name 8 system
(parted) name 9 cache
(parted) name 11 userdata
And that should do it. Go into cwm and either flash an old backup or one of the other roms.
By the way, while you're at it, do me a favour. When in clockworkmod, on the terminal, if you enter "adb devices" does it show your nook with your original serial number? This is the part I am most concerned apart. I want to make sure the serial number stays intact.
And I'm sorry for taking so long to respond. I was replacing my stupid laptop's old keyboard. It had broken shift and backspace keys. Which is probably why I seemed illiterate most of the time.
okey so I did adb devices and I only get zeros, the problem is though I couldn't pull partition 5 from my nook because the partition table was completely destroyed (and as far as I know partition 5 has the serial number and the mac adress in it)
EDIT: so I tried to install CM 7.2 which was succesfull. Then I rebooted my nook and it goes into CWM (internal).
EDIT2: just tried the recovery bootloop fix and it didn't help
Pete1612 said:
okey so I did adb devices and I only get zeros, the problem is though I couldn't pull partition 5 from my nook because the partition table was completely destroyed (and as far as I know partition 5 has the serial number and the mac adress in it)
EDIT: so I tried to install CM 7.2 which was succesfull. Then I rebooted my nook and it goes into CWM (internal).
EDIT2: just tried the recovery bootloop fix and it didn't help
Click to expand...
Click to collapse
Ok i know about this one and it might help. Flash stock 1.4.2 recovery and then run the stock 1.4.2 update.zip from sdcard. More info in my thread where it says ATTENTION 8GB USERS but works for 16GB aswell.
~ Veronica
Sent from my BNTV250A using xda premium
well and where can I find the stock recovery and the 1.4.2 ? the problem is, if this method doesn't work, am I still able to run CWM sd card?
Did you take out the microsd card? Dumb question but yeah.
Okay, I see the problem:
EDIT3: so after doing your tutorial my partition table looks like this:
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 16.3MB 15.7MB recovery
4 16.3MB 33.6MB 17.3MB boot
5 33.6MB 83.9MB 50.3MB fat32 rom
6 83.9MB 134MB 50.3MB fat32 bootdata
7 134MB 522MB 388MB ext4
8 522MB 1164MB 642MB ext4
9 1164MB 1611MB 447MB ext4
10 1611MB 14.5GB 12.9GB fat32 media
11 14.5GB 15.9GB 1443MB ext4
Click to expand...
Click to collapse
Boot is a secure partition that's supposed to start at 16.8mb not 16.3mb
Hmm...hmmm... Try doing "dd if=/sdcard/blk/genptable of=/dev/block/mmcblk0" one more time. And then repost your partition table.
Pete1612 said:
well and where can I find the stock recovery and the 1.4.2 ? the problem is, if this method doesn't work, am I still able to run CWM sd card?
Click to expand...
Click to collapse
Yes, you can still run CWM from sdcard. It's probably the best thing about the nook amirite.
okey I"ll do the bootpartition fix. I changed the micro sd card becuase my bootable sdcard couldn't safe all the mmcblk0px files...
Alrighty. Let me know what happens
nope it's still at the same place:
Model: MMC 016G4A (sd/mmc)
Disk /dev/block/mmcblk0: 15.9GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 16.3MB 15.7MB recovery
4 16.3MB 33.6MB 17.3MB boot
5 33.6MB 83.9MB 50.3MB fat32 rom
6 83.9MB 134MB 50.3MB fat32 bootdata
7 134MB 522MB 388MB ext4 factory
8 522MB 1164MB 642MB ext4 system
9 1164MB 1611MB 447MB ext4 cache
10 1611MB 14.5GB 12.9GB fat32 media
11 14.5GB 15.9GB 1443MB ext4 userdata
EDIT: can I redo the boot partition and if yes how ?
Pete1612 said:
nope it's still at the same place:
Model: MMC 016G4A (sd/mmc)
Disk /dev/block/mmcblk0: 15.9GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 16.3MB 15.7MB recovery
4 16.3MB 33.6MB 17.3MB boot
5 33.6MB 83.9MB 50.3MB fat32 rom
6 83.9MB 134MB 50.3MB fat32 bootdata
7 134MB 522MB 388MB ext4 factory
8 522MB 1164MB 642MB ext4 system
9 1164MB 1611MB 447MB ext4 cache
10 1611MB 14.5GB 12.9GB fat32 media
11 14.5GB 15.9GB 1443MB ext4 userdata
EDIT: can I redo the boot partition and if yes how ?
Click to expand...
Click to collapse
Hmm. You can't. Because parted will automatically revert it back to 16.3MB.
Try the process again, but this time dd genptable before you create the partitions, then create the partitions with sgdisk and let me know what it says.
what do you think about the Ubuntu total recovery before I do anything else ?

[Q] Missing mmcblk0p5 and can't download mmcblk0p8

Hi, Experts.
I am new to rooting and I think I screwed up my NB 16GB. I used ubuntu to connect into my NB and there is only /rom but no devconf folder. My serial number is now 0000000000000000. I am going through the steps of http://forum.xda-developers.com/showthread.php?t=1570022 but I can't download mmcblk0p8 and there is no mmcblk0p5. How can I get these 2 files? How do I know which mmc I need to restore? I can't even boot into CMW.
I can only boot to CM7 via sdcard. Is there any thread to guide me on how to recover via CM7 instead of ubuntu? Thanks.
Change to linear or full view and then you can download, i just checked and that works. I don't know why in grid view it wouldn't download but i guess is a bug in minus.com.
About mmcblk0p5 i moved it to another private folder and i will be giving the link only if needed that way i have more control of it. If you still need it the pm me and i'll give you the link.
Edit: I modified the folder's view to linear so now you can download.
~ Veronica
Now it says file does not exist
Hi, Veron.
Thanks for your reply. I tried but now it says file does not exist. I have problem previously with other files and I tried on IE, FF and Chrome. Only IE allows me to download but mmcblk0p8 is the only 1 I can't download with all browser.
ayoyo1001 said:
Hi, Veron.
Thanks for your reply. I tried but now it says file does not exist. I have problem previously with other files and I tried on IE, FF and Chrome. Only IE allows me to download but mmcblk0p8 is the only 1 I can't download with all browser.
Click to expand...
Click to collapse
Hmm thats weird because i changed the folder's view and clicked on download link of mmcblk0p8 and it started to download. Im using Ubuntu now with chromium but you should be able to. Clean your cache (Ccleaner recommended) and try again
~ Veronica
I still can't download mmcblk0p8. Is there a way for me to test which partition is corrupted and if I need mmcblk0p8? Maybe I just need to do some and not all.
ayoyo1001 said:
I still can't download mmcblk0p8. Is there a way for me to test which partition is corrupted and if I need mmcblk0p8? Maybe I just need to do some and not all.
Click to expand...
Click to collapse
Describe better your problem, what exactly you did that it got corrupted or bricked. Did you format some partitions in cwm? Or what?
~ Veronica
Sent from my SGH-I897 using xda premium
I am a novice in Android. I went into storage card, erase some of the partition. Now I can only boot into CM7. I can't boot into CWM. If I took out the CM7 sdcard, it will not start nor will not show the N logo. Taking out the card also no effect. It is just showing black screen. Even with usb plug/unplug also will not boot to CWM. Is there anyway to restore the partition from CM7 terminal emulator? Any commands? Using CM7 to restore seems like my last resort
I am from Singapore and I can't possibly do a return in USA.
Please post the parted outcome of print command to see what you have done to your mmcblk0.
ayoyo1001 said:
I am a novice in Android. I went into storage card, erase some of the partition. Now I can only boot into CM7. I can't boot into CWM. If I took out the CM7 sdcard, it will not start nor will not show the N logo. Taking out the card also no effect. It is just showing black screen. Even with usb plug/unplug also will not boot to CWM. Is there anyway to restore the partition from CM7 terminal emulator? Any commands? Using CM7 to restore seems like my last resort
I am from Singapore and I can't possibly do a return in USA.
Click to expand...
Click to collapse
I will help you out tomorrow/later may 7. if you can run CM7 from sdcard then you will be able to run cwm from sdcard as well.
~ Veronica
Sent from my SGH-I897 using xda premium
Thanks. Will wait for your great posting.
ayoyo1001 said:
Thanks. Will wait for your great posting.
Click to expand...
Click to collapse
I went into storage card, erase some of the partition
Click to expand...
Click to collapse
Can you explain better that, what OS were you running when you erased the partitions?
For now you have to start burning a cwm image from here to your scard. Why that version? because it was compiles with some useful tools in it that will help you unbrick your device.
Note: would be better if you have 2 sdcards.
Once you have cwm running from sdcard please go to this post, run parted, post the output of print and ignore the rest.
To be explicit i just need this output:
~ $ cd path-to-adb-drivers
~ $ adb shell
* daemon not running. starting it now on port xxxx *
* daemon started succesfully *
~ # parted /dev/block/mmcblk0
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
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? f
f
f
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 569312 blocks) or
continue with the current setting?
Fix/Ignore? f
f
f
Model: MMC SEM16G (sd/mmc)
Disk /dev/block/mmcblk0: 15.9GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 16.3MB 15.7MB recovery
4 16.8MB 33.6MB 16.8MB boot
5 33.6MB 83.9MB 50.3MB fat32 rom
6 83.9MB 134MB 50.3MB fat32 bootdata
7 134MB 522MB 388MB ext4 factory
8 522MB 1164MB 642MB ext4 system
9 1164MB 1611MB 447MB ext4 cache
10 1611MB 2684MB 1074MB fat32 media
11 2684MB 15.6GB 12.9GB ext4 userdata
Click to expand...
Click to collapse
... We take it from there.
~ Veronica
you mean the command below?
parted /dev/block/mmcblk0
I don't have the NT with me now. I will try out tonight when I reach home.
ayoyo1001 said:
you mean the command below?
parted /dev/block/mmcblk0
I don't have the NT with me now. I will try out tonight when I reach home.
Click to expand...
Click to collapse
read carefully and follow instructions , post what I have requested. the commands are the ones in bold
~ Veronica
Sent from my NookTablet using xda premium
Noted. I will do it tonight. Thanks.
Hi, here's the screenshots.
[email protected]:~/Downloads/android-sdk-linux/platform-tools$ sudo ./adb devices
[sudo] password for xda:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
0000000000000000 recovery
[email protected]:~/Downloads/android-sdk-linux/platform-tools$ ./adb shell
~ # 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
Warning: /dev/block/mmcblk0 contains GPT signatures, indicating that it has a
GPT table. However, it does not have a valid fake msdos partition table, as it
should. Perhaps it was corrupted -- possibly by a program that doesn't
understand GPT partition tables. Or perhaps you deleted the GPT table, and are
now using an msdos partition table. Is this a GPT partition table?
Yes/No? y
y
Model: MMC 016G4A (sd/mmc)
Disk /dev/block/mmcblk0: 15.9GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 16.3MB 15.7MB recovery
4 16.8MB 33.6MB 16.8MB boot
5 33.6MB 83.9MB 50.3MB rom
6 83.9MB 134MB 50.3MB bootdata
7 134MB 522MB 388MB factory
8 522MB 1164MB 642MB system
9 1164MB 1611MB 447MB cache
10 1611MB 2684MB 1074MB media
11 2684MB 15.6GB 12.9GB userdata
(parted)
Hope you find it useful. Thanks.
ayoyo1001 said:
Hi, here's the screenshots.
[email protected]:~/Downloads/android-sdk-linux/platform-tools$ sudo ./adb devices
[sudo] password for xda:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
0000000000000000 recovery
[email protected]:~/Downloads/android-sdk-linux/platform-tools$ ./adb shell
~ # 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
Warning: /dev/block/mmcblk0 contains GPT signatures, indicating that it has a
GPT table. However, it does not have a valid fake msdos partition table, as it
should. Perhaps it was corrupted -- possibly by a program that doesn't
understand GPT partition tables. Or perhaps you deleted the GPT table, and are
now using an msdos partition table. Is this a GPT partition table?
Yes/No? y
y
Model: MMC 016G4A (sd/mmc)
Disk /dev/block/mmcblk0: 15.9GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 16.3MB 15.7MB recovery
4 16.8MB 33.6MB 16.8MB boot
5 33.6MB 83.9MB 50.3MB rom
6 83.9MB 134MB 50.3MB bootdata
7 134MB 522MB 388MB factory
8 522MB 1164MB 642MB system
9 1164MB 1611MB 447MB cache
10 1611MB 2684MB 1074MB media
11 2684MB 15.6GB 12.9GB userdata
(parted)
Hope you find it useful. Thanks.
Click to expand...
Click to collapse
Hmmm oh well i don't know how you did this but your partitions does not have file system e.g fat32, ext4 format.
I assume you get 00000000000000 because rom partition got wiped as well and so your device has no serial ID to show up.
You'll have to use this method and after you fix it (hopefully that works right away) use this to have a serial ID again, i'll have to give you the link of my rom partition (mmcblk0p5) by pm as i keep it private and im giving the link only to the ones that need it by pm request. Let me know if you have any problem, post it and i'll see what i can do.
~ Veronica
I'm also new to rooting and I'm experiencing a similar issue with my NT. I derped up when using the instructions here to fix my nook's partition tables. Long story short, I thought I had backed up my mmcblk0p5 and well apparently it didn't save. When I reconnected my nook via adb my serial was all 0'ed out.
Any help? I think the only way to fix this massive derp is a copy of someone else's mmcblk0p5. If there are any other suggestions, I'm up for trying it...
UkeFox

[HOWTO] Convert your Optimus G to a Nexus 4 and Back

DISCLAIMER: THIS IS VERY DANGEROUS COMPARED TO A NORMAL ROM FLASH. DO NOT DO THIS IF YOU DON'T KNOW WHAT YOU'RE DOING OTHER THAN FLASHING ROMS.
IF SOMETHING GOES WRONG, YOU HAVE ONLY YOURSELF TO BLAME. YOU HAVE BEEN WARNED.[/B]
To convert to Nexus 4
First off, there are a few issues.
-SDCard doesn't work.
-Capacitive buttons aren't working. No known way to fix it.
First off, lets flash the N4 Rom.
1) Install LGNPST - Use tSilenzio's AutoLGNPST - http://www.oudhitsquad.com/android/LGE/Firmware/Tools/AutoLGNPST-tSilenzio.zip
2) Download the Nexus 4 Image - https://www.androidfilehost.com/?fid=9390248398092765463
3) Rename the extracted .tot file to a .bin file
4) Put the phone in Download mode. Volume Up + Volume Down While inserting USB cable.
5) Open LGNPST and select the phone - Should be Com[Number]
6) In the DLL section, select LGNPST_LS970.dll
7) In the file selection, select the previously renamed Nexus 4 bin file.
8) Start the flashing process and hold your breath.
9) When it hits 67%, your phone should start booting. DO NOT UNPLUG YET.
10) At 85%, an error will occur saying that the phone was unplugged. Ignore it and close LGNPST. The image is fully flashed.
11) Hold Volume Up + Power to put the phone into FASTBOOT mode.
12) Download the recovery from here and place it into your fastboot directory. - http://forum.xda-developers.com/showthread.php?t=2010984
13) Download the following 3 files and place them on the MicroSD card. - http://d-h.st/cFA - http://d-h.st/yUQ - http://d-h.st/0dH
14) While still in fastboot, type "fastboot boot recovery.img" - This will put the phone on the custom recovery. Make sure the SD card is in.
---Here, we're going to fix the partition tables for 16GB of space and replace the backup GPT so that we can't hardbrick from the backup GPT.
15) Run adb shell to get into a root shell in recovery.
16) Copy the modified DD onto the phone
Code:
# cp /external_sd/dd /
# chmod 755 /dd
17) Backup the partition tables incase something goes wrong.
Code:
# /dd if=/dev/block/mmcblk0 of=/external_sd/pgpt8G.img bs=512 count=34
# /dd if=/dev/block/mmcblk0 of=/external_sd/sgpt8G.img bs=512 skip=30777311
18) Unmount the filesystems so that you can overwrite the partition table.
Code:
# umount /data
# umount /cache
19) Make sure nothing is mounted. It should return this (Other than partition size):
Code:
# df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 911.7M 48.0K 911.6M 0% /dev
/dev/block/mmcblk1p1 59.4G 4.8G 54.6G 8% /external_sd
20) Move the partitions to their new locations. This may take a couple minutes.
Code:
# /dd if=/dev/block/mmcblk0 of=/external_sd/DDR bs=512 skip=15267840 count=2015
# /dd if=/external_sd/DDR of=/dev/block/mmcblk0 bs=512 seek=30775296 conv=notrunc
21) Install the new partition tables.
Code:
# /dd if=/external_sd/sgpt16G.img of=/dev/block/mmcblk0 bs=512 seek=30777311 conv=notrunc
# /dd if=/external_sd/pgpt16G.img of=/dev/block/mmcblk0 bs=512 seek=0 conv=notrunc
22) Make sure no errors occurred. Run 'parted /dev/block/mmcblk0' and check that it returns the same as the below.
Code:
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
23) If something different was returned, run the below code to restore the previous partition tables.
Code:
# /dd if=/external_sd/sgpt8G.img of=/dev/block/mmcblk0 bs=512 seek=30777311 conv=notrunc
# /dd if=/external_sd/pgpt8G.img of=/dev/block/mmcblk0 bs=512 seek=0 conv=notrunc
24) Exit the shell and type 'adb reboot bootloader' or reboot the phone while holding Volume Up.
25) Check that you're in fastboot mode and exit the following commands - This will fix the filesystem to take up the entire partition.
Code:
fastboot erase userdata
fastboot format userdata
fastboot -w
26) Boot the phone and update as needed. Then, put this on the phone and flash in recovery.
27) You are now working other than the SD card and Capacitive buttons.
Credits:
http://forum.xda-developers.com/showthread.php?t=2117576
http://forum.xda-developers.com/showthread.php?t=2099784
http://forum.xda-developers.com/showthread.php?t=2160124
http://forum.xda-developers.com/showthread.php?t=2146816
To convert from Nexus 4
This assumes that you have read the Convert to section.
1) Wipe the phone. Go into fastboot mode [Vol Up + Power] and execute the following commands. This is to prevent corrupted data partitions.
Code:
fastboot -w
fastboot format system
fastboot format userdata
fastboot format cache
fastboot format data
fastboot erase system
fastboot erase userdata
fastboot erase cache
fastboot erase data
2) LGNPST back to stock. You will do this twice to fix some issues.
To get into download mode, turn the phone off and hold Vol Up + Vol Down while inserting the USB cable.
3) Download these 2 images. Mar. 8, 2013 and Sept. 29, 2012
4) Flash the Mar. 8, 2013 firmware in LGNPST (See above for how to flash firmware in LGNPST. As before, the phone will start booting at 67% and LGNPST will show an error at 85%. Ignore the error and close LGNPST.
5) Restart the phone in download mode and now flash the Sept. 29, 2012 firmware. If you don't, your /SDCARD may be corrupted and you cant root.
6) Root the phone and unlock the bootloader. See here
7) If that doesn't work, try Teenybin.
8) Some partitions are broken. Go into CWM recovery and open an 'adb shell'.
9) Execute the following code. This will backup the broken partitions and wipe them.
Code:
dd if=/dev/block/mmcblk0p15 of=/sdcard/mmcblk0p15.bak
dd if=/dev/block/mmcblk0p16 of=/sdcard/mmcblk0p16.bak
dd if=/dev/block/mmcblk0p19 of=/sdcard/mmcblk0p19.bak
mke2fs -T ext4 /dev/block/mmcblk0p15
mke2fs -T ext4 /dev/block/mmcblk0p16
mke2fs -T ext4 /dev/block/mmcblk0p19
---You should now be back to stock--- LGNPST again if you want 'True Stock'
Let me know if you see anything wrong and please leave nasty comments at the door.
Ok, granted. This is more about recovering from flashing to Nexus 4 than about flashing to it. Basically, DON'T DO IT, as it doesn't seem to be worth it. We have AOSP and Cyanogen, etc.
I just posted this because I bought a phone that was flashed and went through hours of work fixing it.
Please read this before you think about flashing. http://forum.xda-developers.com/showpost.php?p=36735476&postcount=149
Its not worth it so much now but it was great when first released and it doesn't take that long to revert your phone. I went back and fourth like 5 times and my phone is fine. I think there is a low chance of your phone bricking as long as you follow instructions. The conversion is still a good option to have.
Sent from my LG Optimus G using XDA Premium 4 mobile app
Dr0!dFreek said:
Its not worth it so much now but it was great when first released and it doesn't take that long to revert your phone. I went back and fourth like 5 times and my phone is fine. I think there is a low chance of your phone bricking as long as you follow instructions. The conversion is still a good option to have.
Sent from my LG Optimus G using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Yeah, it seems nice to have the ability to do so, which is why I wrote the guide (and to give a single comprehensive guide that works).
It's nice to have a perfectly working KitKat rom the day its released, which is why I converted (When KK was released), but now, it doesn't seem worth it (We have AOSP). If you want MultiRom and franco kernel (Like I did), then its nice to have, but otherwise, most people don't need it.
alastair53 said:
13) Download the following 3 files and place them on the MicroSD card. - http://d-h.st/cFA - http://d-h.st/yUQ - http://d-h.st/0dH
Click to expand...
Click to collapse
Is this part SPYWARE? the 3 files downloads a exe and is detetected as virus or something.

Internal memory structure - what are those hidden partitions?

I've been digging around the memory of a 8Gb device, and have a couple of outputs, slightly edited for clarity (df and parted). See below.
Now, follow up questions:
1) there is significant mismatch in size between df and parted, is there some heavy error correction included in sizes reported by parted?
2) It seems that /cache is this large in order to store OTA updates. But if we are done with OTAs in order to keep root, should not one be able to shrink /cache, and add the space to /data even from within a working system (one could backup /data first, unmout it and /cache, resize both, etc) ?
3) with boot and recovery partitions, how does one boot into Amazon "recovery" then? Has this ever been discovered in terms of how to use it? I assume the regular boot happens from "boot" ?
4) cannot one just write custom recovery into "recovery" via a simple "dd" command ?
Thoughts?
Update: Of course, there is recovery mode! Pressing "Power" and "Volume up" buttons from off state will boot into a very limited Amazon recovery giving 2 options, Reboot, and Reset to factory defaults. So could not we jam something into that "recovery" partition, and try to boot it?
[email protected]:/ # df
df
Filesystem Size Used Free Blksize
/system 1.1G 1.1G 31.9M 4096
/cache 852.4M 1.2M 851.2M 4096
/data 5.0G 3.3G 1.7G 4096
/persistbackup 10.8M 196.0K 10.6M 4096
[email protected]:/ #parted /dev/block/mmcbkl0 print
Model: MMC SEM08G (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 32.8kB 164kB 131kB PRO_INFO
2 1049kB 5243kB 4194kB PMT
3 5243kB 10.5MB 5243kB TEE1
4 10.5MB 15.7MB 5243kB TEE2
5 15.7MB 16.3MB 524kB UBOOT
6 16.3MB 24.6MB 8389kB boot
7 24.6MB 33.0MB 8389kB recovery
8 33.0MB 34.1MB 1049kB KB
9 34.1MB 35.1MB 1049kB DKB
10 35.1MB 35.7MB 524kB MISC
11 35.7MB 52.4MB 16.8MB ext4 persisbackup
12 52.4MB 1311MB 1258MB ext4 system
13 1311MB 2233MB 923MB ext4 cache
14 2233MB 7808MB 5574MB ext4 userdata
bibikalka said:
2) It seems that /cache is this large in order to store OTA updates. But if we are done with OTAs in order to keep root, should not one be able to shrink /cache, and add the space to /data even from within a working system (one could backup /data first, unmout it and /cache, resize both, etc) ?
Click to expand...
Click to collapse
Thats highly dangerous. Unmounting /data while booted might cause an immediate reset. Not to sure. But messing with /cache and partition changes on a booted system is a HUGE risk
bibikalka said:
3) with boot and recovery partitions, how does one boot into Amazon "recovery" then? Has this ever been discovered in terms of how to use it? I assume the regular boot happens from "boot" ?
4) cannot one just write custom recovery into "recovery" via a simple "dd" command ?
Click to expand...
Click to collapse
Bootloader is locked.
If we got fastboot, could we use fastboot oem unlock? Or is that only for certian devices
ryanyz10 said:
If we got fastboot, could we use fastboot oem unlock? Or is that only for certian devices
Click to expand...
Click to collapse
And where would you get the oem unlock code? The fastboot is available, but so what ...
Btw, given how large and empty /cache is, one could use something like *Directory Bind* to redirect some of the app folders from /data to /cache.

Categories

Resources