PIT file method to revive your phone from a MMC_CAP_ERASE brick

Search This thread

Murshad007

Senior Member
Apr 30, 2012
940
123
Lahore
Xiaomi Poco F3
recently I got several questions according bricks of newer phones.

Please note that the emmc brick bug should be triggered only by a combination of a few conditions:
- an old samsung kernel (from ics)
- wiping or formatting by custom software, usually an old cwm of that time
- most important: an older emmc chip (or firmware)

after the problem was analyzed, all those parts were fixed to prevent the problem, even in case one or two of those conditions were true.

So if you have current hardware (somewhat newer than note1) or current software (newer than ics), the bug will not happen.

so, as an example, S3 should be safe, or Note 3 should be safe because both hardware and software are new enough.

Especially, all current roms or recoveries should be safe.

If you have a brick nowadays, it's very very unlikely to have an *emmc* brick. Instead you probably have some other problem.

So don't look here.

!!! Especially a patched PIT from this thread won't help you.!!!
You don't want to throw some memory away, right?

That is (in short) the method we use here to work around the hardware failure in some memory area. We just don't use it.

I have GT-I9100 32GB
and I am getting this error

"<ID:0/022> Initialzation..
<ID:0/022> Get PIT for mapping..
<ID:0/022> Firmware update start..
<ID:0/022> boot.bin
<ID:0/022> NAND Write Start!!
<ID:0/022> cache.img
<ID:0/022> Complete(Write) operation failed.
<ID:0/022> Added!!
<OSM> All threads completed. (succeed 0 / failed 1)"
 

Murshad007

Senior Member
Apr 30, 2012
940
123
Lahore
Xiaomi Poco F3
after i flashed 12th pit my phone is totally dead now. its not turning on in normal yellow triangle mode or in Download mode now.. Not powering on at all. Thats All happens after i flashed the 12th patched pit...

Any further help ?
 
N

notauseranymore

Guest
after i flashed 12th pit my phone is totally dead now. its not turning on in normal yellow triangle mode or in Download mode now.. Not powering on at all. Thats All happens after i flashed the 12th patched pit...

Any further help ?

Who told you it's safe to flash this file? You're in the N7000 forum, your phone is hard bricked already.
 

User_99

Senior Member
Jul 3, 2009
2,893
1,177
There are already files for 9100 and should be safe. But I think there is more damaged on your device...
 

xkawer

Senior Member
Jan 3, 2013
83
16
Will this help me if I can't repartition in Odin with the stock PIT (Re-Partition operation failed)?
 

KuGeL94

Senior Member
Jun 5, 2012
264
101
Germany
esfmods.com
Hi I have a note 1 n7000 from a friend, lcd is black, digitizer is working, he said this happened 1 month after a software update.

I thought it would be a hardware failure, opened it, checked lcd flex cables, they seem ok.
xzhtcgz.jpg


I installed an old kies for the drivers, put it in download mode, odin has seen the device.
I flashed a stock firmware via odin, it worked but lcd still black.
FXJLM8f.png

Here's the flash procedure:
Code:
<ID:0/003> Added!!
<ID:0/003> Removed!!
<ID:0/003> Added!!
<ID:0/003> Removed!!
<ID:0/003> Added!!
<OSM> Enter CS for MD5..
<OSM> Check MD5.. Do not unplug the cable..
<OSM> Please wait..
<OSM> N7000DDLSC_N7000ODDLSC_N7000DDLS6_HOME.tar.md5 is valid.
<OSM> Checking MD5 finished Sucessfully..
<OSM> Leave CS..
<ID:0/003> Odin v.3 engine (ID:3)..
<ID:0/003> File analysis..
<ID:0/003> SetupConnection..
<ID:0/003> Initialzation..
<ID:0/003> Get PIT for mapping..
<ID:0/003> Firmware update start..
<ID:0/003> factoryfs.img
<ID:0/003> NAND Write Start!! 
<ID:0/003> zImage
<ID:0/003> hidden.img
<ID:0/003> modem.bin
<ID:0/003> cache.img
<ID:0/003> RQT_CLOSE !!
<ID:0/003> RES OK !!
<ID:0/003> Removed!!
<ID:0/003> Remain Port ....  0 
<OSM> All threads completed. (succeed 1 / failed 0)

Any ideas?
 

hg42

Senior Member
Will this help me if I can't repartition in Odin with the stock PIT (Re-Partition operation failed)?

unfortunately no...
a patched PIT is only useful if you can flash it via Odin.

if you have access via adb or recovery, you might repartition by command line tools (see forest et. al.)

However, the failure flashing the PIT might point to a more severely damaged partition table. You would need JTAG then.

Also see Adam Outler for another at least theoretically possible way to unbrick via direct access to CPU via USB.
 

Lunarlegends

New member
Oct 3, 2016
3
0
Hello, i got a super bricked n7000 16gb here with download mode access but no recovery menu. I just tried flashing the original Q1_20110914_16GB.pit successfully and afterwards stock jellybean but unfortunatly its still in endless bootloop mode. I think i have to use one of the pit files to lock a certain space of the memory where its bricked, but i dont know which pit file to pick, since i cant use the recovery with the emmc scanner, to find out where the brick is.
Is there a part where the brick occurs the most, im thinking of just going ahead and try the 281 MB up to 2428 MB pitfile. The brick occured when trying to flash stock jellybean on a previously installed omnirom kitkat firmware. Any help on this would be greatly appreciated to get my good old n7000 running again, thanks in advance.
 

Lunarlegends

New member
Oct 3, 2016
3
0
I just tried flashing the costum pit files from forest1971's thread but none of the 6 worked for me with the blind flashing method without the recovery. They all flashed fine and there was the green android guy on the phones screen after pit repartition and stock firmware installation. It just doesnt boot all the way and still bootloops each and every start.
 

RishiChhikkara

Senior Member
Dec 30, 2012
328
129
New Delhi
unfortunately no...
a patched PIT is only useful if you can flash it via Odin.

could you help me modify this attached pit file for my note 4, i read everything, ran your emmc check tools, but no result, i even tried the other thread's methods which you have mentioned, but i couldn't find the bad partition, my device freezes every 10-15min, very badly, i know this is strange that i am not able to find the effected partition even after running everything, but i was thinking if relocating everything could help me, since note 4 has internal storage of 32gb, i don't mind losing 5-10gb, can you please modify this pit file in such a way that partitions start from 6th GB, as i can see right now everything is within 5GB including system.

Update- I tried to create a pit file of the same configuration, but Odin won't let me flash it, saying"secure check fail: pit", maybe I made a mistake, also I tried the alternative method mentioned by you, while using rm command from parted , it won't show any errors, but partition are not getting deleted, they remain the same, whenever I try to create a partition after executing rm , it would just say"are you sure , we can create partition from31.3gb to 31.3gb , which is the end of Emmc, hence I think partition not getting deleted.
 
Last edited:

hg42

Senior Member
could you help me modify this attached pit file for my note 4, i read everything, ran your emmc check tools, but no result

what do mean by "no result"?
The test runs and does not stop?
Then it's not an emmc bug.
with an emmc bug the test will freeze.

a note4 will not have an emmc brick like a note1.
there are many reasons why a device can freeze, let's say 99.9% of them are software. A very small part may be hardware. But only some special conditions lead to an emmc bug.

You did not check all the preconditions for an emmc bug.
A note4 has an emmc chip where the firmware bug was fixed a long time ago. Also, I am quite sure, you never used custom software that
is old enough to trigger the emmc bug.

i even tried the other thread's methods which you have mentioned, but i couldn't find the bad partition

so why do you still think it's an emmc brick?

my device freezes every 10-15min, very badly

as I said, there are many reasons, some of them hardware, but NOT an emmc brick.

i know this is strange that i am not able to find the effected partition even after running everything, but i was thinking if relocating everything could help me, since note 4 has internal storage of 32gb, i don't mind losing 5-10gb, can you please modify this pit file in such a way that partitions start from 6th GB, as i can see right now everything is within 5GB including system.

don't try to fix an emmc brick that doesn't exist.
you can only make it worse.

search for another reason. relocating partitions will not help you.

other hardware problems may affect the emmc chip, but it will not affect an area of the memory. the emmc brick bug was extremely uncommon.

You don't have the pre-conditions, you don't have any other reason to think it's an emmc brick, so don't go this route.
Fiddling with the pit is the worst thing you can do!

But you already did.

If you cannot use Odin any more, you are lost. So be very very careful with pits.

Odin already protected you from doing bad things.
I think a note4 has more protection mechanisms than a note1.
Several things are write protected and secured.
The good thing is, you don't need to change these, because they will remain original.

In your case I would probably try to flash original samsung software or use kies to restore the device to an original state.

But this might not help, if you have a hardware problem.

There are many, here are some directions:

did the device drop on floor?
all kinds of damage can result from that, may be bad contacts or bad cooling (e.g. because of broken electrical paths).

Did you overclock? did it get too much heat from the sun?
devices getting too hot or otherwise working outside their design specifications can get certain kinds of damage.
The creator of the device did choose the clocks for a reason. Overriding that isn't a good idea.
If you overclock, you need better cooling, and you don't want to install a water cooling system on your phone, right?

Other common reason for hardware failures:
Water, sweat, too much humidity etc.
Bending the phone, e.g. in pocket.

If the device lies on desk without any moving and still freezes after some time, this may be a kind of thermal problem.
You may look for hot spots on the mainboard or other parts.
But it's difficult, because some heat is normal and you don't need normal operation temperatures. You could compare with a working device, but I don't think it's worth the risk.
 
  • Like
Reactions: RishiChhikkara

RishiChhikkara

Senior Member
Dec 30, 2012
328
129
New Delhi
what do mean by "no result"?
The test runs and does not stop?
Then it's not an emmc bug.
with an emmc bug the test will freeze.

a note4 will not have an emmc brick like a note1.
there are many reasons why a device can freeze, let's say 99.9% of them are software. A very small part may be hardware. But only some special conditions lead to an emmc bug.

You did not check all the preconditions for an emmc bug.
A note4 has an emmc chip where the firmware bug was fixed a long time ago. Also, I am quite sure, you never used custom software that
is old enough to trigger the emmc bug.



so why do you still think it's an emmc brick?



as I said, there are many reasons, some of them hardware, but NOT an emmc brick.




If the device lies on desk without any moving and still freezes after some time, this may be a kind of thermal problem.
You may look for hot spots on the mainboard or other parts.
But it's difficult, because some heat is normal and you don't need normal operation temperatures. You could compare with a working device, but I don't think it's worth the risk.

test ran fine, no freezing, but strange thing is immediately after running the test when i tried to reboot twrp, it got stuck
Last time i dropped my device was aroung 4months ago & no overclocking, no overheating, but i did a lot of flashing since i was testing lots of Roms,
, right now i have two firmware, one is recovery firmware & other one is the latest one ( downloaded from sammobile), recovery firmware isn't getting flashed through odin( i guess the reason is that reacovery firmware is based on lollipop & my device is on MM, boot loader downgrading is impossible), after that i flashed the latest firmware , but odin got stuck showing error "can't read emmc" & this is the reason why i think it is emmc bug, i took out the battery, started the download mode again, this time it flashed, took 4min.20sec. , no errors, after that it did booted up, it completed the setup wizard, immediate after that a hard reboot happened, device automatically went to download mode, same error " cant read emmc", i pulled the battery, started again, everything ok, but after using it for like 5 min. , same thing happened, freezing & hard shutdown.
Whenever i try to rebbot , most of the time it would get stuck on note 4 logo or TWRP logo for a long time & sometimes just normal boot.
 
Last edited:

hg42

Senior Member
Last time i dropped my device was aroung 4months ago & no overclocking, no overheating, but i did a lot of flashing since i was testing lots of Roms

so, when did the problem start?

test ran fine, no freezing
...when i tried to reboot twrp, it got stuck
...i flashed the latest firmware , but odin got stuck showing error "can't read emmc"
...i took out the battery, started the download mode again, this time it flashed, took 4min.20sec. , no errors
...it completed the setup wizard
...hard reboot happened
...device automatically went to download mode, same error " cant read emmc"
...pulled the battery, started again, everything ok
...after using it for like 5 min. ... freezing & hard shutdown
...Whenever i try to rebbot , most of the time it would get stuck on note 4 logo or TWRP logo for a long time
...sometimes just normal boot.

very strange...
but will not be an emmc brick.
I assume another kind of hardware failure.

I think it's not software, because rebooting several times without changing anything (!!! really? !!!) with different behaviour should exclude this.
But it's not exactly "no change", because the boot process of a whole ROM does always write something here and there.

So, to distinguish software from hardware, or exclude some of the possibilities, you should extremely reduce your test environment.
Make it reproducible.

I would start with the recovery.
TWRP has adb included nowadays, so it's easy to do simple things.
When starting, TWRP shouldn't write anything, so you can first test pure read-only.

Are you able to write simple scripts or batches on your workstation?
Are you using Windows, Linux or Mac?

You could do a simple command:

Windows cmd:
Code:
FOR /L %i in (1,0,2) DO adb shell ls /

Linux bash, zsh etc.:
Code:
while true; do date; adb shell ls / ; done

the "date" in the linux command line is only to see something changing on fast PCs, not so easy on Windows.

Let it run may be half an hour or more to see if it reboots or freezes.

On my note4 the temperature shown on left side in status bar of TWRP goes from 50°C to 67°C after many minutes (using a thin rubber back cover), so there is some stress for the chips. It's only reading emmc (I hope, adb command could write some temporary data on TWRPs side, you never know).

btw. TWRP has some additional commands, as you can read here
 

RishiChhikkara

Senior Member
Dec 30, 2012
328
129
New Delhi
very strange...
but will not be an emmc brick.
I assume another kind of hardware failure.

So, My note died completely last month , just yesterday I kept it inside freezer for 5min., & Miraculously it booted up, once it started up , I immediately installed an app which would keep the cpu awake all time & strangely it is still working , flawlessly, no hanging, completely smooth, however if I turn it off, it won't boot up without keeping it in fridge. How is it possible, any idea what might be wrong?
 

hg42

Senior Member
So, My note died completely last month , just yesterday I kept it inside freezer for 5min., & Miraculously it booted up, once it started up , I immediately installed an app which would keep the cpu awake all time & strangely it is still working , flawlessly, no hanging, completely smooth, however if I turn it off, it won't boot up without keeping it in fridge. How is it possible, any idea what might be wrong?

how long does it work?
how did you get the idea to put the device into the freezer?

Naturally, immediately "cooling" comes to mind, right?
Boot up is stressful, heating the device. You may help the device with cooling it down before.
You don't stress the device afterwards, so it keeps cool.
So might have a cooling problem.

As I said: do everything in twrp with scripting adb and look at the temperature.

Other ideas:

temperature changes also create mechanical changes, because different materials have different temperature coefficients, this might close micro cracks in the conductive paths or bad soldering points. So this can cause all kinds of weird problems and is temperature depend. Dropping the device can cause such damage or overheating it (often gaming etc.).

Are you sure, your battery is ok? this should always checked first.
E.g. my note4 currently shuts down early at 20% (was 1% some months before).
Battery might respond to cooling, too. E.g. temperature affects chemical processes inside the battery. And mechanical movements inside it (by temperature changes) might have unexpected effects.
 
  • Like
Reactions: RishiChhikkara

RishiChhikkara

Senior Member
Dec 30, 2012
328
129
New Delhi
how long does it work?
how did you get the idea to put the device into the freezer?

Naturally, immediately "cooling" comes to mind, right?
Boot up is stressful, heating the device. You may help the device with cooling it down before.
You don't stress the device afterwards, so it keeps cool.
So might have a cooling problem.

As I said: do everything in twrp with scripting adb and look at the temperature.

Other ideas:

temperature changes also create mechanical changes, because different materials have different temperature coefficients, this might close micro cracks in the conductive paths or bad soldering points. So this can cause all kinds of weird problems and is temperature depend. Dropping the device can cause such damage or overheating it (often gaming etc.).

Are you sure, your battery is ok? this should always checked first.
E.g. my note4 currently shuts down early at 20% (was 1% some months before).
Battery might respond to cooling, too. E.g. temperature affects chemical processes inside the battery. And mechanical movements inside it (by temperature changes) might have unexpected effects.
It's been working since yesterday, I ran benchmark apps back to back 10times to raise the temp., but still nothing, still running smoothly, that's what confuses me, I read about the freezer method in many other threads(lot others are also facing exactly same problem), I think it might be a problem with bad soldering points, but I want to find out, which specify IC is the culprit, some people on reddit claims that they put their mobile in oven (bettery removed)& heated for 5-10min. & it's okay now, I can do the same, but I want to find out the exact IC, then use a heat gun for the same.
Battery is good, bought it last month only.
 
Last edited:

hg42

Senior Member
> It's been working since yesterday...

if you also stressed it, then it shouldn't be a general temperature problem (like cpu cooling)

> oven (bettery removed)& heated for 5-10min

temperature?

solder needs higher temperatures than all the plastics. So either they only put the motherboard into the oven or it won't fix soldering permanently.

May be it's a temporary solution because of the temperature caused movements, cracks may have closed. But this will probably come back again after some time. It's a usual behaviour for bad contacts etc.

> the exact IC, then use a heat gun for the same

this would be better

> Battery is good, bought it last month only

unfortunately, there are many fake batteries that are bad from day 1
 
  • Like
Reactions: RishiChhikkara

Joanse

Senior Member
May 12, 2014
96
17
Galaxy Note 10.1 N8000

Can you help me please? i've read the whole OP but i cant get mine to work because i cant enter recovery, i cant find a way to do that, so the only thing i can think of is giving you a fully working pit file of the n8000 and ask you if you would please patch it as you have patched the other devices with ranges, so then i can flash one by one and see which one boots up... i hope i can be understood as this is not my native language...
 

Attachments

  • note10.rar
    818 bytes · Views: 7

Top Liked Posts

  • There are no posts matching your filters.
  • 222
    Summary: in many cases this allows to revive (not really repair!) your N7000 (and some other samsung devices) after an emmc brick and should be relatively easy to follow. The method uses PIT files.

    Note: This thread is rather old now (2012).

    Please note that the emmc brick bug should be triggered only by a combination of a few conditions:
    • an old samsung ics kernel (from Ice Cream Sandwich versions 4.0–4.0.4, see wikipedia)
    • wiping or formatting by custom software, usually an old cwm of that time (especially an often used file called CWM.ZIP)
    • most important: an older emmc chip (or firmware).
      All affected devices should be covered by the thread, some got patched PIT files, some could not be supported (see below).
      Some insights here (as part of this thread)

    after the problem had been analyzed by the community and Samsung, all those parts got fixed to prevent the problem for the future.
    In case only one of the conditions is not true, the brick should not happen.

    So if you have more current hardware (somewhat newer than note1) or current software (newer than ics), the bug will not happen.

    So, as an example, S3 or Note 3 should be safe because both hardware and software are fixed.

    Especially, all current roms or recoveries should be safe.

    If you have a brick nowadays, it's very very unlikely it's an emmc brick. Instead you probably have some other problem.

    So in most cases, don't look here, unless you are using rather old devices and rather old software.




    Note: this is a living post, it will change while progressing. If you want to refer to it, please make a reference to the whole thread (this link).
    Don't directly link to the attached files, as they will go away, when I update the files or their names from time to time.


    Note: You should generally post in the correct thread (please look in my signature)

    Note: I will answer PMs which are of general interest relating to one of my topics (please look in my signature) publicly in the thread (quoting your interesting paragraphs).


    It's sad the following has to be said in such big letters, but there are still people not reading anything and therefore failing seriously:
    Please, please, please:

    Read this multiple times and try to understand all aspects before using anything of this thread.

    If you have questions, read it again!
    If you have questions, read it again!
    ...
    If you have questions, read it again!
    If you have questions, read it again!

    If you don't know exactly what you are doing, you may HARM your device seriously or even DAMAGE it for all times (e.g. meaning motherboard has to be changed with >150EUR).

    If you are a noob, then please ask someone with more knowledge to assist you, but ignore those blowhards/bigmouths which will probably do more harm to your phone than you would.


    If you have questions, read first post again and again and also read the whole thread!
    Most questions are asked several in this thread and are already answered in this first post. Others are answered later in the thread. You should also use the search function before asking something a second time.
    Please don't waste my time with superfluous questions already answered in the thread only because you are too lazy to search for it!
    It took much much time to write this down and describe most aspects. So, please take a similar amount of YOUR time to read it carefully.
    Certainly, my descriptions will not be perfect, so if you are SURE your question is NOT answered HERE, then you are welcome to ask in the thread. But don't expect a quick answer. I am usually very busy with other things and I am doing this only to help other people. I definitely don't generate any profit from this...


    Please don't quote this post (in it's entirety), because it's very long and will disturbe all other readers. Instead post without a quote or extract some of the text you are referring to. I think this should be common sense...

    You can find the former first post of this thread at post #9...I switched it with this continuously updated post, which I hope is more understandable for the users of this method.


    -------------------- manual method and tools for using adb

    I think forest1971's thread is better for the description of and questions about the manual method which I used first to revive my own phone. Looks like we developed the same thing at the same time. I started this thread before I read his (I also wasn't an active user of xda before).
    Along the way our threads started to be companions to each other.

    forest1971's thread has some useful tools for using in adb. Some of these will be useful for procedures described here.

    But please read on, because I think the PIT file method is easier for most users with kind of standard emmc bricks.
    It's less error prone, because you don't have to calculate the numbers yourself (my pit generator script did it already).
    However, the manual method can do more, especially if you have special cases.


    -------------------- find begin and end of bricked area

    You can do this with my emmc partition scanner, which is flashed via recovery (this doesn't really flash, it only uses the scripting of the updater mechanism of the recovery, also called edify script).
    You should write down two numbers:
    * where emmc_find_brick_start.zip freezes -> BRICK_START
    * where emmc_find_brick_end.zip freezes -> BRICK_END

    I have reports, that the stock recovery doesn't show the output of the scanners, so you should probably install a custom recovery first (see forrest1971 's thread).


    -------------------- patched pit files

    I finally hacked a perl script, which generates a set of PIT files for me.

    But because I cannot test the PITs on my phone (because I need it):
    ==> NO GUARANTY <==

    Say you have a situation like this:

    Code:
    before: ...-|-FAC?OR??S-|??ATAFS-|-UMS------------------------------------|...
                     ^        ^
                     |        |
           BRICK_START        BRICK_END
    (? = bad blocks)

    The repartitioning should leave a hole in the partition table around the bricked area.
    Therefore the bricked area will lie fallow (i.e. not accessed) after the repartitioning.

    Code:
    before: ...-|-FAC?OR??S-|??ATAFS-|-UMS------------------------------------|...
    after:  ...-|    ?  ??   ??|-FACTORYFS-|-DATAFS-|-UMS---------------------|...
                 \            /
                  ------+-----
                        |
                       HOLE
    (? = bad blocks)

    The calculation is done like the following (Example: N7000_16GB) with X being the size of the HOLE:

    Code:
    16GB original (Q1_20110914_16GB.pit)
    
    FACTORYFS         548864 ->Fo           1744896 ->Fs
    DATAFS           2293760 ->Do           4194304 ->Ds
    UMS              6488064 ->Uo          23232512 ->Us
    HIDDEN          29720576 ->Ho           1048576 ->Hs
    
    16GB MMC_CAP_ERASE patched
    
    FACTORYFS        FoX = Fo+X             unchanged
    DATAFS           DoX = Do+X             unchanged
    UMS              UoX = Uo+X             UsX = Us-X
    HIDDEN           unchanged              unchanged


    The PITs are named like that:

    N7000_16GB_Q1_20110914--patched--brick-between-281-and-2428-MB--FACTORYFS-moved-by-2048-MiB

    This PIT is for the N7000 with 16GB and derived from the file Q1_20110914.pit.

    Here, the HOLE is from 281 MB up to 2428 MB (MB = 1000000 bytes) which is 2147 MB or 2048 MiB (MiB = 1024*1024 bytes) in size.

    So the following relations have to match: BRICK_START >= 281 MB and BRICK_END <= 2428 MB

    Note that these numbers are rounded, so if your brick lies exactly on this border, it is possible that your aprtitions are not brick free after the repartitioning.
    So to be sure this would be safer: BRICK_START > 281 MB and BRICK_END < 2428 MB

    In the example all partitions from FACTORYFS up to the "big" partition (here UMS) have their beginning moved by 2048 MiB.
    The "big" partition is shrinked by the same amount, so it ends at the same block as before the repartitioning.
    Therefore the following partitions (only HIDDEN in this case) remain unchanged.
    All partitions before the first moved partition (FACTORYFS) remain also unchanged.

    I recently added more starting partitions for the brick (XXX-moved-by-...).
    As a rule, all partitions from this starting partition up to the "big" partition are moved by the size of the HOLE.
    All partitions in front of the starting partition and all partitions after the "big" partitions remain unchanged.

    Code:
    case FACTORYFS-moved-by-...
    
    before: ...-|-FAC?OR??S-|??ATAFS-|-UMS------------------------------------|...
    after:  ...-|    ?  ??   ??|-FACTORYFS-|-DATAFS-|-UMS---------------------|...
                 \            /
                  ------+-----
                        |
                       HOLE
    
    case DATAFS-moved-by-...
    
    before: ...-|-FACTORYFS-|D??T?FS-|-UMS------------------------------------|...
    after:  ...-|-FACTORYFS-| ?? ?|-DATAFS-|-UMS------------------------------|...
                             \   /
                              -+-
                               |
                              HOLE
    (? = bad blocks)


    The PIT file will repartition the phone automatically when flashed using Odin, but the moved partitions will not be formatted after that.
    If you flash a partition in Odin, you will also put a valid file system on this partition(because the partition image also contains the file system).
    For all other partitions, you have to format those partitions, before you can use them.
    At least the data partition should be formatted

    The revived phone does in nearly no user noticeable way differ from a stock phone afterwards.
    You just have a smaller internal sd (called "big" partition above) and you cannot flash a stock pit file again (this would revert the phone to the bricked state).


    ATTENTION: different recoveries and ROMs mount external and internal sdcard on varying directories.

    I also had the following problem:
    I couldn't format my internal sdcard with the cm9 recovery. I think it's too big for the mkfs.vfat tool of current cm9. So I installed another recovery, formatted the internal sd (I thought).
    This erased all my current backups and downloads, because in reality it was my external sd. Fortunately I had a backup of the external sdcard from before rescuing my phone.
    So, you may want to create a backup of your external sdcard first.
    Then double check which is your internal sdcard (the UMS partition) and which is your external sdcard.
    Or you could remove the external sd completely. But think about when to remove it, because you might need it for some files (e.g. to use the emmc partition scanner).



    -------------------- backup

    before messing with the partition table, everyone should make backups of all partitions that can be accessed.


    -------------------- efs backup

    The most important backup is the efs partition, which very crucial, it includes your IMEI number, bluetooth MAC etc., and without this individual information, your phone cannot be used as a phone again.

    For most supported phones, you can do this via adb:
    Code:
    dd if=/dev/block/mmcblk0p1 of=/mnt/sdcard/efs.img
    please look at forrest1971's thread for details about using adb.

    If your phone uses another partition number for efs, then use this instead of the "1" in mmcblk0p1.
    Perhaps you have to mount your sdcard first, to be able to save it there.
    Then you should copy the backup to your PC (the recovery should have the option to mount usb).


    -------------------- backup files from internal sd before repartitioning

    the repartitioning will clear all data in the affected partitions, so all data in your big partition (internal sd etc.) will be lost.
    You can try to backup your data, if the partition is accessible. The different methods below may have different success, depending which parts of your phone are usable.

    * you can use aroma file manager, which is a full fledged gui file manager which starts standalone by being flashed in CWM. So it should be completely independent (sorry, I could not test it for this kind of backup myself).

    For the following possibilities you should first ensure, you have a working recovery with working adb support.
    Mount your external sd in recovery (which might be /emmc or /sdcard, please check), to be able to copy files.

    * you can use QtAdb to copy files to your PC:

    * you can use adb pull to copy any files or directory tree to your PC, e.g.:
    adb pull /emmc/. emmc

    * you can use tar from adb to archive files to a file on sdcard:
    adb shell tar cvjf /sdcard/emmc.tar.bz2 /emmc/.

    * you can use a copy command in adb shell to copy files to a folder in sdcard:
    adb shell cp -ra /emmc/. /sdcard/emmc.backup
    Note: you will loose file attributes and owner information if emmc is formatted with ext2/ext3/ext4, because vfat cannot handle these.
    This may matter for system and some app related files.


    -------------------- recommended procedures for "standard" cases

    "standard" in this sense are pits that only affect FACTORYFS, DATA, CACHE or internal SD (UMS/USERDATA etc.).
    All other partitions need special considerations and are not handled in this section!

    Note these are from theory only. My phone is running now and I don't want to brick it again, only for testing the procedure.
    Therefore the procedure is *NOT* tested (by me) and may contain problems which I didn't expect!
    So be "careful with that axe, Eugene!"

    Note, there are always multiple ways to reinstall the phone.


    phase "find brick"
    * reboot into recovery (hold Vol-Up + Home + Power until you arrive there [20-30 seconds])
    * flash emmc_find_brick_start.zip, note where it freezes -> BRICK_START
    * flash emmc_find_brick_end.zip, note where it freezes -> BRICK_END

    phase "flash pit and ROM"
    * (re)boot to download mode (hold Vol-Down + Home + Power until you arrive there [20-30 seconds], then Vol-Up)
    * flash a patched PIT in Odin
    * flash a known good ROM via Odin (especially not a faulty stock ICS ROMs)

    phase "check partitions"
    * reboot into recovery (hold Vol-Up + Home + Power until you arrive there [20-30 seconds])
    * check the partitions (see section "checking all partitions" below)

    phase "restore partitions"
    * switch off the phone (something like "power off" in recovery)
    * remove external sdcard (to be sure not to format it afterwards)
    * boot recovery (hold Vol-Up + Home + Power until you arrive there [20-30 seconds])
    * format cache
    * format data
    * format internal SD (if it fails read below)

    phase "start ROM"
    ...


    After formatting or wiping data you can probably also boot into the ROM and format the internal sd from there (again: keep the external sd removed, to not format the external sd instead of the internal sd unintentionally).

    You should be able to flash any stock ROM from samfirmware (click on n7000 under "models"), I would recommend the one you had before the brick and and before any stock ICS, else you risk a brick again!.
    I would recommend a cyanogen ROM though, if you can live with some features missing from stock ROM.
    Note: I think the standard recovery doesn't give you enough format options (a guess, I am running cm9).

    It may be easier to take a custom ROM with a better custom recovery, but it has to be flashable via Odin (tar file).

    A second method is via recovery using a custom kernel:

    phase "find brick" like above

    phase "flash pit and kernel"
    * (re)boot to download mode (hold Vol-Down + Home + Power until you arrive there [20-30 seconds], then Vol-Up)
    * flash a patched PIT in Odin
    * flash a custom kernel with a good recovery (e.g. cm9 safe kernel) via Odin (which will increment the flash counter! -> yellow triangle -> warranty lost until you reset the counter)

    phase "check partitions" like above

    phase "restore partitions"
    * switch off the phone (something like "power off" in recovery)
    * remove external sdcard (to be sure not to format it afterwards)
    * boot into recovery (hold Vol-Up + Home + Power until you arrive there [20-30 seconds])
    * format system
    * format cache
    * format data
    * format internal SD

    phase "install ROM"
    * install the zip of the ROM

    phase "start ROM"
    ...


    So you generally install the ROM like usual, the only difference is to restore all the partitions moved by the repartitioning with the patched PIT.
    This is neccessary because all changed/moved partitions don't have a valid file system or content after the repartitioning.
    For some partitions this can be done by a simple format (cache, data, internal sd).
    Others need true contents (e.g. system, kernel, recovery can be restored by installing a rom/kernel/recovery).

    In other cases (non-standard situations) you need to restore a backup (efs, if you have one) or some generic contents (param, sbl1/2).
    EFS is the most critical one, because it contains information unique to your own phone. Also see the efs section in this post.
    I assume SBL1/2 are needed by the boot process (secondary boot loader), but I never tested this. I don't even know where to get these boot loaders (which probably have to be installed with the PIT via odin, because they are involved in the boot process).

    You may find other important information in the thread, please read it completely before asking the same things over and over again.

    There may also be useful information and experiences from users.
    I try to incorporate useful information in the thread starter, but my time is often very limited.
    Also, some information may not look valuable enough for me to integrate it, but it may be valuable for you.

    ...suggestions or corrections welcome!...


    -------------------- checking all partitions for bricked blocks

    After repartitioning some partitions may still have bricked blocks inside (because of moving brick or choosing a wrong pit etc.).

    Bricked blocks in any partition will lead to random freezes when these blocks are accessed in any way.

    So you should check all your partitions after repartitioning to be sure.

    With both methods below, you can check the partitions even before formatting any of them.

    You can do this with my emmc partition scanner, which is flashed via recovery (this doesn't really flash, it only uses the scripting of the updater mechanism of the recovery, also called edify script).

    You can also do it manual via dd commands in adb, but this is much slower.
    Use commands like this, using the partition block device in the if=... argument:

    adb shell dd if=/dev/block/mmcblk0p1 of=/dev/null
    adb shell dd if=/dev/block/mmcblk0p2 of=/dev/null
    adb shell dd if=/dev/block/mmcblk0p3 of=/dev/null
    ...
    adb shell dd if=/dev/block/mmcblk0p9 of=/dev/null
    adb shell dd if=/dev/block/mmcblk0p10 of=/dev/null
    adb shell dd if=/dev/block/mmcblk0p11 of=/dev/null
    etc.

    If any of these freeze the phone (or reboots the phone or doesn't come to an end even after an hour), you probably (still) have bricked blocks inside the according partition.


    -------------------- pit.str for DataWorkshop

    For those who want to edit their own patched pit file, I made a structure definition file (pit.str) for an open source multi-platform tool (java) called DataWorkshop, which allows looking at binary data in structured form.
    The tool is not very comfortable when it comes to copy/paste etc. but you can edit the values (just put the cursor at the correct digit before typing the number).
    Please ask (PM), if you are interested in this.


    -------------------- PITs for other devices

    Because Samsung doesn't fix their kernels (thinking their software doesn't have the problem) there is a growing number of affected devices.
    Look at the attached files, which devices are currently available.
    If pits for your device aren't available yet, please send me a stock PIT and tell me which partitions are bricked (or BRICK_START and BRICK_END, and if you know, which partitions are usually bricked for your device).
    I'll look what I can do...

    I will add comments for special cases below.


    -------------------- device i9250 - experimental PITs

    I added i9250 PITs which are very experimental, because I don't know how some details of it's stock PIT affect the result. May be it breaks everything, so beware.
    I added this especially for Shanava, who said to be able to recover even from a hard brick.
    His brick is in userdata.
    So this will probably revive the internal sd (is it userdata?) and reinstalling a ROM shouldn't be necessary, only formatting userdata.
    But I also added system and cache as possible starting partition for the brick, then you have to install a ROM and format cache accordingly.


    -------------------- devices not supported/supportable

    i9000, i9300 (and similar):
    These devices have a different PIT structure.
    The structure for each partition entry doesn't include an offset, so I don't know a way to define a gap for skipping the bricked blocks.
    Inserting an unused partition changes the partition numbers after it, which shouldn't work.


    -------------------- FOR-EXPERTS-ONLY packages

    DO NOT USE one of the packages with "FOR-EXPERTS-ONLY" in it's name unless you are REALLY REALLY sure how to handle/restore/initialize all the affected partitions, often meaning you were involved in the discussion leading to these files or you read this VERY carefully.
    These packages contain files to be used by those who have special problems and want to take the risk to try them.
    They are only documented by the corresponding discussion (somewhere in this thread).





    note: this is a living post, it changes while progressing. If you want to refer to it, please make a reference to the whole thread, beginning at the first post.
    Don't directly link to the attached files, as they will go away, when I update the files and their names from time to time.
    21
    Repartitioning around the bad blocks

    This is the former first post of this thread...I switched it with a continuously updated version, which is more understandable for ths users of my pit method.

    -----------------------snip -------------------------------------
    Hi everyone, especially those with an ICS brick,

    last week I jumped straight into a MMC_CAP_ERASE brick.
    Sadly, I knew very well what not to do with a LPY kernel on my phone (wiping etc.).
    But one weak moment (touching "wipe data/factory reset" in CWM), and then a moment later a flash (pun!) going through my brain, telling me "wow, now the phone will be bricked, right?".

    Well I rebooted the phone and thought to be a lucky man, because the system booted correctly.

    But after about a minute the SGN started to get FCs in android.*.acore and Google Play etc. I looked with a root file manager and found that the /data partition wasn't mounted.

    So I got the BRICK!

    After some days of analysing and thinking about the situation, I found a way out of the dilemma. I think, I will not bother you with all the details of these days, but go straight ahead to the final solution...

    (this was planned as the second post in the thread, but the dynamic community inserted many post in between, so I added it here :) sorry, my fault)
    ---- cut ----

    This is a rewrite in english of my report at a german forum:
    ICS Brick, Samsung Galaxy Note N7000, Erfahrungsbericht
    www.handy-faq.de/.../249283-ics_brick_samsung_galaxy_note_n7000_erfahrungsbericht.html

    My brick created bad blocks in the phone's flash memory.
    I got I/O-Errors when attempting to read or write those blocks.

    My SGN was still able to boot into recovery and all kinds of kernels/recovery.
    Odin was able to flash boot loaders, kernels, modems and CSCs.
    But flashing a factory_fs stopped at the very beginning.

    I found, that any access to some blocks inside /system and also ANY access to /data left an inaccessible phone and I had to restart it.

    For all of the following I needed access to some tools (mainly e2fsck and parted).
    As I had completely deleted my system partition before (formatting it), I had no single useful tool around, so the recovery had to provide any of those.
    The stock recovery e.g. of KL8 engineering kernel doesn't provide such tools, so I had to find a better one first.
    I found all this packed in the Thor kernel, but would not recommend it, because it's closed source.
    You may use the tools from forrest1971, see below under "manual method".

    One of my attempts to get around those bad blocks, was to create a bad blocks list which can be used by the ext4 file system, I tried this command:
    e2fsck -c /dev/block/mmcblk0p9 (which is the /system partition)
    This failed, because to find out which blocks are bad, e2fsck tries to read them and gets stuck by doing so.
    I could have created a list manually, but because the data partition was corrupted starting at it's first block, this bad blocks list wouldn't work here anyway.

    At the end, my solution was to recreate the partition scheme, leaving a big hole at the space where /system (893MB) and /data (2147MB) resided before:

    Code:
    before: - ...-|-FAC?ORYFS-|??ATAFS-|-UMS------------------------------------|...
    after:  + ...-|    ?       ??      |-FACTORYFS-|-DATAFS-|-UMS---------------|...
    (? = bad blocks, + working, - = not working still bad blocks inside)

    In order to not access those bad blocks, I could not move these partitions, but instead I had to delete them first and recreate them at another place afterwards.
    So I needed a backup of them first (fortunately I always have 7 Titanium backup levels around).


    Here is a log of my steps (but see below in the blue sections for other probably easier procedures):

    Code:
    I managed to access the device via [I]adb shell[/I]...which is another story for itself...
    
    Then I started [I]parted[/I] with the flash device:
    
    ~ # 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
    
    
    As a greeting I got some error messages about the GPT layout, which parted wanted to fix:
    [QUOTE]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 2048 blocks) or
    continue with the current setting?
    Fix/Ignore? f
    f
    f
    
    
    this was the partition scheme before implementing the workaround:
    
    Model: MMC VYL00M (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 4194kB 25.2MB 21.0MB ext4 EFS
    2 25.2MB 26.5MB 1311kB SBL1
    3 27.3MB 28.6MB 1311kB SBL2
    4 29.4MB 37.7MB 8389kB PARAM
    5 37.7MB 46.1MB 8389kB KERNEL
    6 46.1MB 54.5MB 8389kB RECOVERY
    7 54.5MB 264MB 210MB ext4 CACHE
    8 264MB 281MB 16.8MB MODEM
    9 281MB 1174MB 893MB FACTORYFS
    10 1174MB 3322MB 2147MB ext4 DATAFS
    11 3322MB 15.2GB 11.9GB fat32 UMS
    12 15.2GB 15.8GB 537MB ext4 HIDDEN
    
    
    then I deleted the partitions 9=FACTORYFS=/system,  10=DATAFS=/data and 11=UMS=/sdcard(internal) and recreated them starting at the former start of the internal sdcard partition (11) leaving the former space of the /system and /data partitions unused:
    
    (parted) rm 11
    (parted) rm 10
    (parted) rm 9
    (parted) mkpartfs primary ext2 3500 4400
    (parted) mkpartfs primary ext2 4400 7000
    (parted) mkpartfs primary fat32 7000 15.2G
    (parted) name 9 FACTORYFS
    (parted) name 10 DATAFS
    (parted) name 11 UMS
    
    now I upgraded both new ext2 partitions to ext4:
    
    ~ # tune2fs -j /dev/block/mmcblk0p9
    tune2fs -j /dev/block/mmcblk0p9
    tune2fs 1.41.11 (14-Mar-2010)
    Creating journal inode: done
    This filesystem will be automatically checked every 30 mounts or
    0 days, whichever comes first. Use tune2fs -c or -i to override.
    ~ # tune2fs -j /dev/block/mmcblk0p10
    tune2fs -j /dev/block/mmcblk0p10
    tune2fs 1.41.11 (14-Mar-2010)
    Creating journal inode: done
    This filesystem will be automatically checked every 30 mounts or
    0 days, whichever comes first. Use tune2fs -c or -i to override.
    ~ # e2fsck -fDp /dev/block/mmcblk0p9
    e2fsck -fDp /dev/block/mmcblk0p9
    /dev/block/mmcblk0p9: 11/439776 files (0.0% non-contiguous), 71701/878907 blocks
    ~ # e2fsck -fDp /dev/block/mmcblk0p10
    e2fsck -fDp /dev/block/mmcblk0p10
    /dev/block/mmcblk0p10: 11/317440 files (9.1% non-contiguous), 26386/634765 blocks
    
    
    and this is the final partition layout:
    
    ~ # parted /dev/block/mmcblk0 print
    parted /dev/block/mmcblk0 print
    Model: MMC VYL00M (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 4194kB 25.2MB 21.0MB ext4 EFS
    2 25.2MB 26.5MB 1311kB SBL1
    3 27.3MB 28.6MB 1311kB SBL2
    4 29.4MB 37.7MB 8389kB PARAM
    5 37.7MB 46.1MB 8389kB KERNEL
    6 46.1MB 54.5MB 8389kB RECOVERY
    7 54.5MB 264MB 210MB ext4 CACHE
    8 264MB 281MB 16.8MB MODEM
    9 3500MB 4400MB 900MB ext3 FACTORYFS
    10 4400MB 7000MB 2600MB ext3 DATAFS
    11 7000MB 15.2GB 8217MB fat32 UMS msftres
    12 15.2GB 15.8GB 537MB ext4 HIDDEN
    
    This configuration works so far (one complete day now).
    I can install firmwares and restore backups via recoveries.
    Also flashing via Odin should work (not tried yet).
    I currently can only imagine one standard procedure which will not work, that is creating a new partition scheme, e.g. via Odin (PIT file) or may be a CWM script.
    I think/hope this will not occur too often...
    9
    :) -- naturally, it's much faster to insert those short messages than rewriting a long german post in english.

    Next time I should write the main text prior to posting anything, I think...

    sorry...
    4
    Interesting...

    Most notes are bricked in the factoryfs and the datafs.
    Looking for a reason I noticed, that our factoryfs start in a range where you have datafs. My brick starts in the range 950MB-1GB.

    So there is a chance, the brick is always at certain addresses.

    But not all have the same ranges. For the note, there seem to be bricks in the ums, too. I guess a brick address could be calculated from an access address by some kind of alignment operation?

    Anyway, your pit is very similar to ours, so it should be easy to generate a patched one. I just have to think about how to generalize this. I think there will be more requests like this.
    4
    Flashed your pit.
    Flashed SGN_XX_OXA_KJ1_FACTORYFS.tar worked no stuck on NAND Write.
    Flashed CF-Root-SGN_XX_OXA_LA4-v5.0-CWM5.tar
    Installed XXLC1_CheckROM_NoteHD_V6.zip using CWM.

    now, at least, you should have wiped the data partition...which you catched up afterwards...

    Stucked at Wizard, retried a couple of times and passed wizard.
    Now everything Force Closed, after some minutes manages to go to Settings > Privacy > Factory Data Reset
    Check Format USB Storage

    Ok, thanks, so the wizard problem comes from having an unformatted data partition.

    But why formatting USB-storage?
    I heard there are ROMs which call the external sd "USB storage"?
    I think, probably Factory Reset (which should be more or less equal to "wipe /data" or "format /data") should be enough here.

    And now is working fine no more FC.

    nice

    i only have 8 Gb internal space.
    Is there a way i can revert my phone to original state, fix the bad blocks and have 12 gb internal space like before???

    Note: this is a work around, it's not a real fix.
    Your internal flash memory has bad blocks, and from what I know no one managed to repair them. So most people probably should ask Samsung for repair service (on guaranty).
    The fix works by moving the old /system and /data into the start of the UMS partition (internal sd) and therefore shrinking the internal sd by about 3GB.

    don't update youtube from play store, bcoz the update will FC
    a lil laggy.

    this should be unrelated to my workaround.

    May be your internal sd is still unformatted?
    Can you see files on it?