I want to know that when we flash specific partition images (say system.img, data.img, cache.img, etc.), then how does the software know where exactly to put those partition bytes? For example, if I flash system.img, which CHS/LBA sector will it consider as beginning of that block? If it is based on the MBR/EBR1 tables, what will happen if I'm flashing the MBR/EBR1 too?
The reason I'm asking is that I want to change the partitioning in EBR1 slightly, so that more space is allocated to
/data partition instead of
/sdcard. I've got an old but good conditioned MediaTek (MTK-6577) based smart-phone called Karbonn-A30 which is great in build quality and almost every other aspect, but it only has 500MB of Internal Storage (
/data partition in Linux lingo) which is not good enough for apps. Presently, the MBR and EBR1 partitions are thus:
$disktype MBR --- MBR Regular file, size 512 bytes DOS/MBR partition map Partition 1: 2.000 TiB (2199023255040 bytes, 4294967295 sectors from 1024) Type 0x05 (Extended) Partition 2: 10 MiB (10485760 bytes, 20480 sectors from 18432) Type 0x83 (Linux) Partition 3: 10 MiB (10485760 bytes, 20480 sectors from 38912) Type 0x83 (Linux) Partition 4: 650 MiB (681574400 bytes, 1331200 sectors from 113152) Type 0x83 (Linux) $disktype EBR1 --- EBR1 Regular file, size 512 bytes DOS/MBR partition map Partition 1: 376 MiB (394264576 bytes, 770048 sectors from 1443328) Type 0x83 (Linux) Partition 2: 1.293 GiB (1388314624 bytes, 2711552 sectors from 2213376) Type 0x83 (Linux) Partition 3: 1.998 TiB (2196501691904 bytes, 4290042367 sectors from 4924928) Type 0x83 (Linux)
Why this last partition which corresponds to
/sdcard is left so large (1.998 TiB) is beyond my understanding! Since there is a good 2.5GB of space available on my actual
/sdcard partition, I was thinking if I can alter the EBS1 and change the LBA addressing so that the third partition starts from 2097152 additional sectors (which comes to 1024MB or 1GB which is good enough for me), will it automatically increase my
/data partition by 1GB and decrease the
/sdcard by 1GB correspondingly? On XDA and other forums, I've read that people have successfully done this mod and achieved the change in partition sizes, but I first want to understand how it happens.