Falcon Partition Layout

Bert98

Senior Member
Jul 24, 2012
1,091
393
0
22
Padova
As far as I know, ~20Mb should be enough for the cache partition. Any way to repartition the storage? Like 1Gb system, 20Mb cache, 6.5Gb data?

Inviato dal mio Moto G utilizzando Tapatalk
 

DoctorStrange96

Senior Member
Feb 21, 2014
1,616
2,374
153
Belém
Layout from my Moto G with a different logic board (which has a Samsung eMMC chip). Note how the /userdata partition has a smaller size (4.52 GiB with this chip instead of 5.55 GiB with the old sandisk one)
Code:
[email protected]_umtsds:/ # cat /proc/partitions
major minor  #blocks  name
   7        0       3072 loop0
 253        0     262144 zram0
 179        0    7634944 mmcblk0
 179        1      65536 mmcblk0p1
 179        2        512 mmcblk0p2
 179        3         32 mmcblk0p3
 179        4        512 mmcblk0p4
 179        5        200 mmcblk0p5
 179        6        400 mmcblk0p6
 179        7         32 mmcblk0p7
 179        8        512 mmcblk0p8
 179        9       2048 mmcblk0p9
 179       10       2332 mmcblk0p10
 179       11        512 mmcblk0p11
 179       12        200 mmcblk0p12
 179       13        400 mmcblk0p13
 179       14         32 mmcblk0p14
 179       15        512 mmcblk0p15
 179       16       1052 mmcblk0p16
 179       17       1536 mmcblk0p17
 179       18       1536 mmcblk0p18
 179       19        512 mmcblk0p19
 179       20          8 mmcblk0p20
 179       21       1536 mmcblk0p21
 179       22          1 mmcblk0p22
 179       23          8 mmcblk0p23
 179       24       1024 mmcblk0p24
 179       25        128 mmcblk0p25
 179       26       3072 mmcblk0p26
 179       27       4096 mmcblk0p27
 179       28       4096 mmcblk0p28
 179       29       8192 mmcblk0p29
 179       30        512 mmcblk0p30
 179       31      10240 mmcblk0p31
 259        0      10240 mmcblk0p32
 259        1     678016 mmcblk0p33
 259        2     999424 mmcblk0p34
 259        3       8192 mmcblk0p35
 259        4    4743040 mmcblk0p36
 179       32        512 mmcblk0rpmb
Code:
[email protected]_umtsds:/ # ls -al /dev/block/platform/msm_sdcc.1/by-name
lrwxrwxrwx root     root              1970-02-08 03:47 DDR -> /dev/block/mmcblk0p3
lrwxrwxrwx root     root              1970-02-08 03:47 aboot -> /dev/block/mmcblk0p4
lrwxrwxrwx root     root              1970-02-08 03:47 abootBackup -> /dev/block/mmcblk0p11
lrwxrwxrwx root     root              1970-02-08 03:47 boot -> /dev/block/mmcblk0p31
lrwxrwxrwx root     root              1970-02-08 03:47 cache -> /dev/block/mmcblk0p33
lrwxrwxrwx root     root              1970-02-08 03:47 cid -> /dev/block/mmcblk0p25
lrwxrwxrwx root     root              1970-02-08 03:47 clogo -> /dev/block/mmcblk0p28
lrwxrwxrwx root     root              1970-02-08 03:47 dhob -> /dev/block/mmcblk0p20
lrwxrwxrwx root     root              1970-02-08 03:47 fsc -> /dev/block/mmcblk0p22
lrwxrwxrwx root     root              1970-02-08 03:47 fsg -> /dev/block/mmcblk0p21
lrwxrwxrwx root     root              1970-02-08 03:47 hob -> /dev/block/mmcblk0p19
lrwxrwxrwx root     root              1970-02-08 03:47 kpan -> /dev/block/mmcblk0p35
lrwxrwxrwx root     root              1970-02-08 03:47 logo -> /dev/block/mmcblk0p27
lrwxrwxrwx root     root              1970-02-08 03:47 logs -> /dev/block/mmcblk0p9
lrwxrwxrwx root     root              1970-02-08 03:47 misc -> /dev/block/mmcblk0p30
lrwxrwxrwx root     root              1970-02-08 03:47 modem -> /dev/block/mmcblk0p1
lrwxrwxrwx root     root              1970-02-08 03:47 modemst1 -> /dev/block/mmcblk0p17
lrwxrwxrwx root     root              1970-02-08 03:47 modemst2 -> /dev/block/mmcblk0p18
lrwxrwxrwx root     root              1970-02-08 03:47 padA -> /dev/block/mmcblk0p10
lrwxrwxrwx root     root              1970-02-08 03:47 padB -> /dev/block/mmcblk0p16
lrwxrwxrwx root     root              1970-02-08 03:47 pds -> /dev/block/mmcblk0p26
lrwxrwxrwx root     root              1970-02-08 03:47 persist -> /dev/block/mmcblk0p29
lrwxrwxrwx root     root              1970-02-08 03:47 recovery -> /dev/block/mmcblk0p32
lrwxrwxrwx root     root              1970-02-08 03:47 rpm -> /dev/block/mmcblk0p5
lrwxrwxrwx root     root              1970-02-08 03:47 rpmBackup -> /dev/block/mmcblk0p12
lrwxrwxrwx root     root              1970-02-08 03:47 sbl1 -> /dev/block/mmcblk0p2
lrwxrwxrwx root     root              1970-02-08 03:47 sdi -> /dev/block/mmcblk0p7
lrwxrwxrwx root     root              1970-02-08 03:47 sdiBackup -> /dev/block/mmcblk0p14
lrwxrwxrwx root     root              1970-02-08 03:47 sp -> /dev/block/mmcblk0p24
lrwxrwxrwx root     root              1970-02-08 03:47 ssd -> /dev/block/mmcblk0p23
lrwxrwxrwx root     root              1970-02-08 03:47 system -> /dev/block/mmcblk0p34
lrwxrwxrwx root     root              1970-02-08 03:47 tz -> /dev/block/mmcblk0p6
lrwxrwxrwx root     root              1970-02-08 03:47 tzBackup -> /dev/block/mmcblk0p13
lrwxrwxrwx root     root              1970-02-08 03:47 userdata -> /dev/block/mmcblk0p36
lrwxrwxrwx root     root              1970-02-08 03:47 utags -> /dev/block/mmcblk0p8
lrwxrwxrwx root     root              1970-02-08 03:47 utagsBackup -> /dev/block/mmcblk0p15
Plus it looks like this eMMC chip doesnt like /system to be mounted read-write while the system is running, it works only in recovery mode:
(part of a dmesg)
Code:
<4>[ 5495.790783,0] EXT4-fs warning (device mmcblk0p34): ext4_clear_journal_err:4232: Filesystem error recorded from previous mount: Journal has aborted
<4>[ 5495.791074,0] EXT4-fs warning (device mmcblk0p34): ext4_clear_journal_err:4233: Marking fs in need of filesystem check.
<3>[ 5495.794287,0] mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x900
<3>[ 5495.794404,0] mmcblk0: not retrying timeout
<4>[ 5495.847713,0] EXT4-fs (mmcblk0p34): warning: mounting fs with errors, running e2fsck is recommended
<3>[ 5495.849910,0] mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x900
<3>[ 5495.850101,0] mmcblk0: not retrying timeout
<6>[ 5495.903743,0] EXT4-fs (mmcblk0p34): re-mounted. Opts: (null)
<3>[ 5495.910974,0] mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x900
<3>[ 5495.911170,0] mmcblk0: not retrying timeout
------------------------------------------------
After trying to mount /system r/w via adb shell:
Code:
<4>[ 5776.638709,0] ------------[ cut here ]------------
<4>[ 5776.638960,0] WARNING: at drivers/mmc/host/msm_sdcc.c:3670 msmsdcc_enable+0xe8/0x1c4()
<4>[ 5776.639471,0] mmc0: msmsdcc_enable: failed with error -22
<4>[ 5776.639701,0] [<c0111ce0>] (unwind_backtrace+0x0/0xe8) from [<c01a04b8>] (warn_slowpath_fmt+0x60/0xd4)
<4>[ 5776.640065,0] [<c01a04b8>] (warn_slowpath_fmt+0x60/0xd4) from [<c08053f8>] (msmsdcc_enable+0xe8/0x1c4)
<4>[ 5776.640428,0] [<c08053f8>] (msmsdcc_enable+0xe8/0x1c4) from [<c07df56c>] (__mmc_claim_host+0x1d8/0x1e4)
<4>[ 5776.640793,0] [<c07df56c>] (__mmc_claim_host+0x1d8/0x1e4) from [<c07f8aa0>] (mmc_blk_issue_rq+0x4d0/0xa58)
<4>[ 5776.641158,0] [<c07f8aa0>] (mmc_blk_issue_rq+0x4d0/0xa58) from [<c07fa8d8>] (mmc_queue_thread+0xa0/0x170)
<4>[ 5776.641520,0] [<c07fa8d8>] (mmc_queue_thread+0xa0/0x170) from [<c01c9640>] (kthread+0x90/0x94)
<4>[ 5776.641742,0] [<c01c9640>] (kthread+0x90/0x94) from [<c010c398>] (kernel_thread_exit+0x0/0x8)
<4>[ 5776.642083,0] ---[ end trace e79894eed47e1f81 ]---
<3>[ 5776.642275,0] mmc0: PM: sdcc_suspended=0, pending_resume=0, sdcc_suspending=0
<3>[ 5776.642619,0] mmc0: RPM: runtime_status=0, usage_count=1, is_suspended=0, disable_depth=0, runtime_error=-110, request_pending=0, request=0
<3>[ 5776.648812,0] mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x900
<3>[ 5776.649153,0] mmcblk0: not retrying timeout
 
Last edited:

sub77

Senior Member
Nov 2, 2010
1,740
2,653
153
Layout from my Moto G with a different logic board (which has a Samsung eMMC chip). Note how the /userdata partition has a smaller size (4.52 GiB with this chip instead of 5.55 GiB with the old sandisk one)

Plus it looks like this eMMC chip doesnt like /system to be mounted read-write while the system is running, it works only in recovery mode:
(part of a dmesg)
Samsung ... what do you expect?
 

DoctorStrange96

Senior Member
Feb 21, 2014
1,616
2,374
153
Belém
Samsung ... what do you expect?
Samsung doing *****, as always... lol

Anyways, i tried to get a board replacement to get that 1GB back (since theres no way to repartition the existing one) but the guys at service center apparently had no idea what i was talking about...

Well, if anyone finds a way to repartition the G's internal memory, then i'll be good
 

Lanchon

Senior Member
Jun 19, 2011
2,703
4,455
203
Samsung doing *****, as always... lol

Anyways, i tried to get a board replacement to get that 1GB back (since theres no way to repartition the existing one) but the guys at service center apparently had no idea what i was talking about...

Well, if anyone finds a way to repartition the G's internal memory, then i'll be good
but the size of your complete eMMC seems to be exactly the same:

7634944 mmcblk0

so you could maybe just use gdisk to grow the partition to its max.
 
  • Like
Reactions: kiodo1981

DoctorStrange96

Senior Member
Feb 21, 2014
1,616
2,374
153
Belém
but the size of your complete eMMC seems to be exactly the same:

7634944 mmcblk0

so you could maybe just use gdisk to grow the partition to its max.
I discovered that my phone was still in engineering mode (some extra bootloader settings were available, and /system was write-protected while Android was running - but not in recovery mode), and memory dumps were enabled (they're written every time there's a kernel panic). I disabled those memory dumps and put the phone into production mode via fastboot. Thus i got that 1gb back and system write protection was gone.

I tried to write a new partition table but the bootloader would always override my settings due to memory dumps being enabled.

Off-topic but useful note: You can't put a board which is in production mode back into engineering mode. (Apparently the change is done by blowing a fuse, same way the bootloader unlock works)
 
Last edited:
  • Like
Reactions: Lanchon

Lanchon

Senior Member
Jun 19, 2011
2,703
4,455
203
I discovered that my phone was still in engineering mode (some extra bootloader settings were available, and /system was write-protected while Android was running - but not in recovery mode), and memory dumps were enabled (they're written every time there's a kernel panic). I disabled those memory dumps and put the phone into production mode via fastboot. Thus i got that 1gb back and system write protection was gone.

I tried to write a new partition table but the bootloader would always override my settings due to memory dumps being enabled.

Off-topic but useful note: You can't put a board which is in production mode back into engineering mode. (Apparently the change is done by blowing a fuse, same way the bootloader unlock works)
i have to say that was crazy! your engineering mode phone was worth it weight in gold!!! you should have sold it!
yes, qfuse blown, no way back

btw, take a look here...
https://github.com/Lanchon/REPIT/issues/55
 

DoctorStrange96

Senior Member
Feb 21, 2014
1,616
2,374
153
Belém
i have to say that was crazy! your engineering mode phone was worth it weight in gold!!! you should have sold it!
yes, qfuse blown, no way back

btw, take a look here...
https://github.com/Lanchon/REPIT/issues/55
Nah, dont think I'd be getting good cash on it. My dear old phone has suffered quite some damage. More precisely, it suffered a nasty fall and the screen cracked. Plus the paint on the removable rear cover has started to peel off. And there're a couple of scratches as well. Last but not least, only 8 bleeding gigabytes, what can anyone do with that nowadays?

Thanks for teh advice. I was thinking about repartitioning (shrinking the cache partition a bit and expanding userdata), but since the phone is no longer in engineering mode, I hardly think that'll be possible now

Edit: I'll give REPIT a try. Will back up my stuff just in case

Edit 2: REPIT doesnt work. Manually repartitioning didnt work either. Bootloader overrides everything. And it definitely doesnt accept a custom made gpt.bin - I have one here, 32 MiB for the cache partition, and 6.1 GiB (ca. 6.55 GB). Has to be signed.
 
Last edited:

Lanchon

Senior Member
Jun 19, 2011
2,703
4,455
203
Nah, dont think I'd be getting good cash on it. My dear old phone has suffered quite some damage. More precisely, it suffered a nasty fall and the screen cracked. Plus the paint on the removable rear cover has started to peel off. And there're a couple of scratches as well. Last but not least, only 8 bleeding gigabytes, what can anyone do with that nowadays?

Thanks for teh advice. I was thinking about repartitioning (shrinking the cache partition a bit and expanding userdata), but since the phone is no longer in engineering mode, I hardly think that'll be possible now

Edit: I'll give REPIT a try. Will back up my stuff just in case

Edit 2: REPIT doesnt work. Manually repartitioning didnt work either. Bootloader overrides everything. And it definitely doesnt accept a custom made gpt.bin - I have one here, 32 MiB for the cache partition, and 6.1 GiB (ca. 6.55 GB). Has to be signed.
wow, i was expecting a brick there! what do you mean by REPIT doesnt work, manual doesnt work? gives an error during execution? restores to default after boot? can you clarify?

thanks!
 

DoctorStrange96

Senior Member
Feb 21, 2014
1,616
2,374
153
Belém
wow, i was expecting a brick there! what do you mean by REPIT doesnt work, manual doesnt work? gives an error during execution? restores to default after boot? can you clarify?

thanks!
REPIT hangs at "rereading partition table". I believe there's an issue open at the project's github.

Manual repartitioning (using parted): I can mess with the partitions just fine, but I can't actually write the new partition table. It has to be flashed via fastboot. I repartitioned using parted, then dumped the partition table:
Code:
# dd if=/dev/block/mmcblk0 of=/tmp/gpt.bin bs=8 count=4096
$ adb pull /tmp/gpt.bin
However, fastboot refuses to flash it ("hab check failed for gpt"). It'd have to be signed. So, repartitioning doesn't work because the bootloader will still load the old table every time. Unless we could find a way to sign our custom gpt.bin in a way that the bootloader would accept it.

In engineering mode, you can flash unsigned partition tables.
 
  • Like
Reactions: Lanchon

Lanchon

Senior Member
Jun 19, 2011
2,703
4,455
203
REPIT hangs at "rereading partition table". I believe there's an issue open at the project's github.

Manual repartitioning (using parted): I can mess with the partitions just fine, but I can't actually write the new partition table. It has to be flashed via fastboot. I repartitioned using parted, then dumped the partition table:

However, fastboot refuses to flash it ("hab check failed for gpt"). It'd have to be signed. So, repartitioning doesn't work because the bootloader will still load the old table every time. Unless we could find a way to sign our custom gpt.bin in a way that the bootloader would accept it.

In engineering mode, you can flash unsigned partition tables.
hmmm thats strange. i was able to alter the GPT of falcon with 5.1 GPE bootloader. reboot resulted in hard brick and qualcomm bulk mode. was able to recover with the qcomm tools, thankfully the files were out there.
 

DoctorStrange96

Senior Member
Feb 21, 2014
1,616
2,374
153
Belém
hmmm thats strange. i was able to alter the GPT of falcon with 5.1 GPE bootloader. reboot resulted in hard brick and qualcomm bulk mode. was able to recover with the qcomm tools, thankfully the files were out there.
Mine is a non-GPE with bootloader version 41.1A (came with the stock 5.1 firmware). No harm done in my case.

Edit: Your test phone was hard-bricked most likely due to the bootloader expecting a signed GPT. I don't know if earlier bootloaders (41.13 for KK, 41.18 for Lollipop, and 41.19 for Lollipop MR1) behaved the same way too
 
Last edited:

Lanchon

Senior Member
Jun 19, 2011
2,703
4,455
203
Mine is a non-GPE with bootloader version 41.1A (came with the stock 5.1 firmware). No harm done in my case.

Edit: Your test phone was hard-bricked most likely due to the bootloader expecting a signed GPT. I don't know if earlier bootloaders (41.13 for KK, 41.18 for Lollipop, and 41.19 for Lollipop MR1) behaved the same way too
because of what i posted here:
https://github.com/Lanchon/REPIT/issues/55#issuecomment-264785836
i expect GPE kitkat 4.4.4 to behave in the same way.