[Q] ADB Shell help? - Samsung Galaxy Player 4.0, 5.0

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!

Related

[Q] Corrupt GPT?

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

[Q] [ANSWERED] EMMC Repartition/Format when unmountable

FIXED!
I took a stab in the dark after doing a pull of the partitions to my backup hard drive and formatted the last, and largest partition on the list. It calculated out to about what my internal storage was supposed to be, which made me fairly confident that it was the one.
Code:
newfs_msdos -F 32 /dev/block/mmcblk0p28
I tossed that little command into the shell through adb and /emmc/ mounted right up.
Hey guys, I seem to have corrupted my mmcblk0 rather well. mmcblk0p1-4 have no bounds. (Edit 4: This sounds rather silly now that I know more of what I'm looking at. mmcblk0p4 contains all of the partitions after it. partitions 1 - 4 just don't fall on the cylinder lines like the file system expects it to) Anyway, I was wondering if anyone would be kind enough to either copy/paste a stock emmc partition table (/dev/block/mmcblk0), or toss together a CWM flashable that reformats it properly so I can get my internal storage back.
An example of what I'm talking about:
http://forum.xda-developers.com/showpost.php?p=25436995&postcount=2
Thanks!
What my partition table looks like...
Code:
Disk /dev/block/mmcblk0: 15.7 GB, 15758000128 bytes
1 heads, 16 sectors/track, 1923584 cylinders
Units = cylinders of 16 * 512 = 8192 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 12801 102400 92 Unknown
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 * 12801 12863 500 4d Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 12863 13051 1500 51 Unknown
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 13051 1923584 15284271+ 5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 13313 13375 500 47 Unknown
/dev/block/mmcblk0p6 13825 14080 2048 45 Unknown
/dev/block/mmcblk0p7 14337 14649 2500 4c Unknown
/dev/block/mmcblk0p8 14849 16128 10240 48 Unknown
/dev/block/mmcblk0p9 16385 16447 500 46 Unknown
/dev/block/mmcblk0p10 16897 16959 500 5d Unknown
/dev/block/mmcblk0p11 17409 17471 500 91 Unknown
/dev/block/mmcblk0p12 17921 19200 10240 93 Unknown
/dev/block/mmcblk0p13 19457 32000 100352 c Win95 FAT32 (LBA)
/dev/block/mmcblk0p14 32257 32640 3072 4a Unknown
/dev/block/mmcblk0p15 32769 33152 3072 4b Unknown
/dev/block/mmcblk0p16 33281 33664 3072 58 Unknown
/dev/block/mmcblk0p17 33793 46336 100352 8f Unknown
/dev/block/mmcblk0p18 46593 46976 3072 59 Unknown
/dev/block/mmcblk0p19 47105 47488 3072 5a Unknown
/dev/block/mmcblk0p20 47617 48000 3072 5b Unknown
/dev/block/mmcblk0p21 48129 49408 10240 ab Darwin boot
/dev/block/mmcblk0p22 49665 50944 10240 60 Unknown
/dev/block/mmcblk0p23 51201 52480 10240 94 Unknown
/dev/block/mmcblk0p24 52737 183808 1048576 a5 FreeBSD
/dev/block/mmcblk0p25 183809 446208 2099200 a6 OpenBSD
/dev/block/mmcblk0p26 446465 485120 309248 a8 Darwin UFS
/dev/block/mmcblk0p27 485377 501888 132096 a9 NetBSD
/dev/block/mmcblk0p28 502273 1923584 11370496 90 Unknown
Edit: I can tcp/ip adb into the device now. Still not sure what's up with my usb connectivity.
Both TWRP and CWM repartition. Have you tried them?
fprice02 said:
Both TWRP and CWM repartition. Have you tried them?
Click to expand...
Click to collapse
Yes, CWM. It can't mount /emmc/ which is why I'm trying to do it this way. I've spent most of the afternoon going through the steep learning curve that is android/linux file systems on a windows machine. Partition 4 actually contains all the partitions after it, which makes it more fun to figure out which one is the internal storage partition(s).
FIXED
So I fixed it. I took a stab in the dark after doing a pull of the partitions to my backup hard drive and formatted the last, and largest partition on the list. It calculated out to about what my internal storage was supposed to be, which made me fairly confident that it was the one.
Code:
newfs_msdos -F 32 /dev/block/mmcblk0p28
I tossed that little command into the shell through adb and /emmc/ mounted right up.
MSDOS......classic on a linux platform.

[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] partition issue with mediatek n9002 note 3 clone

i just got a Star/Ulefone n9002 mediatek based clone of a Samsung Galaxy Note 3. the phone is pretty nice... i'm liking it. specs on it are pretty good, but i am having an issue with the internal SD card. when i ordered it, it was suppose to come with an 8gb internal SD card. i got it, took it out of the box and checked, and the system specs said that it had a 16GB internal card. originally, i thought, "Bonus!!" but the more i thought about it, the more i realized that this is probably bogus or an issue with whatever rom is flashed on it. checking needrom.com there are 2 rom images out there for it and they both list the original specs for an 8gb internal card. when i started loading things on it, i suddenly started to get strange errors about running out of space. it didn't make much sense. anyway, i rooted it with mtk droid tools, installed the custom CWM, and what not, and started poking under the hood. fdisk is giving me errors and parted refuses to even work on it. (maybe i am running the wrong commands, but attached are outputs).
anyway, i already know there is an issue with the ROM cause MTK Droid tools reports that it has an mt6582 cpu even though the software on the phone reports and mt6589. all of the roms say it should be an mt6582 also. not a big deal in my opinion.
my question is this... is there anyway to non-destructively fix the partition table? i have read alot about editing the EBR files to change partition sizes, but there has got to be a better way. also, i'd like to truely verify the size of the built in storage without opening up the phone and reading the numbers off of the internal SD card.
should i just get the latest ROM off of needrom.com and flash it? i don't know if this would fix the partition table either.
here are the outputs:
fdisk output:
1|[email protected]_wet_v116_jb5:/ # fdisk /dev/block/mmcblk0
fdisk /dev/block/mmcblk0
The number of cylinders for this disk is set to 951232.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: ignoring extra data in partition table 5
Warning: ignoring extra data in partition table 5
Command (m for help): v
v
Partition 2 does not end on cylinder boundary
Partition 2: sector 0 greater than maximum 16
Partition 3 does not end on cylinder boundary
Partition 3: sector 0 greater than maximum 16
Partition 4 does not end on cylinder boundary
Partition 4: sector 0 greater than maximum 16
Partition 5: sector 0 greater than maximum 16
Partition 6: sector 0 greater than maximum 16
Logical partition 5 not entirely in partition 1
Total allocated sectors 4290439170 greater than the maximum 15219712
Command (m for help): p
p
Disk /dev/block/mmcblk0: 7792 MB, 7792492544 bytes
1 heads, 16 sectors/track, 951232 cylinders
Units = cylinders of 16 * 512 = 8192 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 65 64 2147483647+ 5 Extended
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 1153 2432 10240 83 Linux
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 2433 3712 10240 83 Linux
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 5313 6080 6144 83 Linux
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 8129 97728 716800 83 Linux
/dev/block/mmcblk0p6 376001 64 2144476159+ 83 Linux
Command (m for help):
Click to expand...
Click to collapse
gdisk output:
[email protected]_wet_v116_jb5:/system/xbin # gdisk
gdisk
GPT fdisk (gdisk) version 0.8.4
Type device filename, or press to exit: /dev/block/mmcblk0
/dev/block/mmcblk0
EBR signature for logical partition invalid; read 0x0000, but should be 0xAA55
Error reading logical partitions! List may be truncated!
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format.
THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by typing 'q' if
you don't want to convert your MBR partitions to GPT format!
***************************************************************
Command (? for help): v
v
No problems found. 13732797 free sectors (6.5 GiB) available in 4
segments, the largest of which is 13656031 (6.5 GiB) in size.
Click to expand...
Click to collapse
parted output:
1|[email protected]_wet_v116_jb5:/system/xbin # 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) check
check
check
Error: Can't have a partition outside the disk!
(parted) print devices
print devices
print devices
Error: Can't have a partition outside the disk!
(parted) print all
print all
print all
Error: Can't have a partition outside the disk!
(parted)
Click to expand...
Click to collapse
/proc/mounts:
rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/secure tmpfs rw,relatime,mode=700 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
/[email protected] /system ext4 rw,relatime,noauto_da_alloc,commit=1,data=ordered 0 0
/[email protected] /data ext4 rw,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered 0 0
/[email protected] /cache ext4 rw,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered 0 0
/[email protected]_f /protect_f ext4 rw,nosuid,nodev,noatime,nodelalloc,noauto_da_alloc,commit=1,data=ordered 0 0
/[email protected]_s /protect_s ext4 rw,nosuid,nodev,noatime,nodelalloc,noauto_da_alloc,commit=1,data=ordered 0 0
/dev/block/loop0 /mnt/cd-rom iso9660 ro,relatime 0 0
/dev/block/vold/179:97 /storage/sdcard0 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:97 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /storage/sdcard0/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0
/dev/block/vold/179:8 /storage/sdcard1 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
Click to expand...
Click to collapse
/proc/partitons
major minor #blocks name
7 0 1254 loop0
7 1 11451 loop1
253 0 524288 zram0
179 0 7609856 mmcblk0
179 1 1 mmcblk0p1
179 2 10240 mmcblk0p2
179 3 10240 mmcblk0p3
179 4 6144 mmcblk0p4
179 5 716800 mmcblk0p5
179 6 129024 mmcblk0p6
179 7 2097152 mmcblk0p7
179 8 4601856 mmcblk0p8
179 64 4096 mmcblk0boot1
179 32 4096 mmcblk0boot0
179 96 31166976 mmcblk1
179 97 31162880 mmcblk1p1
Click to expand...
Click to collapse
progress...
i take it by the deafening number of replys, no one has any idea whats up with my issue or any idea how to fix it. so i have been digging deeper myself and think i have come up with some solutions.
first of all, i was just planing on flashing one of the roms off of the NeedRom.com website, but i read a couple of posts on chinaphonearena.com and one in some german forum that listed a phone with my same baseband and ROM build, and when they flashed the new rom, it screwed up their touch screen. something about having an incompatible touch screen driver. i don't know if the person flashing the rom chose the correct rom, or incorrect rom, but it made me skidish to attempt this as a fix.
so i checked in on modifying the EBR files, which people have been doing on these mediatek phones for a while. i thought maybe one of mine was screwed up. i extracted the EBR1 and EBR2 file from my fine with MTKDroidTools and i pulled the files out of the rom update. i also took the scatter file generated by MTKDroidTools and the scatter file from the rom update. i compared them line for line. the EBR files are totally identical! as was the scatter file. address of where the partitions start and stop inside the phone are 100% the same. so flashing a new rom wouldn't have fixed the problem anyway.
i started googling around at the error that parted gives me: "Error: Can't have a partition outside the disk!" this is discussed elsewhere, but mostly on actual machines, not phones. there are some postings here on XDA, but none that address my specific issue. anyway, the ways it always suggests to fix it is to figure out which partition is oversized, used the sfdisk utility to dump the partiton table, fix it, and re-write the partition table to disk. simple enough, if you know what your partition table should look like.
back to fdisk, i reprint out a copy
1|[email protected]_wet_v116_jb5:/ # fdisk /dev/block/mmcblk0
fdisk /dev/block/mmcblk0
The number of cylinders for this disk is set to 951232.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: ignoring extra data in partition table 5
Warning: ignoring extra data in partition table 5
Command (m for help): v
v
Partition 2 does not end on cylinder boundary
Partition 2: sector 0 greater than maximum 16
Partition 3 does not end on cylinder boundary
Partition 3: sector 0 greater than maximum 16
Partition 4 does not end on cylinder boundary
Partition 4: sector 0 greater than maximum 16
Partition 5: sector 0 greater than maximum 16
Partition 6: sector 0 greater than maximum 16
Logical partition 5 not entirely in partition 1
Total allocated sectors 4290439170 greater than the maximum 15219712
Command (m for help): p
p
Disk /dev/block/mmcblk0: 7792 MB, 7792492544 bytes
1 heads, 16 sectors/track, 951232 cylinders
Units = cylinders of 16 * 512 = 8192 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 65 64 2147483647+ 5 Extended
/dev/block/mmcblk0p2 1153 2432 10240 83 Linux
/dev/block/mmcblk0p3 2433 3712 10240 83 Linux
/dev/block/mmcblk0p4 5313 6080 6144 83 Linux
/dev/block/mmcblk0p5 8129 97728 716800 83 Linux
/dev/block/mmcblk0p6 376001 64 2144476159+ 83 Linux
Click to expand...
Click to collapse
this does indeed tell me that the internal flash memory is about 8gb (Disk /dev/block/mmcblk0: 7792 MB, 7792492544 bytes) but it is not obvious to me which partition is screwed up.
anyway, i'd love for someone that has an mtk6582 based phone with 8gb of internal storage to provide me with a dump of their partition table, then i could just restore it over mine, and it should fix the issue!... the command is simple...
adb shell
su
sfdisk -d /dev/sdc > PT.txt
Click to expand...
Click to collapse
from what i see (i may be wrong here) but these phones run with something like 2 partition tables... there is the one that is physically connected to the first 512 bytes of the SD card. then they have the EBR's which map out all of the EMMC partitons. so there is just one big partition seen from the outside, but through software, we can map that big partition in to smaller ones by knowing start and end addresses inside that big partition. i tell you, it is confusing.
i'm sure if i use the spflash_tool and format my phone and re-install a rom, it would fix the problem, but i am nervous about doing that because so many people have had issues putting rom's on this phone. they report that even when going back to their original backup the touch screen issues persist.
anyone have any comments? any ideas? any mbr backup they could share with me?
I believe you read my thread in chinese forum, I have one here too, because my touch is not working well since the rom upgrade.
Anyway, I'm almost sure you have like me a STAR Ulefone N9002 MTK6582 (1.3GHz) with 8Gb total memory.
AnTuTu 17500 values are 6582, 13000 are 6589T.
The original ROM have 1Gb RAM, 2Gb Internal Memory, and 8Mpx camera.
The ROM you have, and the MARCH Rom Update of Needrom, make the fake values, and the ram and internal memory are not correct. The camera is updated to 13Mpx too.
If you want, here you could read the procedure to edit the MBR by yourself.
Or you could flash the JAN rom of needrom.
I'm not sure about what cause my touch to get screwed, I guess I will never know, but I will keep flashing my phones...
At the moment, I'm waiting for a new touch for replace.
Cheers and good luck.
PMoto.

Categories

Resources