Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,734,168 Members 50,667 Now Online
XDA Developers Android and Mobile Development Forum

[UNBRICK] Repartition, Reformat, Restore and Rescue SDcard

Tip us?
 
meghd00t
Old
(Last edited by meghd00t; 7th September 2012 at 09:08 AM.) Reason: add link to sd image; rework with new method; removed obsolete info rehosed the files at devhost
#1  
Senior Member - OP
Thanks Meter 138
Posts: 112
Join Date: Jul 2011
Location: Bangalore
Default [UNBRICK] Repartition, Reformat, Restore and Rescue SDcard

OK, I had used the flashing_boot.img posted here to repartition my nook. However someone in that thread found it difficult to create a ext3 partition to add the necessary files

So here is a linux shell script to create that image with B&N Stock 1.4.2 that you can use to re partition and restore your nook tablet it will work on both 8 and 16GB versions. It will format all partitions and force you to unrooted stock 1.4.2

files are at devhost now

http://d-h.st/users/meghd00t/

It is better for you to make your own image, the script has been amended to download the files if they are missing in the current directory.

Instructions to use.
download the attached mkrepartimg.sh.gz
gunzip mkrepartimg.sh.gz
chmod 755 mkrepartimg.sh
if you already have 1.4.2 update put it in the same folder
ubuntu users check if you have kpartx installed
apt-get update && apt-get install kpartx
sudo ./mkrepartimg.sh
this will download the necessary files and create the repart.img
write the repart.img to a sdcard with dd
power off the nook completely (hold power button for 30 sec)
insert the SD card you made into the nook
force boot from USB -
either boot with n and power, wait until it turns on and off then boot normally
or
power off completely and power on by connecting usb cable to PC or charger

screen will show 3 red x and after some time it will show a green check
now remove the sd card, reboot and allow it to do the factory restore.
and you are done.

Windows users go here - http://forum.xda-developers.com/show....php?t=1663836

I have had a few questions about the size of media partition.

You can change it very easily with sgdisk which was in my myrecovery.img and also in succulents CM 7.2 cwm images I have attached a script to download and make a suitable cwm image which you can run and then dd onto a sdcard boot into that cwm and issue these commands in a adb shell

for further details read this

Code:
sgdisk -e /dev/block/platform/mmci-omap-hs.1/mmcblk0
This will write the secondary gpt label and remove the parted prompt found error fix?

Code:
sgdisk /dev/block/platform/mmci-omap-hs.1/mmcblk0 -d 11 -d 10
first delete partition 10 & 11 media and userdata

Code:
sgdisk /dev/block/platform/mmci-omap-hs.1/mmcblk0 -n 0:0:+12G -n 0:0:0
sgdisk /dev/block/platform/mmci-omap-hs.1/mmcblk0 -c 10:media -c 11:userdata
now create both with the size you need for media (change +12G to whatever) and userdata will use the rest. and set the name of the partition

After that trigger a factory reset and that will format the partitions again or if you are already running something else first take a nandroid backup in cwm before you change the partitions and format these two in adb like this

Code:
mkdosfs -F32 -n MyNook /dev/block/mmcblk0p10
make_ext4fs -L userdata /dev/block/mmcblk0p11
again you will need my myrecovery cwm or succulents cwm these are the only ones with make_ext4fs

after formatting you can restore your nandroid backup


PS
No questions in PM please. I will not respond.


MLO - b&n 1.4.2
u-boot.bin - b&n 1.4.2
cyanoboot - http://forum.xda-developers.com/show....php?t=1522226
boot - clockworkmod http://forum.xda-developers.com/show....php?t=1466583
altboot - b&n flashing_boot.img modified http://forum.xda-developers.com/show....php?t=1554039


credits
fattire for cyanoboot
loglud for the page on hacking the kernel & boot.img
Indirect for the clockworkmod
AdamOutler for the ubuntu restore and the idea
jmeyerhead for the b&n flashing_boot.img
tselling for the partition hacks
succulent for sharing the device tree and answering all my questions on building a recovery and finally accepting all the patches.

and all the others on xda who have shrared all their knowledge and ideas that made this possible

PROs
simple no adb required
follows B&N partition table properly
keeps the Nook serial and other Information
works with all 8GB & 16GB tablets

CONs
inflexible about the 1.4.2 upgrade (otherwise no 8GB support)

You will get whatever B&N standard partition table is allowed for you device. Adam Outler suggested that I don't deviate from the B&N standard to keep the unbrick safe
Attached Files
File Type: gz mkrepartimg.sh.gz - [Click for QR Code] (812 Bytes, 535 views)
File Type: gz mkcwmimg.sh.gz - [Click for QR Code] (735 Bytes, 311 views)
The Following 18 Users Say Thank You to meghd00t For This Useful Post: [ Click to Expand ]
 
Kirk_the_jerk
Old
(Last edited by Kirk_the_jerk; 24th March 2012 at 07:06 PM.)
#2  
Junior Member
Thanks Meter 0
Posts: 11
Join Date: Dec 2011
This is a great idea but I can't get it to go after multiple tries (different SD cards, different boot methods, etc). I suspect it may have to do with how the SD card is being formatted; is there a trick to this?

Edit: Do I need stock recovery & not CWM?
 
Thibor69
Old
#3  
Thibor69's Avatar
Senior Member
Thanks Meter 169
Posts: 706
Join Date: Feb 2010
Location: Scottsdale - AZ

 
DONATE TO ME
Quote:
Originally Posted by meghd00t View Post
so to simplify matters for all those who have bricked their nook here is my solution

.....STUFF SNIPPED.....

Format SDCARD < 2GB, Fat32 LBA Boot
copy the contents of this sdcard/ directory on to the root of the card
How do we do this step ?? I mean I know you want us to format our SDCARD 2GB or bigger as Fat32 LBA Boot. BUT How do you go about doing that ?? What do you use ??? ADB ? DOS/Win ?

Thanks !

TRANSFORMER INFiNiTY CROMBi--KK [CM11][KK] 4.4.4
SAMSUNG GALAXY TAB 3 10.1" PiMP DROiD [JB] 4.2.2
GALAXY S4 TMOBILE M919 GNF1 SiCKNESS ROM V.1 . [JB] 4.4.2

 
CRE
Old
#4  
CRE's Avatar
Senior Member
Thanks Meter 48
Posts: 284
Join Date: Feb 2008
Quote:
Originally Posted by Thibor69 View Post
How do we do this step ?? I mean I know you want us to format our SDCARD 2GB or bigger as Fat32 LBA Boot. BUT How do you go about doing that ?? What do you use ??? ADB ? DOS/Win ?

Thanks !
Unfortunately, I can only tell you how to set it for boot and LBA in Linux or with a GParted Live disc. You may be able to do it with "Parted" via ADB. I'll try it and post back shortly.
Nook Tablet 16GB. Running CM10 PURE AOSP 4.1.2 JBV01-Hashcode
Repartitioned with the complete SD image found here.

T-Mobile HD2 w/ ICS
The Following User Says Thank You to CRE For This Useful Post: [ Click to Expand ]
 
Pete1612
Old
#5  
Senior Member
Thanks Meter 35
Posts: 228
Join Date: Feb 2011
Location: Kaufbeuren
my linux doesn't want to recorgnize adb when I'm in clockworkmod
 
CRE
Old
(Last edited by CRE; 25th March 2012 at 05:36 AM.)
#6  
CRE's Avatar
Senior Member
Thanks Meter 48
Posts: 284
Join Date: Feb 2008
If you're in Linux just use GParted to format the card and set the flags once the volume is created.



For those running Windows you can do this via ADB (I have to boot CWM and then go into ADB for Parted to work). This comes up often but I couldn't find a how-to on it to link to... kind of surprising that it wasn't already out there.

Format your sd card first... just personal preference so I can be sure the empty disk I'm looking when in parted is the one I want to adjust.

Open CMD as Administrator

(Type and execute what's written in blue below. Read comments in parenthesis but don't type them.)
parted /dev/block/mmcblk1
print
(verify that the disk listed is the correct one, there should only be 1 partition #1 it should be FAT32)
set 1 boot on
set 1 LBA on
print
(look at the right under "flags" to be sure that "boot" and "LBA" are now set.)
quit

exit ADB as usual or continue as needed.


EDIT: Oh and SDCARD < 2GB means 2GB or smaller. You may have issues trying to use a card larger (this includes larger cards which are partitioned smaller).
Nook Tablet 16GB. Running CM10 PURE AOSP 4.1.2 JBV01-Hashcode
Repartitioned with the complete SD image found here.

T-Mobile HD2 w/ ICS
The Following 2 Users Say Thank You to CRE For This Useful Post: [ Click to Expand ]
 
meghd00t
Old
(Last edited by meghd00t; 25th March 2012 at 06:18 AM.) Reason: add the image file
#7  
Senior Member - OP
Thanks Meter 138
Posts: 112
Join Date: Jul 2011
Location: Bangalore
Ok here is a sdcard image that you should be able to use with dd or win32diskimager to make the sdcard. This will work on any card 512MB or larger. I have made a 500MB partition and added the necessary files, you will still have to add the factory.zip (b&n 1.4.2 update)

http://dl.dropbox.com/u/64885133/meghd00t-r4.zip

and

http://dl.dropbox.com/u/64885133/meghd00tr4-sdimg.zip
The Following User Says Thank You to meghd00t For This Useful Post: [ Click to Expand ]
 
CRE
Old
(Last edited by CRE; 25th March 2012 at 10:19 PM.) Reason: Added credits.
#8  
CRE's Avatar
Senior Member
Thanks Meter 48
Posts: 284
Join Date: Feb 2008
Awww.... I thought the disc was easy enough to set up. :P

I've been playing around with this and it works fine. I found it responds the same way it did for me when I did the reformatting the past couple times: The "DO NOT TURN OFF YOUR DEVICE" warning doesn't go away. There's just a red X in the upper right corner which indicates it is working and not safe to turn off the device and after a minute or two it is replaced with a green check mark at which point you press and hold the power button for about 10 seconds to turn off the device. Remove the card and power back up.

The first time I ran this I was greeted with the notice that there was a problem and to restart the device and if the error occurs again to contact B&N support. Upon restarting it went through the first boot process normally.




I've been asked about the results from the former thread. I'll host a copy of the image file I've used to repartition as they're doing at B&N (5.50GB/7.45GB) with 1.4.0. I'll host it for a week or so, but it's 270MB so if someone wants to put it on a torrent of whatever, feel free.

Do a CWM backup first. Verify the MD5 checksum of the img file inside of the zip file after you download the image, before you burn it to make sure it's not corrupt... that would suck. MD5 = ae1d489a3b33f3e69360cc8e9c0bc096 You can check the checksum in Windows using a free app called WinMD5Free and you can burn the image with Win32DiskImager. This image does NOT load a boot manager. It boots straight in and repartitions and restores 1.4.0 with no prompts. Don't boot with this image if you are ready.

ONLY FOR 16GB NTs!!! --> http://www.fadingworld.com/NT/repart.img.zip


All credit for getting this img figured out (particularly the whole getting the NT to boot after the repartitioning) goes to meghd00t and probably the folks he thanks too.


EDIT: Finally compressed the img file and uploaded it so it's down to 270MB. This is a COMPLETE image, you don't need to change anything as long as you're fine with 1.4.0 and B&N's new partitioning scheme.
Nook Tablet 16GB. Running CM10 PURE AOSP 4.1.2 JBV01-Hashcode
Repartitioned with the complete SD image found here.

T-Mobile HD2 w/ ICS
The Following 6 Users Say Thank You to CRE For This Useful Post: [ Click to Expand ]
 
Pete1612
Old
#9  
Senior Member
Thanks Meter 35
Posts: 228
Join Date: Feb 2011
Location: Kaufbeuren
hmm the image doesn't work on CM7 do you need to have the stock rom installed ?
 
CRE
Old
(Last edited by CRE; 26th March 2012 at 04:19 AM.)
#10  
CRE's Avatar
Senior Member
Thanks Meter 48
Posts: 284
Join Date: Feb 2008
Quote:
Originally Posted by Pete1612 View Post
hmm the image doesn't work on CM7 do you need to have the stock rom installed ?
I don't even need to look at the script to be quite confident that there is a check to ensure that the device "qualifies" before continuing... This is all based on B&N's own reflash system. These cards flash your NT with one version or another of the stock OS... you should revert to 1.4.0 - 1.4.2 first... They will not leave CM7 intact.


EDIT: Now megdh00t's image should still boot into cyanoboot and be able to load CWM. The image I've supplied just boots and runs the partitioning script immediately. If you're trying meghd00t's and it's not booting at all then verify the download and try booting from the card by turning off the Nook, insert the card, plug in the factory charge cable and that will turn it on and it should boot from the SD.... if that still fails try a different card. I keep a few 1GB and smaller SDs on hand just because larger SDs are problematic sometimes.
Nook Tablet 16GB. Running CM10 PURE AOSP 4.1.2 JBV01-Hashcode
Repartitioned with the complete SD image found here.

T-Mobile HD2 w/ ICS

Tags
repartition, rescue, unbrick
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes