Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,742,650 Members 38,716 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
soshite
Old
(Last edited by soshite; 19th April 2012 at 07:15 AM.)
#1  
soshite's Avatar
Member - OP
Thanks Meter 26
Posts: 76
Join Date: Feb 2012
Location: Layton
Default [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/show....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/show....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/show....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/show...2&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:
Select 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:
Select 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:
Select 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:
Select Code
~ # cd sdcard
/sdcard # ./sgdisk -Z /dev/block/mmcblk0
And now re-create it:
Code:
Select 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:
Select 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:
Select Code
/sdcard # ./sgdisk -p /dev/block/mmcblk0
verify the list is correct. Now do this:
Code:
Select Code
/sdcard # cd /sdcard/sbin 
/sdcard # ./genptable /tmp/genptable
This will create a partition table, the stock nook tablet modified gpt table in /tmp
Code:
Select 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:
Select 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:
Select 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:
Select 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

(parted) name 7 factory
(parted) name 8 system
(parted) name 9 cache
(parted) name 11 userdata

(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:
Select 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:
Select 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.
The Following 11 Users Say Thank You to soshite For This Useful Post: [ Click to Expand ]
 
Demetris
Old
#2  
Demetris's Avatar
Recognized Developer
Thanks Meter 6162
Posts: 2,216
Join Date: Aug 2008
Location: Limassol

 
DONATE TO ME
Thanks for finding time to make this.
All i can say is Bravo!
We need more of this guides coming up.
2TU!
 
tmjohnsonfse
Old
#3  
tmjohnsonfse's Avatar
Senior Member
Thanks Meter 147
Posts: 351
Join Date: Dec 2011
Location: Dallas
Nice guide.....

Sent from my Non-B&N Tablet running CM7
The Following User Says Thank You to tmjohnsonfse For This Useful Post: [ Click to Expand ]
 
lavero.burgos
Old
(Last edited by lavero.burgos; 18th April 2012 at 06:51 PM.)
#4  
lavero.burgos's Avatar
Senior Member
Thanks Meter 1307
Posts: 2,509
Join Date: Mar 2011
Location: Guayaquil

 
DONATE TO ME
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
SG Captivate - PAC ROM 4.2.2 | SGS2X - CM10.1 4.2.2 | NOOK Tablet - CM10.1 4.2.2 |

If i helped you please hit
button -
Your files everywhere! Get dropbox 2GB+250mb free: http://db.tt/9DHo4Gi

VIDEO TUTORIALS
My XDA FTP Folder ~ GDrive Folder ~ My XDA Threads
The Following User Says Thank You to lavero.burgos For This Useful Post: [ Click to Expand ]
 
soshite
Old
#5  
soshite's Avatar
Member - OP
Thanks Meter 26
Posts: 76
Join Date: Feb 2012
Location: Layton
Quote:
Originally Posted by lavero.burgos View Post
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
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!
The Following User Says Thank You to soshite For This Useful Post: [ Click to Expand ]
 
soshite
Old
#6  
soshite's Avatar
Member - OP
Thanks Meter 26
Posts: 76
Join Date: Feb 2012
Location: Layton
Quote:
Originally Posted by demetris_I View Post
Thanks for finding time to make this.
All i can say is Bravo!
We need more of this guides coming up.
2TU!
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; :]
 
Pete1612
Old
(Last edited by Pete1612; 19th April 2012 at 01:14 AM.)
#7  
Senior Member
Thanks Meter 35
Posts: 228
Join Date: Feb 2011
Location: Kaufbeuren
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
 
soshite
Old
(Last edited by soshite; 19th April 2012 at 04:42 AM.)
#8  
soshite's Avatar
Member - OP
Thanks Meter 26
Posts: 76
Join Date: Feb 2012
Location: Layton
Quote:
Originally Posted by Pete1612 View Post
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
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.
 
Pete1612
Old
(Last edited by Pete1612; 19th April 2012 at 06:00 AM.)
#9  
Senior Member
Thanks Meter 35
Posts: 228
Join Date: Feb 2011
Location: Kaufbeuren
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
The Following User Says Thank You to Pete1612 For This Useful Post: [ Click to Expand ]
 
soshite
Old
(Last edited by soshite; 19th April 2012 at 07:16 AM.)
#10  
soshite's Avatar
Member - OP
Thanks Meter 26
Posts: 76
Join Date: Feb 2012
Location: Layton
Quote:
Originally Posted by Pete1612 View Post
EDIT: It has to be dd if=/sdcard/blk/mmcblk0p1 of=/dev/block/mmcblk0p1 you forgot the of=
Yeah, yeah laugh away. I always forget it, I'm just half dumb okay? <.<;
Quote:
Originally Posted by Pete1612 View Post
EDIT2: mkpartfs primary ext2 2684GB 15.9GB I think the 2684GB is supposed to mean mb
The laughter doesn't stop. ;_;
Quote:
Originally Posted by Pete1612 View Post
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
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:
Select 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.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes