[Q] Corrupt GPT? - Asus Eee Pad Transformer Prime

I think after running wrong exit_recovery.zip, I managed to trash partition table/GPT - or some other combination of stupidity - hoping someone can help..
CWM Recovery Log
Starting recovery on Mon Jun 25 21:11:17 2012
can't open /dev/tty0: No such file or directory
framebuffer: fd 3 (1280 x 800)
ClockworkMod Recovery v5.8.2.0
recovery filesystem table
=========================
0 /tmp ramdisk (null) (null) 0
1 /system ext4 /dev/block/mmcblk0p1 (null) 0
2 /cache ext4 /dev/block/mmcblk0p2 (null) 0
3 /misc emmc /dev/block/mmcblk0p3 (null) 0
4 /staging ext3 /dev/block/mmcblk0p4 (null) 0
5 /data ext4 /dev/block/mmcblk0p8 (null) 0
6 /boot emmc /dev/block/mmcblk0p10 (null) 0
7 /recovery emmc /dev/block/mmcblk0p9 (null) 0
W:Unable to get recovery.fstab info for /datadata during fstab generation!
W:Unable to get recovery.fstab info for /emmc during fstab generation!
W:Unable to get recovery.fstab info for /sdcard during fstab generation!
W:Unable to get recovery.fstab info for /sd-ext during fstab generation!
I:Completed outputting fstab.
Irocessing arguments.
...
[recovery session] Fdisk
/tmp # fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 63.5 GB, 63577260032 bytes
4 heads, 16 sectors/track, 1940224 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk /dev/block/mmcblk0 doesn't contain a valid partition table
[recovery session] Parted
/tmp # ./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) p
p
Error: /dev/block/mmcblk0: unrecognised disk label
Hypothesis
By doing exit recovery opt 1a http://forum.xda-developers.com/showthread.php?t=1514088 I was able to bring up the virtuousprime ROM boot, but virtuous failed (reboot) after trying to format /data.
I dd'd the first 8096 bytes of mmcblk0 and they are all zeros?
From CWM, I am able to mount partitions mmcblk0p1, mmcblk0p3, mmcblk0p5.
So from all that, I am thinking I need to flash MBR, replace GPT on LBA 1? If this is correct, does anyone have a stock GPT for the tf201?
I can then format /data (mmcblk0p8) and I think my ROMs will then work.
kind regs,

Based on the information here: https:// en.wikipedia.org/wiki/GUID_Partition_Table#Partition_table_header_.28LBA_1.29, replacing LBA 1 will only fix the GPT header. Since you said that the first 8096 bytes were all zeros, it would seem that those would fall into LBA 2, 3, etc., corrupting the partition table.
But since you said that CWM can mount your partitions, you might be able to use GPT fdisk's recovery features to fix the problem. I don't know if anyone has compiled it for Android though Please note that the regular fdisk cannot handle GPT, only MBR.
When you said "flash MBR", what exactly do you mean? GPT and MBR are two different partition structures and if you replace either one with the other, the partition table will be lost and you won't be able to mount any partition.

Was thinking about building LBA0 and LBA 1 separately, was going from that Wikipedia article, "...Legacy MBR information is contained in LBA 0, the GPT header is in LBA 1.." and I thought - perhaps naively - that an fdisk command with /mbr option would sort out LBA0, then I worry about GPT in LBA1, but maybe I am confusing fdisk /mbr option with another command (old DOS)?
I have all the partition offsets and disk size from backup (/sys/devices/platform/sdhci-tegra.3/mmc_host/mmc0/mmc0:0001/block/mmcblk0/..) and know what the partition table should look like; there was no "Partition 9", I made this up because there was 1024 unaccounted bytes after mmcblk0p8 (/data) ends:
Disk size: 1241744336 bytes
Partition 1 (/system): start 74752; End 1123328; Size 1048576
Partition 2 (/cache): start 1123328; End 1999872; Size 876544
Partition 3 (/misc): start 1999872; End 2003968; Size 4096
Partition 4 (/staging): start 2003968; End 3096576; Size 1092608
Partition 5 (/btmac): start 3096576; End 3106816; Size 10240
Partition 6 (/?): start 3106816; End 3107840; Size 1024
Partition 7 (/?): start 3107840; End 3118080; Size 10240
Partition 8 (/data): start 3118080; End 124173312; Size 121055232
Partition 9: start 124173312; End 124174336; Size 1024
Given that /system mounts, I think if I had a stock dump from a tf201 of bytes 0-74752 might also be an alternative - I could verify the GPT table against above before I put it in.
Another option I can think of, comes from reference I see to a "backup GPT" held in last sector of GPT disks? If you look at partition offsets above, there is 1024 bytes at the end where I may get this information - but I think injecting in a dump of those first 74k bytes into mmcblk0 - as above - would be safer.

damonbrisbane said:
Was thinking about building LBA0 and LBA 1 separately, was going from that Wikipedia article, "...Legacy MBR information is contained in LBA 0, the GPT header is in LBA 1.." and I thought - perhaps naively - that an fdisk command with /mbr option would sort out LBA0, then I worry about GPT in LBA1, but maybe I am confusing fdisk /mbr option with another command (old DOS)?
Click to expand...
Click to collapse
I wouldn't suggest doing that. That would create a hybrid MBR. When a hybrid MBR disk is read using MBR, only the first four partitions can be visible (after redefining the partition table in LBA0). If the disk is read using GPT, all the partitions will be visible. I don't know if Android and Linux prefer MBR over GPT, but if they do, you might lose access to partitions 5-8.
By the way, the '/mbr' option is for the diskpart tool from MSDOS and Windows
damonbrisbane said:
Another option I can think of, comes from reference I see to a "backup GPT" held in last sector of GPT disks? If you look at partition offsets above, there is 1024 bytes at the end where I may get this information - but I think injecting in a dump of those first 74k bytes into mmcblk0 - as above - would be safer.
Click to expand...
Click to collapse
You're absolutely right. I had forgotten about this. Do you happen to know if those mmcblk0p# partitions are visible when the tablet is plugged into a Linux computer? If so, GPT fdisk can restore the partition table and GPT header from the backup GPT.
You would run something like this to restore the backup GPT:
http://paste.kde.org/488054/
EDIT: I found a version of gdisk compiled for Android by meghd00t (http://forum.xda-developers.com/showpost.php?p=24805392&postcount=74). You may be able to restore the backup GPT directly from the tablet
Download link from the post: http://dl.dropbox.com/u/64885133/gptfdisk.zip

Thanks Chen, i plan to try the gptfdisk tonight when I get home from work and can post the result.
One thing i'm not sure about is access mmcblk0 from linux - does this mean I can access the internal mmcblk0 of the tf201 directly through a linux device? Right now I access mmcblk0 solely through adb shell to CWM recovery.

damonbrisbane said:
Thanks Chen, i plan to try the gptfdisk tonight when I get home from work and can post the result.
One thing i'm not sure about is access mmcblk0 from linux - does this mean I can access the internal mmcblk0 of the tf201 directly through a linux device? Right now I access mmcblk0 solely through adb shell to CWM recovery.
Click to expand...
Click to collapse
No problem There's also an option to backup the GPT header and partition table to file. I'd suggest doing that just in case anything goes wrong.
I'm not entirely sure if the internal memory can be accessed directly from Linux. But from what I've been reading in the forums today, it seems that it might not possible (I'm pretty new to Android).
Hopefully gptfdisk will work via adb shell

Whew, we're off life support! and more importantly - my wife wont kill me for an Unauthorised Brick to The Birthday Device
Steps Performed
ADB - Write backup GPT to LBA1 mmcblk0
~ # ./gdisk /dev/block/mmcblk0
GPT fdisk (gdisk) version 0.8.4
Unsupported GPT version in backup header; read 0x00000000, should be
0x00010000
Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: not present
Creating new GPT entries.
Command (? for help): r
Recovery/transformation command (? for help): ?
b use backup GPT header (rebuilding main)
c load backup partition table from disk (rebuilding main)
…
? b
Recovery/transformation command (? for help):
? c
Warning! This will probably do weird things if you've converted an MBR to
GPT form and haven't yet saved the GPT! Proceed? (Y/N): Y
Caution! After loading partitions, the CRC doesn't check out!
Recovery/transformation command (? for help): p
Disk /dev/block/mmcblk0: 124174336 sectors, 59.2 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 2E8491CC-AFFC-43B9-B1C4-97D2F258BE1C
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 124174302
Partitions will be aligned on 2048-sector boundaries
Total free space is 75709 sectors (37.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 74752 1123327 512.0 MiB 0700 AP
2 1123328 1999871 428.0 MiB 0700 CC
3 1999872 2003967 2.0 MiB 0700 MC
4 2003968 3096575 533.5 MiB 0700 UP
5 3096576 3106815 5.0 MiB 0700 PR
6 3106816 3107839 512.0 KiB 0700 YU
7 3107840 3118079 5.0 MiB 0700 CA
8 3118080 124173311 57.7 GiB 0700 UA
Recovery/transformation command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/block/mmcblk0.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
~ #
ADB/CWM - Exit recovery and attempt Virtuousprime ROM install
I then did exit recovery as per 1a http://forum.xda-developers.com/showthread.php?t=1514088
Upon reboot Virtuousprime wouldn't go as far as it got before. I went back into adb shell and did wipe data:
Wipe data/factory reset
Formatting /data
Error mounting /data !
Skipping format...
Formatting /cache
Formatting /sd-ext
Formatting /sdcard/.android_secure...
Error mounting /sdcard/.android_secure!
Skipping format...
Data wipe complete
Note the error on /data. Could not format /data either using the CWM mounts and storage menu. I named the partitions I knew about and formatted /data (mmcblk0p8) from adb shell:
Number Start End Size File system Name Flags
1 38.3MB 575MB 537MB ext4 system
2 575MB 1024MB 449MB ext4 cache
3 1024MB 1026MB 2097kB misc
4 1026MB 1585MB 559MB ext3 staging
5 1585MB 1591MB 5243kB fat32 btmac
...
8 1596MB 63.6GB 62.0GB ext4 data
mke2fs -t ext4 /dev/block/mmcblk0p8
I then found that CWM data/factory reset went through without errors:
Wipe data/factory reset
Formatting /data
Formatting /cache
..
Data wipe complete
And subsequently exit recovery and virtuous prime rom have installed OK, tested across reboot and shutdown
Cheers!

damonbrisbane said:
Whew, we're off life support! and more importantly - my wife wont kill me for an Unauthorised Brick to The Birthday Device
Click to expand...
Click to collapse
Haha, I'm glad I was able to help

Related

[Q] ADB Shell help?

As I posted previously about flashing issues and errors which came up with my device I've learned that my partitions were corrupted and nearly all were erased. With some help from developer Mev and other members I was able to get my device working with ADB shell yet the commands seemed to be far out of my lead.
I have an YP-G70 USA (8 Gigs) device.
From what I learned this is the partition to the device, yet the start/ending blocks aren't listed. Would that be a problem?
Code:
Device Size (KiB) Mount Name Notes
/dev/block/mmcblk0 7757824 Internal eMMC disk device
/dev/block/mmcblk0p1 1 Extended partition containing everything else
/dev/block/mmcblk0p5 256 boot.bin Initial+Primary Bootloaders
/dev/block/mmcblk0p6 256 YPG70_8G-0304.pit Partition Information Table
/dev/block/mmcblk0p7 1280 Sbl.bin Secondary Bootloader
/dev/block/mmcblk0p8 1280 Sbl.bin SBL backup
/dev/block/mmcblk0p9 5120 /mnt/.lfs param.lfs param.blk and boot logos - source of recovery loops
/dev/block/mmcblk0p10 10240 /efs efs.rfs WiFi and BT MAC addresses - causes missing lockscreen
/dev/block/mmcblk0p11 7680 zImage Kernel
/dev/block/mmcblk0p12 7680 zImage "Recovery" kernel that is never used
/dev/block/mmcblk0p13 296960 /system factoryfs.rfs System partition
/dev/block/mmcblk0p14 137216 /dbdata dbdata.rfs Various Android/app databases
/dev/block/mmcblk0p15 65536 /cache cache.rfs Cache partition
/dev/block/mmcblk0p16 1970176 /data datafs.rfs Data partition (apps and their data)
/dev/block/mmcblk0p17 5252096 /sdcard userfs_8G.rfs "Emmc" "Usb Storage" - where your media goes
/dev/block/mmcblk1 <varies> External SD Card disk device
/dev/block/mmcblk1p1 <varies> /sdcard/external_sd External SD Card partition
Next thing is, whenever I tried using
Code:
fdisk /dev/block/mmcblk0
and later on creating a prime partition within the settings that I try to use the "e" to extend (says nothing about "l" for logical) which I run out of sectors to create them with. And sadly the only ones that ever come up is mmcblk0p4 or mmcblk0p3.
Just looking for help to get my player back up and running .. it's all I have and use at work since I don't have a phone and really have been trying to get this to work but its difficult so im sorry for bothering..
I don't know what to do after this:
Jistropy said:
As I posted previously about flashing issues and errors which came up with my device I've learned that my partitions were corrupted and nearly all were erased. With some help from developer Mev and other members I was able to get my device working with ADB shell yet the commands seemed to be far out of my lead.
I have an YP-G70 USA (8 Gigs) device.
From what I learned this is the partition to the device, yet the start/ending blocks aren't listed. Would that be a problem?
Code:
Device Size (KiB) Mount Name Notes
/dev/block/mmcblk0 7757824 Internal eMMC disk device
/dev/block/mmcblk0p1 1 Extended partition containing everything else
/dev/block/mmcblk0p5 256 boot.bin Initial+Primary Bootloaders
/dev/block/mmcblk0p6 256 YPG70_8G-0304.pit Partition Information Table
/dev/block/mmcblk0p7 1280 Sbl.bin Secondary Bootloader
/dev/block/mmcblk0p8 1280 Sbl.bin SBL backup
/dev/block/mmcblk0p9 5120 /mnt/.lfs param.lfs param.blk and boot logos - source of recovery loops
/dev/block/mmcblk0p10 10240 /efs efs.rfs WiFi and BT MAC addresses - causes missing lockscreen
/dev/block/mmcblk0p11 7680 zImage Kernel
/dev/block/mmcblk0p12 7680 zImage "Recovery" kernel that is never used
/dev/block/mmcblk0p13 296960 /system factoryfs.rfs System partition
/dev/block/mmcblk0p14 137216 /dbdata dbdata.rfs Various Android/app databases
/dev/block/mmcblk0p15 65536 /cache cache.rfs Cache partition
/dev/block/mmcblk0p16 1970176 /data datafs.rfs Data partition (apps and their data)
/dev/block/mmcblk0p17 5252096 /sdcard userfs_8G.rfs "Emmc" "Usb Storage" - where your media goes
/dev/block/mmcblk1 <varies> External SD Card disk device
/dev/block/mmcblk1p1 <varies> /sdcard/external_sd External SD Card partition
Next thing is, whenever I tried using
Code:
fdisk /dev/block/mmcblk0
and later on creating a prime partition within the settings that I try to use the "e" to extend (says nothing about "l" for logical) which I run out of sectors to create them with. And sadly the only ones that ever come up is mmcblk0p4 or mmcblk0p3.
Just looking for help to get my player back up and running .. it's all I have and use at work since I don't have a phone and really have been trying to get this to work but its difficult so im sorry for bothering..
I don't know what to do after this:
Click to expand...
Click to collapse
You should have created that as an extended partition, not primary. Then go through and create new partitions "n"
I apologize for not giving you quite the right information. I know there's a table here with starting and ending blocks.
For illustration, here's an example of what to enter at the prompts. IGNORE THE BLOCK NUMBERS - it's just an illustration; just notice the extended/logical and the partition numbers.
Code:
[[email protected] ~]$ fdisk mmcblk0
Welcome to fdisk (util-linux 2.22.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xab3ebd8d.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): e
Partition number (1-4, default 1):
Using default value 1
First sector (2048-102399, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-102399, default 102399):
Using default value 102399
Partition 1 of type Extended and of size 49 MiB is set
Command (m for help): p
Disk mmcblk0: 52 MB, 52428800 bytes, 102400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xab3ebd8d
Device Boot Start End Blocks Id System
mmcblk0p1 2048 102399 50176 5 Extended
Command (m for help): n
Partition type:
p primary (0 primary, 1 extended, 3 free)
l logical (numbered from 5)
Select (default p): l
Adding logical partition 5
First sector (4096-102399, default 4096):
Using default value 4096
Last sector, +sectors or +size{K,M,G} (4096-102399, default 102399): 16383
Partition 5 of type Linux and of size 6 MiB is set
Command (m for help): p
Disk mmcblk0: 52 MB, 52428800 bytes, 102400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xab3ebd8d
Device Boot Start End Blocks Id System
mmcblk0p1 2048 102399 50176 5 Extended
mmcblk0p5 4096 16383 6144 83 Linux
Command (m for help): n
Partition type:
p primary (0 primary, 1 extended, 3 free)
l logical (numbered from 5)
Select (default p): l
Adding logical partition 6
First sector (18432-102399, default 18432):
Using default value 18432
Last sector, +sectors or +size{K,M,G} (18432-102399, default 102399):
Using default value 102399
Partition 6 of type Linux and of size 41 MiB is set
Command (m for help): p
Disk mmcblk0: 52 MB, 52428800 bytes, 102400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xab3ebd8d
Device Boot Start End Blocks Id System
mmcblk0p1 2048 102399 50176 5 Extended
mmcblk0p5 4096 16383 6144 83 Linux
mmcblk0p6 18432 102399 41984 83 Linux
Command (m for help): w
The partition table has been altered!
Syncing disks.
[[email protected] ~]$
Awe man thank you!! Going to try this out right now I felt bad for messaging you.
Give me like 15 minutes.
Those cover three of the partitions, how do I go about making the rest?
Jistropy said:
Awe man thank you!! Going to try this out right now I felt bad for messaging you.
Give me like 15 minutes.
Those cover three of the partitions, how do I go about making the rest?
Click to expand...
Click to collapse
Just keep going:
Code:
n (new)
l (logical)
<enter> (beginning)
+blocks (size)
and then
Code:
p (print)
to check your work, and
Code:
w (write)
to save changes and exit.
The Block sizes don't matter right?
Jistropy said:
The Block sizes don't matter right?
Click to expand...
Click to collapse
They matter very much. Use the ones from the device. The above was to illustrate the process. It has entirely wrong numbers.
I will have to repeat this process after doing the extended partition:
Code:
Command (m for help): n
Partition type:
p primary (0 primary, 1 extended, 3 free)
l logical (numbered from 5)
Select (default p): l
So what do I do with these?
Code:
First sector (18432-102399, default 18432):
Using default value 18432 (DONT FILL ?)
Last sector, +sectors or +size{K,M,G} (18432-102399, default 102399):
Using default value 102399 (DONT FILL ?)
Should I fill in those with this?
Code:
Device Size (KiB) Mount
/dev/block/mmcblk0 7757824
/dev/block/mmcblk0p1 1
/dev/block/mmcblk0p5 256
/dev/block/mmcblk0p6 256
/dev/block/mmcblk0p7 1280
/dev/block/mmcblk0p8 1280
/dev/block/mmcblk0p9 5120
/dev/block/mmcblk0p10 10240
/dev/block/mmcblk0p11 7680
/dev/block/mmcblk0p12 7680
/dev/block/mmcblk0p13 296960
/dev/block/mmcblk0p14 137216
/dev/block/mmcblk0p15 65536
/dev/block/mmcblk0p16 1970176
/dev/block/mmcblk0p17 5252096
/dev/block/mmcblk1 <varies>
/dev/block/mmcblk1p1 <varies>
Also, how do I do the last two? Just testing things I don't have the numbers so im randomly copying and pasting the number sets.
Jistropy said:
I will have to repeat this process after doing the extended partition:
Code:
Command (m for help): n
Partition type:
p primary (0 primary, 1 extended, 3 free)
l logical (numbered from 5)
Select (default p): l
So what do I do with these?
Code:
First sector (18432-102399, default 18432):
Using default value 18432 (DONT FILL ?)
Last sector, +sectors or +size{K,M,G} (18432-102399, default 102399):
Using default value 102399 (DONT FILL ?)
Should I fill in those with this?
Code:
Device Size (KiB) Mount
/dev/block/mmcblk0 7757824
/dev/block/mmcblk0p1 1
/dev/block/mmcblk0p5 256
/dev/block/mmcblk0p6 256
/dev/block/mmcblk0p7 1280
/dev/block/mmcblk0p8 1280
/dev/block/mmcblk0p9 5120
/dev/block/mmcblk0p10 10240
/dev/block/mmcblk0p11 7680
/dev/block/mmcblk0p12 7680
/dev/block/mmcblk0p13 296960
/dev/block/mmcblk0p14 137216
/dev/block/mmcblk0p15 65536
/dev/block/mmcblk0p16 1970176
/dev/block/mmcblk0p17 5252096
/dev/block/mmcblk1 <varies>
/dev/block/mmcblk1p1 <varies>
Also, how do I do the last two? Just testing things I don't have the numbers so im randomly copying and pasting the number sets.
Click to expand...
Click to collapse
PLEASE have a look around....
http://forum.xda-developers.com/showthread.php?t=1523682
the numbers you want are here within ^post n°8. (value is Kb) and in many other posts!
The last partition n°17, should and must have only some 5gb because your device is 8 gb. Take care to set fdisk with the proper set up between blocks and Bytes and in case of error don't panic, just trail again .
Good luck
sorry lolo9393
Jistropy said:
Okay, rude much?
Your no help, that's for: "CORRECT partition sizes (for 16GB model!):"
As I said above, I have a 8 GIG USA YP-G70.
If your gonna post, maybe you should read more clearly.
Click to expand...
Click to collapse
You follow the table until partition 17 that will show only some "5252096" kb remaining if entered numbers are correct, because you have a 8 Gb device.
I tried to help you with what I know, sorry for my bad english..
Jistropy said:
Okay, rude much?
Your no help, that's for: "CORRECT partition sizes (for 16GB model!):"
As I said above, I have a 8 GIG USA YP-G70.
If your gonna post, maybe you should read more clearly.
Click to expand...
Click to collapse
Please listen th his help. He knows more about it than I do.
i apologize but no matter how i insert those numbers they never come out close
I got up to block 16 but it says i over pass the cylendars
Code:
/dev/block/mmcblk0p16 64181 313396 1993728 83 Linux
/dev/block/mmcblk0p17 313401 1937720 12994560 83 Linux
What do I set for 17 as well?
I can't get the tables to add up to what u got so i copied the start and ending for each.
Stuck on 16/17 need some help.
Edit --
I was able to flash stock! But i get a bunch of errors about opening cache and mounting.
rfs format failed on /dev/block/mmcblk0p15
Jistropy said:
I got up to block 16 but it says i over pass the cylendars
Code:
/dev/block/mmcblk0p16 64181 313396 1993728 83 Linux
/dev/block/mmcblk0p17 313401 1937720 12994560 83 Linux
What do I set for 17 as well?
I can't get the tables to add up to what u got so i copied the start and ending for each.
Stuck on 16/17 need some help.
Edit --
I was able to flash stock! But i get a bunch of errors about opening cache and mounting.
rfs format failed on /dev/block/mmcblk0p15
Click to expand...
Click to collapse
Yes, you were able to flash but your device is still useless because partition 16 and 17 are wrongly built.
may be you entered the right numbers but resulting in wrong recording , check your print (p) attached.
It is perfect until partition 16 beginning..
.Now just delete and rewrite 16 and 17th. (end n°17 by +k instruction will fill the gap and give you the right number or enter 242432 blocks as follow .
Vdev/block/mmcblk0p17 313401 242432 ........... result dotted should give some 5252096 kb.
Then write and print again in order to check your good work and at this point your next flashing will be good! (may be a wipe cache to be sure and avoid bootloop)
other suggestion is you come to my home tomorrow morning in order I arrange that for you!!!!
Cheers
It is perfect until partition 16 beginning..
.Now just delete and rewrite 16 and 17th. (end n°17 by +k instruction will fill the gap and give you the right number or enter 242432 blocks as follow .
Vdev/block/mmcblk0p17 313401 242432 ........... result dotted should give some 5252096 kb.
Then write and print again in order to check your good work and at this point your next flashing will be good! (may be a wipe cache to be sure and avoid bootloop)
Click to expand...
Click to collapse
What do I put for 0p16 then? Sorry I'm making sure i dont mess up
Tried following the same 16 and it went through however for block 17 the number value is too high
Jistropy said:
What do I put for 0p16 then? Sorry I'm making sure i dont mess up
Tried following the same 16 and it went through however for block 17 the number value is too high
Click to expand...
Click to collapse
Quick because it is lunch time here...
P16 is the same as in the 16gb table.
/dev/block/mmcblk0p16 64181 313396 1993728 83 Linux
ok ,got it?
No risk you mess the device, only take care to verify what is done by (p) print instruction and check the written table.
it doesnt allow me to set that value.. im sorry
Jistropy said:
it doesnt allow me to set that value.. im sorry
Click to expand...
Click to collapse
Did you delete the partition before rewriting it?
Should work because you have enough numbers of blocks to fill as said.
If no success do as follow:
delete p16 and 17, then do a write and post the result you get.
here: (I dont have enough space for every 16, or 17)
but im glad you've gotten me this far.
Jistropy said:
here: (I dont have enough space for every 16, or 17)
but im glad you've gotten me this far.
Click to expand...
Click to collapse
Sorry i didn't check it first but you are 4 heads mode (read line 2 of your print) that explain wy your lack of blocks.
You shoud reset fdisk in secondary menu to 1 head like following example
1 heads, 16 sectors/track,
Units = cylinders of 16 * 512 = 8192 bytes
I have no means to open fdisk from here to guide you, but it is easy to find once understood.
I come back in 3 hours time and if you still have pb I'll check for more guidance.
OK?
ADD;
How to change heads number?
select (h) to change number of heads in expert menu (m)
(now you are the "expert") you should get some 970 000 cylinders to split.
For more details:
http://linux.omnipotent.net/article.php?article_id=6979
doing this will allow you to successfully complete your memory table. great!

[U] [GB+JB] Repartitioning guide

Thanks to @munjeni for tipping me off in the right direction and to @judas1977 + @Tesla-MADAL93 for having done this on the Ace 2 I come from ~~
Everything else in this post applies to Gingerbread, scroll down to the 5th message for a more clear guide centered around a 4.1.2 ROM.
This is my annotated diary about the last 2 hours, I'm sorry if the story feels a little bit Dadaist but I don't want to encourage people who don't feel ready to try it, so please read all of it first and if anything is unclear ask instead of doing!!
I installed Busybox 1.22.1 (iirc) and replaced the default shell with bash (install Bash-X from market, copy /S/xbin/bash over /S/bin/sh, remove app if you like to). All of this was done with Gingerbread .188 and CWM 5.5.0.4 from Supercharged kernel.
Original partition table, with names added:
[email protected]:~$ adb shell
Code:
sh-4.2# fdisk -u -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 7944 MB, 7944011776 bytes
4 heads, 16 sectors/track, 242432 cylinders, total 15515648 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 2047 1023+ 0 Empty #### TA ("Trim Area") IMEI, BL UNLOCK, SIMLOCK ETC -- DO NOT TOUCH
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 2304 3327 512 f0 Linux/PA-RISC boot #### SBL? Mem-init? Power management? PARAM?
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 2048 2303 128 f0 Linux/PA-RISC boot #### unknown, as above
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 3328 15269887 7633280 5 Extended #### GROUPS ALL FOLLOWING PARTITIONS FOR THEM TO FIT INTO THE 4-PARTS MBR SCHEME
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 4096 20479 8192 4a Unknown #### another of the 4 unclear partitions
/dev/block/mmcblk0p6 20480 26623 3072 83 Linux #### MODEMFS (Samsung's "EFS") RADIO CALIBRATION
/dev/block/mmcblk0p7 26624 36863 5120 70 Unknown #### no idea either
/dev/block/mmcblk0p8 36864 53247 8192 83 Linux #### IDD (apparently related to usage stats reporting)
/dev/block/mmcblk0p9 53248 86015 16384 48 Unknown #### KERNEL
/dev/block/mmcblk0p10 118784 2215935 1048576 83 Linux #### SYSTEM
/dev/block/mmcblk0p11 2727936 6922239 2097152 83 Linux #### DATAFS
/dev/block/mmcblk0p12 2215936 2727935 256000 83 Linux #### CACHEFS
/dev/block/mmcblk0p13 86016 118783 16384 48 Unknown #### FOTAKERNEL?
/dev/block/mmcblk0p14 6922240 15269887 4173824 c Win95 FAT32 (LBA) #### SDCARD/EMMC/UMS
Partition table entries are not in disk order
so let's rearrange this list for easier thinking & reading
Code:
/dev/block/mmcblk0p1 1 2047 1023+ TA
/dev/block/mmcblk0p3 2048 2303 128 ?
/dev/block/mmcblk0p2 2304 3327 512 ?
/dev/block/mmcblk0p5 4096 20479 8192 ?
/dev/block/mmcblk0p6 20480 26623 3072 MODEMFS
/dev/block/mmcblk0p7 26624 36863 5120 ?
/dev/block/mmcblk0p8 36864 53247 8192 IDD
/dev/block/mmcblk0p9 53248 86015 16384 KERNEL
/dev/block/mmcblk0p13 86016 118783 16384 FOTAKERNEL?
/dev/block/mmcblk0p10 118784 2215935 1048576 SYSTEM
/dev/block/mmcblk0p12 2215936 2727935 256000 CACHEFS
/dev/block/mmcblk0p11 2727936 6922239 2097152 DATAFS
/dev/block/mmcblk0p14 6922240 15269887 4173824 SDCARD
great, the important (for us) stuff is contiguous so we can delete those partitions and recreate them
(if fdisk works like parted we must do that in numerical order, so system>data>cache>ums)
we must delete and recreate partition 13 with the same sizes
OTOH fdisk lets us experiment without saving in real time (!!!) but let's do this in recovery mode
Let's research the sizes we want first -- I find Link2SD's graphical df the best way to do this (see photo 1)
so 540 MB for /system should be enough (I have 454M used, account a safety margin as I integrate updates + FS overhead + 1000 vs 1024 units)
4,14 MB used on /cache... 7,8 MB should be more than enough (same size I used on my Ace 2 which had about 5 MB used there)
this large size is for dalvik cache on ROMs that store it there (vm.dalvik.dexopt-data-only=0 and vm.dalvik.dexopt-cache-only=1 or something)
494 MB on /data, but I'd probably want to change apps and stuff... let's try with 1,25 GB
but if we remove /system we'll have to reflash the rom from a zip, which I'd need to make...
let's leave that partition alone for this first time
reboot now
Click to expand...
Click to collapse
Launching fdisk:
#### SONY
#### SONY (red green blue lightbar)
#### + button
#### CWM-based recovery v5.5.0.4
[email protected]:~$ adb shell
- exec '/system/bin/sh' failed: No such file or directory (2) -
#### No shell in ramdisk? Very lame...
#### [Mounts and storage]
#### [Mount /system, unmount everything else]
[email protected]:~$ adb shell
sh-4.2# fdisk -u /dev/block/mmcblk0
Command (m for help):
What I did in fdisk:
u #### change units to sectors
d #### delete
14
d
13
d
12
d
11
c #### disable cylinder rounding
n #### new
l #### logical partition
First sector (3334-15269887, default 3334): 2215936
Sector 2215936 is already allocated #### Apparently this version of fdisk makes you waste a sector...
First sector (2215937-15269887, default 2215937): Using default value 2215937
Last sector or +size or +sizeM or +sizeK (2215937-15269887, default 15269887): +1600M
#### CACHEFS:
n
l
First sector (3334-15269887, default 3334): 5340938
Sector 5340938 is already allocated
First sector (5340939-15269887, default 5340939): Using default value 5340939
Last sector or +size or +sizeM or +sizeK (5340939-15269887, default 15269887): +8M
#### FOTAKERNEL
n
l
First sector (3334-15269887, default 3334): 86016
Sector 86016 is already allocated
First sector (86017-15269887, default 86017): Using default value 86017
Last sector or +size or +sizeM or +sizeK (86017-118783, default 118783): Using default value 118783
t
Partition number (1-14): 13
Hex code (type L to list codes): 48
Changed system type of partition 13 to 48 (Unknown)
#### USB STORAGE
n
l
First sector (3334-15269887, default 3334): 5356564
Sector 5356564 is already allocated
First sector (5356566-15269887, default 5356566): Using default value 5356566
Last sector or +size or +sizeM or +sizeK (5356566-15269887, default 15269887): Using default value 15269887
c
Partition number (1-14): 14
Hex code (type L to list codes): c
Changed system type of partition 14 to c (W95 FAT32 LBA)
w
The partition table has been altered.
Calling ioctl() to re-read partition table
fdisk: WARNING: rereading partition table failed, kernel still uses old table: Device or resource busy
sh-4.2# reboot
Now enter CWM again and factory reset -- you'll get an error as it can't delete /sdcard/.android_secure as it's unformatted
(and for that matter this CWM can't format /sdcard either...)
No problem apart from skipped heartbeats, boot into Android and format it from the settings! (see photo 2)
Well, the last screenshot speaks for itself... but I'll repeat, don't try this at home! (Have a friend try it so you'll have someone to blame if it gets bricked)
Very interesting... It causes problems?
Inviato dal mio ST25i utilizzando Tapatalk
ale467 said:
Very interesting... It causes problems?
Click to expand...
Click to collapse
Unlike my example, you must have over 50M free on /cache (at least in Gingerbread) or cheat by bind-mounting it somewhere else... or give up on directly installing stuff from the market
I tried bind mounting /cache to /data/local/tmp/cache but Google Play is still broken, so I guess you'll want a 57M partition there...
Also, you can always return to stock layout by flashing a full ROM in green light download mode, then wiping /sdcard from settings
I'm going to update this for 4.1, it's even somewhat easier and more predictable
----------------
1: think of the rough partition sizes
Code:
system (350M)
data (1,5G)
cache (280M) ## keep in mind whether ROM uses this for dalvik-cache and at least in 2.x Google Play downloads there
sdcard (remaining space)
2: make sure you have some files ready
→ROM in recovery zip format
→Backup of everything you want
→Kernel with fdisk in ramdisk
→ADB known working in recovery and normal mode
→Fixed busybox (http://forum.xda-developers.com/attachment.php?attachmentid=1057725&d=1336884034)
3: enter recovery and dump partition table (adb shell, fdisk /dev/block/mmcblk0, p)
Unlike my previous experiment, I'll calculate sizes in cylinders -- harder but fdisk appears to work better that way
Code:
Disk /dev/block/mmcblk0: 7944 MB, 7944011776 bytes
4 heads, 16 sectors/track, 242432 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
[...]
/dev/block/mmcblk0p10 1857 34624 1048576 83 Linux #SYSTEM
/dev/block/mmcblk0p11 42625 108160 2097152 83 Linux #DATAFS
/dev/block/mmcblk0p12 34625 42624 256000 83 Linux #CACHEFS
/dev/block/mmcblk0p13 1345 1856 16384 48 Unknown #FOTAKERNEL, move this on another line if it helps you think better but put it back there after calculations
/dev/block/mmcblk0p14 108161 238592 4173824 c Win95 FAT32 #UMS
so our work area starts at cylinder 1857 and ends at 238592!
4: calculate partition sizes (I'll only list start & end cylinders for clarity)
Code:
/dev/block/mmcblk0p10 1857 12538 << 1857 + (350000000÷32768)
/dev/block/mmcblk0p11 12538+1 >> 12539 58315 << 12539+(1500000000÷32768)
/dev/block/mmcblk0p12 58315+1 >> 58316 66861 << 58316 +(280000000÷32768)
/dev/block/mmcblk0p13 1345 1856
/dev/block/mmcblk0p14 66861+1 >> 66862 238592
5: remove partitions (d, 14, d, 13, ..., 10)
6: create partitions (n, l, 1857, 12538, repeat for next row)
7: retype partitions (t, 13, 48, t, 14, c)
8: save changes (w, reboot) - enter recovery again, you should get 5 "E: Can't {mount|open} /cache/[...]" lines
9: go to mounts and storage and run all 4 formats, sdcard will probably fail -- if it doesn't skip to step 13
10: install fixed busybox (adb push '/home/riki/Desktop/busybox' /cache/)
11: enter adb shell, make it executable (chmod +x /cache/busybox)
12: format media partition (/cache/busybox mkfs.vfat /dev/block/mmcblk0p14)
13: quit shell, mount /sdcard in CWM
14: adb push your ROM to /sdcard, install it and reboot!
This is so interesting, I've being doing this on a Samsung Galaxy SCL to fix it as its internal storage and /data partition were totally corrupted. I used parted instead of fdisk to repartition the external SD and edit then kernel's RAM disk to make it mount /data in one of the new partitions. Because of this that I've been doing lately, I'm thinking of using fdisk in my Xperia U too to have more available space in internal SD, that would be great, as I use dual boot feature.
I think I'll do this when I'm be fed up of Jelly Bean being the main ROM and KitKat just the secondary one.
By the way, I think it can be possible to leave enough free space before mmcblk0p14 to create my secondary ROM's partitions there (mmcblk0p15 for /system, mmcblk0p16 for /data and mmcblk0p17 for /cache) instead of creating system.ext4, data.ext4 and cache.ext4 inside my internal SD and mounting them in loop devices... What do you think? Could I brick my phone doing that? I've asked here too just in case.
The only thing I'd have to do is to format my mmcblk0p15 using mke2fs to set the same UUID as in mmcblk0p10 just if my secondary ROM doesn't boot (but I think this wouldn't be necessary):
Code:
mke2fs -T ext4 -O has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize -U [COLOR="Silver"][mmcblk0p10's UUID][/COLOR] -I 256 /dev/block/mmcblk0p15
You've explained this how-to so well, @Ryccardo! Thanks for this tutorial.
Many, many thanks to you, sir!
Thanks to you i was able to increase data partition on my P (similar partition scheme to U).
Other tutorials weren't so useful than yours and i was searching quite a lot. Thank you, live in wealth!

[REF] I777 Partition Table & storage info.

What many refer to as the "internal SD Card" is actually a partition of the internal memory module that is formatted FAT32 for cross-platform use, and dedicated to user storage (usb transfer, downloads, photos & videos, etc). Other partitions of the internal memory module use file system formats that are more specific to the linux-based operations of Android, kernels, bootloaders, etc.
The total size of the internal memory module of the SGH-i777 is 15.8 GB, and it is partitioned as shown in the table below.
Booted into Android: Settings > Storage, you should see reports for:
- "INTERNAL STORAGE" ~2GB
- "INTERNAL STORAGE" ~11.5GB
- IF you have an SD Card installed, you should see a third report named "SD CARD"
(Using the partition table as reference)
The first "internal storage", displays the status of the /data partition. This partition is populated by user-installed apps & data, as well as the user-specific data for /system apps.
The second "internal storage", displays the status of the user-storage partition.
Stock I777 Partition Table:
Code:
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 317MB 262MB ext4 CACHE
8 317MB 333MB 16.8MB MODEM
9 333MB 870MB 537MB ext4 FACTORYFS
10 870MB 3018MB 2147MB ext4 DATAFS
11 3018MB 15.2GB 12.2GB fat32 UMS
12 15.2GB 15.8GB 537MB ext4 HIDDEN
The path to user-storage (both internal and external) may vary from Android when booted into recovery.
Booted into Android
internal & external user-storage are located at /storage/sdcard0 & /storage/sdcard1
Code:
mount
/dev/block/vold/179:9 /mnt/media_rw/sdcard1 vfat rw,dirsync,context=u:object_r:sdcard_external:s0,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other,blksize=4096 0 0
/dev/fuse /storage/sdcard1 fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/block/vold/259:3 /mnt/media_rw/sdcard0 vfat rw,dirsync,context=u:object_r:sdcard_external:s0,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other,blksize=4096 0 0
/dev/block/vold/259:3 /mnt/secure/asec vfat rw,dirsync,context=u:object_r:sdcard_external:s0,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other,blksize=4096 0 0
/dev/fuse /storage/sdcard0 fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
Booted into CWMR
internal & external user-storage are located at /storage/sdcard0 & /storage/sdcard1
Code:
mount
/dev/block/vold/259:3 on /storage/sdcard0 type vfat (rw,dirsync,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other,blksize=4096)
/dev/block/vold/179:9 on /storage/sdcard1 type vfat (rw,dirsync,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other,blksize=4096)
Booted into TWRP
internal & external user-storage are located at /emmc & /sdcard
These path names more appropriately represent the type of memory used. eMMC = embedded Multimedia Card
http://en.wikipedia.org/wiki/MultiMediaCard#eMMC
http://www.pcmag.com/encyclopedia/term/64404/emmc
The inconsistency with android's naming system can be an issue for apps that write OpenRecoveryScripts while booted into android, to be performed in recovery.
Code:
mount
/dev/block/mmcblk0p11 on /emmc type vfat (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,max_read=131072,blksize=4096)
/dev/block/mmcblk0p11 on /and-sec type vfat (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,max_read=131072,blksize=4096)
/dev/block/mmcblk1p1 on /sdcard type vfat (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,max_read=131072,blksize=4096)
Code:
TWRP CWMR & AOSP Device Label FileSys size (MB)
mmcblk0 179:0
mmcblk0p /efs /efs 179:1 EFS ext4 20
mmcblk0p2 179:2 SBL1 1.2
mmcblk0p3 179:3 SBL2 1.2
mmcblk0p4 179:4 PARAM 8
mmcblk0p5 /boot /boot 179:5 KERNEL 8
mmcblk0p6 /recovery /recovery 179:6 RECOVERY 8
mmcblk0p7 /cache /cache 179:7 CACHE ext4 246
mmcblk0p8 259:0 MODEM 16
mmcblk0p9 /system /system 259:1 FACTORYFS ext4 504
mmcblk0p10 /data /data 259:2 DATAFS ext4 2016
mmcblk0p11 /emmc /storage/sdcard0 259:3 UMS FAT32 11634
mmcblk0p12 /preload /preload 259:4 HIDDEN ext4 504
mmcblk1 179:8
mmcblk1p1 /sdcard /storage/sdcard1 179:9 {whatevr} FAT32 {as purchased}
This information above was helpful for me recently, and although these devices are well aged, I hope that the info. can be useful for someone else.
We have @SteveMurphy and @razen_kain to thank for encouraging me to compile and post this stuff.
From an ADB shell, or within a terminal emulator, "mount" will give you a report of the currently mounted devices, and their mount points, permissions and more.
The original partition table posted is reported from gparted, within an ADB shell
adb devices
^if it returns your device serial, then ADB can see your device
adb shell
^starts a shell session on the device
parted /dev/block/mmcblk0
^starts a gparted session on disk "mmcblk0", the internal memory module
print
^displays the partition table
If I have any of this information incorrect, or if there's more information that should be included, please let me know.
There's an entire world of fstab, device mapping, and volume daemons that I am NOT savvy with, so I chose not to run down that rabbit hole.
This is fantastic stuff! I know you put a lot of work into it, so thanks for all the research you've accumulated and shared.
cyril279,
Very helpful info. Nice job on compiling and posting the info. Thanks for taking the time to do it and for continuing to help in this forum.
Sent from my SAMSUNG-SGH-I777 using Tapatalk
Great work man! We really appreciate you putting your time and effort into this. I am curious though what the 959g looks like. I know the recovery is on a different partition but that is the only difference Im aware of.
We would only know for sure if we analyze a 959 phone, but I'm going to guess that the partition table would be exactly the same. Notice that mmcblk0p6 is Recovery, and on the I777 that partition is not used.
so I wanted to try this but my android says:
Code:
C:\Users\Allan Romero>adb shell
[email protected]:/ $ parted /dev/block/mmcblk0
parted /dev/block/mmcblk0
/system/bin/sh: parted: not found
127|[email protected]:/ $
is there a way to fix this, I wanted to compare the partition tables of my SGH-S959G to the SGH-I777, reason being was that when I go to download mode it says model S959G and I wanted to see if it can be changed to show the i777 under model.
micallan_17 said:
so I wanted to try this but my android says:
Code:
C:\Users\Allan Romero>adb shell
[email protected]:/ $ parted /dev/block/mmcblk0
parted /dev/block/mmcblk0
/system/bin/sh: parted: not found
127|[email protected]:/ $
is there a way to fix this, I wanted to compare the partition tables of my SGH-S959G to the SGH-I777, reason being was that when I go to download mode it says model S959G and I wanted to see if it can be changed to show the i777 under model.
Click to expand...
Click to collapse
Did you boot into recovery before you ran adb shell? First boot into recovery, next type adb shell and you will get a ~ # prompt, then type parted /dev/block/mmcblk0 followed by print.
creepyncrawly said:
Did you boot into recovery before you ran adb shell? First boot into recovery, next type adb shell and you will get a ~ # prompt, then type parted /dev/block/mmcblk0 followed by print.
Click to expand...
Click to collapse
Oh I see, your tip fixed it, so I got this:
Code:
C:\Users\Allan Romero>adb shell
~ # 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
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 317MB 262MB ext4 CACHE
8 317MB 333MB 16.8MB MODEM
9 333MB 870MB 537MB ext4 FACTORYFS
10 870MB 3018MB 2147MB ext4 DATAFS
11 3018MB 15.2GB 12.2GB fat32 UMS
12 15.2GB 15.8GB 537MB ext4 HIDDEN
(parted)
someone with more inside knowledge can let us know if there are any differences perhaps?
so based on comparison by looks:
code from cyril279:
Code:
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 317MB 262MB ext4 CACHE
8 317MB 333MB 16.8MB MODEM
9 333MB 870MB 537MB ext4 FACTORYFS
10 870MB 3018MB 2147MB ext4 DATAFS
11 3018MB 15.2GB 12.2GB fat32 UMS
12 15.2GB 15.8GB 537MB ext4 HIDDEN
code from mines:
Code:
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 317MB 262MB ext4 CACHE
8 317MB 333MB 16.8MB MODEM
9 333MB 870MB 537MB ext4 FACTORYFS
10 870MB 3018MB 2147MB ext4 DATAFS
11 3018MB 15.2GB 12.2GB fat32 UMS
12 15.2GB 15.8GB 537MB ext4 HIDDEN
is it safe to say that flashing the i777 bootloader (odin screen one) to the SGH-S959G would basically convert it to an i777?
micallan_17 said:
is it safe to say that flashing the i777 bootloader (odin screen one) to the SGH-S959G would basically convert it to an i777?
Click to expand...
Click to collapse
I suppose, but what I don't get is why it matters? The devices are practically identical, excepting the 959 having the separate partition which is a great thing and something the i777/i9100 lacks.
So what I'm asking is because our two phones are almost the same and can flash the same roms/kernels/recovery, what does it matter if it says '959' or 'i777'?
SteveMurphy said:
I suppose, but what I don't get is why it matters? The devices are practically identical, excepting the 959 having the separate partition which is a great thing and something the i777/i9100 lacks.
So what I'm asking is because our two phones are almost the same and can flash the same roms/kernels/recovery, what does it matter if it says '959' or 'i777'?
Click to expand...
Click to collapse
oh, I see I didn't know about the separate partition, I guess it doesn't really matter what it says on it, thanks for the reply
Cheers
Great info. Thanks fellas.
anyone fhave a new pit file for the s959g to increase system partition been searching for hours or would the one for the i777 work fine. I don't want to loose my separate recovery partition. I want to be able in install full slim gaaps
Created one don't need now.

[Q] Merge /data and internal storage

Hi, I noticed there are about two similar threads but focusing on slightly different things so I am starting a new one.
I have ZLR F9006 (aka. ALPS F9006 or STAR F9006). It's a MT6582 cheap nobrand phone.
It has 4GB internal memory divided into several partitions. Since I have a 32 GB sdcard in it,
I find the existance of 1GB internal sd partition very annoying and I would like to merge that space
to /data instead, completely vanishing the internal_sd.
I have installed CWM Touch and booted into it. Here is df in recovery via adb:
Code:
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 497520 48 497472 0% /dev
/[email protected] 127044 4208 122836 3% /cache
/dev/block/mmcblk1 31159328 6732768 24426560 22% /sdcard
/[email protected] 1029872 47888 981984 5% /emmc
/[email protected] 1828400 1133596 694804 62% /data
/[email protected] 706392 488788 217604 69% /system
/sbin # cd /emc
(usrdata=/data, emmc=internal storage)
I installed parted but I get this error:
Code:
~ # parted /dev/block/mmcblk0 print
parted /dev/block/mmcblk0 print
Error: Can't have a partition outside the disk!
I know this is the internal memory because mmcblk1 is the SD card (and opening it in parted works).
I have these block devices:
Code:
/dev/block # ls
ls
loop0 loop4 mmcblk0 mmcblk0p2 mmcblk0p6 platform
loop1 loop5 mmcblk0boot0 mmcblk0p3 mmcblk0p7 zram0
loop2 loop6 mmcblk0boot1 mmcblk0p4 mmcblk0p8
loop3 loop7 mmcblk0p1 mmcblk0p5 mmcblk1
As you can see, there are 8 partitions on the internal block device, with the p7 being the /data partition:
Code:
/dev/block # parted /dev/block/mmcblk0p7 print
parted /dev/block/mmcblk0p7 print
Model: Unknown (unknown)
Disk /dev/block/mmcblk0p7: 1900MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 1900MB 1900MB ext4
And the p8 being the internal SD i want to get rid of:
Code:
/dev/block # parted /dev/block/mmcblk0p8 print all
parted /dev/block/mmcblk0p8 print all
Model: Generic SD/MMC Storage Card (sd/mmc)
Disk /dev/block/mmcblk0p8: 1055MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
(Strangely enough, you can't see the filesystem on those, but the msdos partition table and size fits.)
I was hoping I would simply delete that p8 and then expand the p7 to the remaining size, all that
should be perfectly doable with parted without even losing data (apart from few empty dirs on the p8).
But I highly doubt I can do it by directly calling parted on that specific partitions, I think that I need to make
it work calling it for the whole /dev/block/mmcblk0 (could someone confirm this?).
If yes, how can I make that happen?
You're likely to brick your phone if you do it that way. Take a look here on how to repartition your internal memory. It's for MT6577, but I think it could be of relevance to your situation.
Thanks, this is very relevant. This is how my block table looks like (attached). I was right about the partitions being the last (but i am not sure about the bmtpool at the end).

Partitioning mmcblk0 with Gparted

I have encountered a problem with partitioning my J320FN.. I mounted mmcblk0 which is the root directory of the device and contains partitions 1-27. I wish to make the system partition smaller (since my system folder is 1.2gb smaller than the official) and give that space to userdata which will then be available and usuable even in Smart Manager.
The problem begins with the SYSTEM and userdata partitions not being consecutive... I have a HIDDEN partition between them
[email protected]:/ $ su
[email protected]:/ # 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) p
p
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? i
i
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 16384 blocks) or
continue with the current setting?
Fix/Ignore? i
i
Model: MMC QN16BB (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
25 344MB 2491MB 2147MB ext4 SYSTEM
26 2491MB 2701MB 210MB ext4 HIDDEN
27 2701MB 7806MB 5104MB ext4 userdata
Click to expand...
Click to collapse
Now, the thing this hidden partition is the same size as the CACHE partition which is located at partition 24 mmcblk0p24 /CACHE and is 210mb(exact same size in bytes)
24 134217728B 343932927B 209715200B ext4 CACHE
25 343932928B 2491416575B 2147483648B ext4 SYSTEM
26 2491416576B 2701131775B 209715200B ext4 HIDDEN
27 2701131776B 7805599743B 5104467968B ext4 userdata
Click to expand...
Click to collapse
Im kinda worried about what is in the hidden partition as i will need to dd it out and back in after creating the partition anew.. Anyone know what is stored in hidden partition or how to pull it? dd doesn't give an output file with .img or .zip, they're just broken files...
TIA
Peace [emoji1]
Bump..

Categories

Resources