This is the same method here:
http://xdaforums.com/showpost.php?p=26285877&postcount=12
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)
~ # 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?
Wow man, that seemed really simple and straight forward. Next week well learn how to copy a file in Android, now that will be much trickier...
Thanks anyway for your efforts!
Sent from my GT-N7000 using Tapatalk 2
Seems you don´t realize what the thread-opener is writing about... It´s not that simple to repartition the emmc...
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?
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?
mke2fs 1.41.11 (14-Mar-2010)
warning: 126 blocks unused.
Is that mean the system found 126 corrupt blocks?
I want to create a PIT file
...
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?
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.
I interpreted Zamboney's post as a little bit kidding, at least I hoped it was?
before: ...-|-FAC?OR??S-|??ATAFS-|-UMS------------------------------------|...
^ ^
| |
BRICK_START BRICK_END
(? = bad blocks)
before: ...-|-FAC?OR??S-|??ATAFS-|-UMS------------------------------------|...
after: ...-| ? ?? ??|-FACTORYFS-|-DATAFS-|-UMS---------------------|...
\ /
------+-----
|
HOLE
(? = bad blocks)
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
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)
dd if=/dev/block/mmcblk0p1 of=/mnt/sdcard/efs.img
This failed, because to find out which blocks are bad, e2fsck tries to read them and gets stuck by doing so.e2fsck -c /dev/block/mmcblk0p9 (which is the /system partition)
before: - ...-|-FAC?ORYFS-|??ATAFS-|-UMS------------------------------------|...
after: + ...-| ? ?? |-FACTORYFS-|-DATAFS-|-UMS---------------|...
(? = bad blocks, + working, - = not working still bad blocks inside)
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...
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.
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
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???
don't update youtube from play store, bcoz the update will FC
a lil laggy.