yashsingh1/xdaforums huggingface dataset:
[Galaxy Note GT-N7000 General] hg42:
thanks for the link.

I searched for similar kinds of solutions and didn't find one, but probably searched in a slightly different direction. So again, your always wiser after the event...:-)

That post has some better discussion of backgrounds and reasons about what to move where. Also the conversion from ext2 to ext4 has more details, also different options to e2fsck. And finally, there are two packages attached, which could be useful for the fix.

Generally it is worth reading. Thanks neos...
[Galaxy Note GT-N7000 General] hg42:
well, it could be much more detailed.

But most people don't like my generally really long posts.

So I cropped it in many ways.

If someone wants to discuss some points, please just ask!
[Galaxy Note GT-N7000 General] hg42:
btw. should I move the real content of my thread from my second post into the first?

What do you think? That wouldn't make the real content more visible, but would make all those funny small comments look like nonsense :-) (which is nice, ha ha)
[Galaxy Note GT-N7000 General] stephencwl:
Great to hear it actually works. Pretty straight forward for those linux versatile guru.

It's fun to read your attempt. Thanks.
[Galaxy Note GT-N7000 General] Narada2XK:
~ # e2fsck -c /dev/block/mmcblk0p9

e2fsck 1.41.12 (17-May-2010)

/dev/block/mmcblk0p9: Updating bad block inode.

Pass 1: Checking inodes, blocks, and sizes

Pass 2: Checking directory structure

Directory inode 46753, block #0, offset 0: directory corrupted

Salvage<y>?

Is this supposed to happen or do I indeed have a corrupted directory?
[Galaxy Note GT-N7000 General] ukicar:
not necessary but it would be useful
[Galaxy Note GT-N7000 General] prasad.adam:
Seems a simple to follow process. I am, luckily, not the bricked one but good to know that the fix is now available. Great contribution!
[Galaxy Note GT-N7000 General] hg42:
you have a corrupted directory structure, but you don't know the reason.

This is often repairable, but...

If you have bad blocks from a MMC_CAP_ERASE brick, e2fsck will probably get stuck somewhere.

From what I read, there seem to be people having only blocks overwritten with zeros but not damaged ones.

Also, I don't really know what kind of bad blocks my phone has now, they can't be read nor written to. Each software accessing them seems to get stuck.

In general such an fsck error can only occur when the system is stopped suddenly somewhere in the middle of some kind of writing to disk or the system has a bug somewhere.

Some standard PC scenarios do not apply or should be uncommon:

- power switched off

You can't do that with the power switch. When battery is running out of power you get a warning and if you ignore this the phone finally shuts down itself in an orderly manner.

But you can indeed pull the battery, so beware, don't do this if you don't need to and always wait some minute or two.

- system crash, blue screen etc.

I never saw something like this on android, did you?

Linux is generally very stable and most instabilities have to do with crappy PC hardware or undocumented hardware interfaces etc. Android hardware seems to be designed much cleaner.

But there are also some critical items: overclocking or undervolting if not tested thoroughly, patching and tweaking kernels and root apps accessing hardware or disks may lead to disk failures too.
[Galaxy Note GT-N7000 General] breckbit:
Seems you don´t realize what the thread-opener is writing about... It´s not that simple to repartition the emmc...
[Galaxy Note GT-N7000 General] hg42:
I interpreted Zamboney's post as a little bit kidding, at least I hoped it was?

But whatever, if you know linux, it's not that complicated.

For others this might get difficult.

You need to calculate proper values, to be successful.

But, you can always resolve from failures by restoring the old partition theme.

You can do this with parted, fdisk, etc.

You also have the option to install your standard PIT file via Odin or Heimdall.

At the end, my main problem was to get to the point to be able to use adb as root.

First you need a recovery which starts adbd.

With a cleared system partition, you get some difficulties.

Some recoveries even don't start adb.

Some want to start it, but don't have one included, so they try to start adbd from somewhere inside /system.

Others (like the stock recovery) don't work with adb shell. That is because the standard way to start the shell is to invoke /system/bin/sh.

Then I couldn't use adb push to transfer files to the system partition. I think this also was because of the cleared system partition.

After finding a backup, which installed some important files on the writable part of my system partition, I could do much more. But in my case only the first 15MB could be written until the CWM restore stopped at a bad block. Btw. you can't use the partition image based Odin for this kind of restore, it has to be file wise (recovery or adb pull if that works).

Then you have the problem, that repartitioning also removes all data in the affected partitions. So you have the same empty system partition again.

Therefore I should have made a backup of this reduced system partition before repartitioning, but I didn't.

I had also done an adb pull / before, so I had all files on my PC, which I managed to write back to the /system partition with adb push (if that works!).

The Thor kernel/recovery derived from GB is awesome at least for restoration purposes, as it has all important tools in it's /sbin, which is part of the recovery (remember, /system is not).

So as I remember, you can do all this with the Thor kernel alone.
[Galaxy Note GT-N7000 General] hg42:
creating a PIT file

After saying all that...

I want to create a PIT file which can simply be flashed by Odin or Heimdall. But Heimdall extracts only the exact PIT file I (or the system) had installed to the phone some times before (that is the original partition scheme).

It doesn't export my current partitioning scheme.

Does anyone know how to patch a PIT file?

I already googled and read some posts about the theme, but I didn't find one, which tells me the exact structure, only vague information...

Does anyone have a better source?
[Galaxy Note GT-N7000 General] blue_panther9_9:
Im trying your guide and also forrest1971 at the moment. Since Im a bit curious with this, I ended up rewiping the same partition using parted and created the same partition under the same blocks.

One of them hangs when converting the partition to ext4 which is /datafs. What should I do? is it safe to unplug the phone and redo it again? how to stop it? I can ctrl+c but I dont want to make more silly move

also

Writing inode tables: done

Creating journal (4096 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 30 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.

~ # mke2fs -T ext4 /dev/block/mmcblk0p10

mke2fs -T ext4 /dev/block/mmcblk0p10

mke2fs 1.41.11 (14-Mar-2010)

warning: 126 blocks unused.

Is that mean the system found 126 corrupt blocks?
[Galaxy Note GT-N7000 General] hg42:
as long as nobody is currently writing to the flash, you should be safe to switch off the device (remove battery). This should be the case when it hangs.

When partitioning, there is nearly nothing which could fail.

Creating a partition should be a very short moment.

The longer time is when parted creates the file system inside the partition.

When you recreate the partition anyway, all this data inside the partition doesn't matter any more.

I tried these methods to escape a hang with varying success:

- try to open another adb (second console on PC with adb shell)

from that shell

- you could eventually be able to kill the hanging process

- try kill -9 or kill -HUP etc.

- try to close the adb console and restart another

- the HUP signal could eventually kill the hanging process

- pull the battery

no, the partition schemes sometimes leave some blocks unassigned, mostly because of Microsoftisms

According to your bad blocks in /data:

My attempt was to punch out the complete /system and /data in the partition scheme, this should work with all bricks, which have only bad blocks in one or both of these two partitions. Additionally I chose rounded numbers for the partitions just to not calculate them exactly.

This could be optimized, so you could get up to about 2GB more space (not really worth the hassle, right?), but I thought this optimization would be a second step, first I wanted to get my phone back to running state.

Also, as I wanted to post my steps, I could not assume which blocks are bad for different users, so I took the complete /system and /data as possibly damaged.

If other partition would be affected, there might be other schemes to solve this, but you would have to think about it first.
[Galaxy Note GT-N7000 General] hg42:
Ok, I am dumb, I already had it:

https://github.com/Benjamin-Dobell/Heimdall/blob/master/libpit/Source/libpit.h

so stay tuned...
[Galaxy Note GT-N7000 General] blue_panther9_9:
I waited for a while, it finally stopped and went to (parted)..:)

After I recreated mmcblk0p10, I ran e2fsck -c /dev/block/mmcblk0

I found that the superblocks are having segmentation fault. <in other word- pretty much dead>

now Im gonna skip the chunk of old mmcblk0p10 to avoid it. for anyone doing this, please make sure you do e2fsck so you know which drive is affected..(im talking about mmcblk0p10 or mmbll0p9

Im repartitioning it again.. fingers cross
[Galaxy Note GT-N7000 General] XpLoDWilD:
This is not a "full" MMC_CAP_ERASE brick. The OP can still access recovery and Odin, so he can repartition/repair his emmc. However, if you can't access it anymore (if SBL/PBL is broken), this won't be of any use.
[Galaxy Note GT-N7000 General] blue_panther9_9:
also for anyone else new to this(including me) if something ever happened during this partition process(hangs and stuff) and you cant print anymore in parted no matter how many times you restarted the phone n PC. Reinstall the PIT should fix it.

also make sure to backup the partition numbering, because the default PIT file is no longer works in the future. Just like HG42 mentioned above, prepare to make custom pit file to suits you
[Galaxy Note GT-N7000 General] Zamboney:
Yeah, of course it was tongue in cheek. I'm grateful for your efforts, but thought I'd have a little fun with the thought of a newbie doing this.
[Galaxy Note GT-N7000 General] hamann:
to hg42:

The .pit file you are creating is all the command to clear the partition and make brick device working again right? I really hope so because I have no idea about adb shell. My device is bricked too. thanks.
[Galaxy Note GT-N7000 General] leoni1980:
I've tried a number of pit files but I still get loads of random lock-ups when I install a few apps and start using the phone. This occurs whether I'm running a stock Touchwiz ROM or an AOSP ROM. I can happily wipe the internal SD with no errors.

Does this mean my drive is littered with bad blocks? If so will these pit files help? The result seems to be the same whichever I use other than that my internal space shrinks. They only way I've managed to stop ANY lockups was when something went wrong and the internal storage completely vanished. I would be happy with no internal storage of this were an option but apps such as Gallery won't even open without it, even with a readable external card :(

Is it the internal storage that's throwing up the errors or the data partition? I'm not clever enough to know the ins and outs. Other people seem to be getting along happily once they install the modified pit file though so I'm womderimg why I'm not as there seem to be few people mentioning lockups once they're recovered.
[Galaxy Note GT-N7000 General] yellowboy:
Looks like I've bricked my phone also :(

So a few days ago, I was in Odin and trying to flash a new ROM.

After a few seconds in Odin, the progress meter wouldn't move and it looks like my internal disk now has some bad blocks.

Came across this thread and thought that there was a glimmer of hope.. the problem is that even though I can enter download mode (POWER/CENTRAL and VOLUME DN buttons), when I plug the phone into my PC via USB it is not detected.

I have tried reinstalling Kies but this has no effect. Tried this both on my work PC and home machine.

I'm back to using my Galaxy S2 for now - going to this small screen long term is not an option!

Any help/ideas greatly appreciated.

Thanks.
[Galaxy Note GT-N7000 General] forest1971:
In that case should uninstall Kies and use the samsung usb driver package, download from here: http://d-h.st/YKN (thanks to Dr.ketan). see how it goes. Also should try another cable as well.

---------- Post added at 04:28 PM ---------- Previous post was at 04:24 PM ----------

You may want to use dd command under adb to check if there are faulty blocks in partitions using the guide here. If the partitions are fault-free then try to change roms see if it improve. Some users reported that using CM9 rom help since those rom are very small size (less than 150 MB). Cheers.
[Galaxy Note GT-N7000 General] Zarvox:
Hi,

ICS recovery have bricked my Galaxy Tab (corrupted /data).

Could you make a patched PIT file ?
[Galaxy Note GT-N7000 General] Zarvox:
I've included stock PIT has you request.
[Galaxy Note GT-N7000 General] bferguson:
thank you

You have saved another GNote good sir! Thank you very much for your information. I'm not sure exactly why mine got Super-Bricked, since I thought I had safe software loaded on mine, but now I have restored and am now running the custom ROM that I wanted in the first place. But enough rambling, thanks again for your time and effort. I shall donate to you once I am able to. Have a wonderful day!
[Galaxy Note GT-N7000 General] rraaka:
your sig says you were on Notecore ?
[Galaxy Note GT-N7000 General] hg42:
formatting doesn't touch each block, so it's not enough for a complete test.

dd can be used for checking all blocks, but you need to use adb or a root terminal.

I am on the way to create some flashable zips for checking all partitions and also for finding start and end of brick.

Hopefully should be available next week or so...
[Galaxy Note GT-N7000 General] hg42:
can you tell why you lost the efs partition contents?

Flashing the pits shouldn't change only system data and ums.

So who touched efs?
[Galaxy Note GT-N7000 General] ourtech:
I recently reported a similar problem a few posts back with random lockups including while in recovery. Initially I fixed mine with the recommended PIT file for beginners, but had ongoing problems with random lockups. Since that time I have taken a number of steps that seem to have eliminated my lockups. I am not sure that I have eliminated any underlying problems and since things are running well I am (for the moment) not going to flash a new kernel to run the diagnostics. Here are the steps I have taken that seem to have improved things in the hopes that it may help someone else. I was using at the time Speedmod -11 kernel.:

1) Went in to recovery and reformated cache and internal SD card then restored the contents of the internal SD card - not much improvement

2) Reformated the Internal SD card and did not restore the contents - better, fewer lockups

3) Reformated the EXTERNAL_SD card - better, fewer lockups

4) I did these last two steps on the same day and can't say which for sure may be definitive (probably the kernel flash but I would be guessing). Installed a Class 10 SD Card and flashed the -9 kernel. Since that time I have not had one lockup. I was getting several a day and the phone was locked up solid in the morning for 2 days in a row. If I see another lockup at some point then I will follow the steps and scan for bad areas. But for now, my phone is GREATLY improved. I am running 4.04 with the Speedmod K3-9 kernel.
[Galaxy Note GT-N7000 General] hg42:
in these cases I generally would recomment starting a completely fresh installation.

Keep it as simple as possible at the beginning and then (after "enough" time) slowly add apps etc.

What's enough? We say "statistics start at 100".

At least for a thorough test 2 days of normal usage is not much...

Another test method is to stress the device.

Install apps until memory full.

Fill up partitions, etc.

In emmc case it should be all related to internal storage.
[Galaxy Note GT-N7000 General] Zarvox:
If your file is compatible with many phones / tablets you save my butt man !

Envoyé depuis mon Xperia S
[Galaxy Note GT-N7000 General] rraaka:
this thread needs to be published in the main android forums,

is it ?
[Galaxy Note GT-N7000 General] hg42:
No, but emmc bug seems to be samsung only...so samsung forums?

My problem with that is having nearly no knowledge of other phones. If the thread is found in galaxy note forums, this should be enough to warn users.

Links from more general forums should be ok, I think.
[Galaxy Note GT-N7000 General] hg42:
should be usable on all android phones (guessed, you never know).

The program to be used already exists and can scan *all* available block devices in sequence (using something like /dev/block/* or /proc/partitions).

However i have to exclude some special cases, e.g. the base device (like mmcblk0) etc.

This is also fast because it's done in 1MiB steps (or may be bigger?) and only one byte is read.

I want to create a scan-all-partitions.zip and find-brick-start.zip and find-brick-end.zip.

The later two will freeze unfortunately when finding a bricked block, so a reboot is required.

This seems to be the best I can do.

I would love to automatically reboot then and get to an automatic update.zip for the other end afterwards.

But I am not sure if I can do this portable for all android configurations (especially using the recovery command file).
[Galaxy Note GT-N7000 General] rraaka:
i didnt mean it to be an extention of the warning to benefit others as much as an effort to honour your efforts and contribution and publication of our honest appreciation,

this IS a contribution to ANDROID as much as it can get ......

(maybe i meant the main xda forums)
[Galaxy Note GT-N7000 General] hosamomr:
hi

thanks hg42 for very useful custom PIT file.

And let me move it to another forum

many thanks
[Galaxy Note GT-N7000 General] Zarvox:
I've a Galaxy Tab 7 plus (GT-P6210) bricked (/data corrupted) by Samsung ICS recovery.

With your manual method I've discovered that I've bad block in /data but don't know how to fix it.
[Galaxy Note GT-N7000 General] Mario1968:
Hi hg42, I'm not a developer, only a computer fan, I love to do things with scripts to automate repetitive jobs on pc, I want only to suggest you a possible way for an automatic reboot (only theory):

1) launch a script that do a countdown of 1 or more seconds then execute the reboot command

2) launch your script that read any block of emmc, then reset the counter of first script, when this script ends then kill the first script and show the found bricked blocks.

In this way if the second script hangs due to emmc bricked block, the first script countdown ends in a reboot, maybe first to reboot the phone this script may setup a new script to be executed at the new boot to start again this loop, until ends with the wanted results.

Consider this a only a suggestion and if this is not applicable simply ignore.

Thank you

Mario

Inviato dal mio Galaxy S2 con Tapatalk2®

XWLPF Stock

Siyah 3.5.2

Jkay V14.1
[Galaxy Note GT-N7000 General] travis82:
I have an 8gb SPH-D700 i need to repair that is emmc bricked from a guy that well you know what happend.

here is the pit anyway you can work your magic and generate some for me? Thanks.
[Galaxy Note GT-N7000 General] forest1971:
In case custom pit is not available you can try to do manual repartition using parted, i guess.

Sent from my phone
[Galaxy Note GT-N7000 General] Zarvox:
I've already done it and I saw that my data partition is corrupted but I can't see where is bad block in it.

I can only recreate a 3 GB partition but my tablet has 16 GB of storage (only on /data).
[Galaxy Note GT-N7000 General] forest1971:
Ok. so it looks like the p6210 use datafs for both application data and for internal sdcard function?

I guess you have tried to create datafs partition with different sizes and in different area. That is one solution, although it maybe time consuming, to explore which area is good and which is bad. As long as parted can create partition in ext2 successfully in some area, then that area is good. if it gave error message then that area is bad.

btw, does the tablet work with the small size datafs that you managed to make?
[Galaxy Note GT-N7000 General] hg42:
yes, that's similar to what I have already done in shell script.

The script starts a second instance of itself in the background with a parameter to do the other branch.

This would be a fork in a c/ c++ program or may be an alarm.

One remaining problem (which I still didn't investigate) is how to get into the script again after reboot.

I think I can use a recovery command file but would this work the same for all recoveries?

Also, how can I reboot into recovery without invoking an external program, which I cannot do with locked emmc.

I think I need to look in some sources (like "reboot" command in busybox).

But may be I should drop these automatisms and simply offer three zips. All expected users should be able to reboot into recovery and flash a zip, right?
[Galaxy Note GT-N7000 General] hg42:
move what? the pit?

Please link to the first post then, as it often changes.

Links directly to the files will be invalid after some time.
[Galaxy Note GT-N7000 General] hg42:
will probably look at it this week(end)...

Also for the other phone missing a pit.
[Galaxy Note GT-N7000 General] Zarvox:
True

Yes it works.

Envoyé depuis mon Xperia S
[Galaxy Note GT-N7000 General] tannykim:
Thank you sooooooooooooooooooooooooooooooooooo much

I do know have any knowledge for PIT but your files saved my note.

However, I have some question.

I do not know exactly where is my bad block so I kept trying your pits-patched-ums-bricked.

Whenever I can flashing the PIT I tried to install ROM.

However, when I had issue with random shut down and freez, I did PIT step again.

Is it okay to do these steps?

I read OP many times but I could not understand how to find bad blocks.... could you please help me on this?

Thank you
[Galaxy Note GT-N7000 General] hosamomr:
hi

I mean. Allow me to transfer this experience - and also patched-ums-bricked- file . to another forum does not support the English language.

what pit file patched-ums-bricked gave me more space &Stability . I used to N7000_16GB_Q1_20110914-patched-ums-bricked+1572864-kB.gave me about 7g--The possible solution to the problem repeated freezing and restart

thanks
[Galaxy Note GT-N7000 General] Alahdal:
Galaxy Note n7000 was revived thanks a lot.
[Galaxy Note GT-N7000 General] hg42:
currently, I would start flashing the highest ums-bricked pit and any factoryfs (which scans about 893MB). If this works take the next lower pit and so on.

If flashing factoryfs freezes, there should be the end of bricked blocks.

As I mentioned above, I am also developing a solution for scanning emmc, finding begin and end of bricked area and checking all partitions.
[Galaxy Note GT-N7000 General] hg42:
Yes, but don't copy the files or their links.

Instead link to the first post of the thread and tell which attachment to take.
[Galaxy Note GT-N7000 General] hg42:
which partition(s) is/are usually bricked (or if you don't know, which in your case)?

EDIT: hmm, there is also no big partition in the PIT, where I could take the needed space from.

EDIT: all offsets in this PIT are set to 128kB

so it looks like it's a different format?

EDIT: this phone should be handled by manual method (forest1971), I think I cannot generate a working PIT
[Galaxy Note GT-N7000 General] hg42:
I updated the first post.

* added new P6210 PITs

* changed "ums-bricked" to "big-bricked", because the big partition is not always called UMS

* all PIT zips updated to "big-bricked" naming

* removed log files of failed PIT generations (so no PIT file written)

* updated ascii layout "graphics" to be a bit clearer

* updated "big-bricked" instructions