[MOD] MT6577 2GB Data Repartition/ SdCard Swap [HACK], INT2EXT (data2ext)

Search This thread

KunalKene1797

Senior Member
Dec 4, 2013
435
1,042
25
Nagpur
I Need Help Please!

Can you take a look ?
MT Device is MT6572 with EBR1 and MBR Files only...this is the Link to my stock MBR and EBR1....i would be very thankful if someone can help or atleast guide me! :silly:
Thanks in Advance:good:
I want to increase the Primary Internal Data Partition size from 500MB to 2GB! :silly:

MBR and EBR1 : http://forum.xda-developers.com/attachment.php?attachmentid=2869849&d=1406289303

Scatter[MT6572] : http://forum.xda-developers.com/attachment.php?attachmentid=2869848&d=1406289178
 
Last edited:

bethnesbitt

Senior Member
MTK6572 repartitioning

Now here is a funny story :p

I came across a tool on irulu.net's download for a tablet similar to mine, funny thing is, they named it IMEI tool, which was the IMEI tool, but it was like finding gold at the end of the rainbow, also had the kernel for a MTK6572 tablet. I asked them about it but they replied with it wasn't for mine, they didn't know what it was.

I had somewhat of an idea and decided to play with it, did a dd against the kernel in linux it it actually showed that it was android 4.6 pre-release, hmmm now I had to see what would happen and flashed it using SPflash, brick, wouldn't even turn on. So I reflashed back to my original firmware that, of course was backed up from MTKDroid Tools.

Not sure why but SPFlash flashed everything back to the phone, it turned on but I was stuck in some kind of limbo between the old kernel and the new kernel. Seemed to update it by keeping the newer firmware but didn't reflash the old firmware. Worked, just some Apps were not compatible and the screen rotation was backwards. When I tried opening some apps the screen just went blank and froze.

What was cool is that the EBR1 and MBR from their kernel actually extended my internal storage from 504mb to 1.2gb, sweet, and decreased my phone storage from 2.11gb to 1.32gb. Luckily I had another nandroid backup that was done and saved to my PC using nandroid from the play store, you can never have to many backups. The backup restored my system, userdata etc but still have that shiney new EBR1 and MBR.

When I try to do file cynwig nothing happens and linux just shows x86 boot sector with no values.

Something else that is baffeling is, how is it that the original was 502mb internal meory with 2.11 internal storage, doesn't make sense. Now the new files give me 1.2gb with the 1.32gb internal storage. Makes me wonder if I could just jack somebody else's EBR1 and MBR from a 6589 devices.

Something else I was wondering, what I I partitioned a usb stick or sdcard the way I wanted my internal storage for apps to be, the way my phone storage is already configured, duplicated that MTKDroid tools is showing. Next in HXD, opened extras and selected the disk to read as hex, then saved it as a new EBR and MBR. Next flashed it, wouldn't that be easier if possible?

Did compared it against the tablet's original EBR1 and MBR and found the differance, both are attached. Just cannot seem to grasp how it is done.

If anybody want''s to use the new MBR and EBR1 on their mtk6572, go ahead, it will probably work on their china mtk6572 tablet, that is if you have less then 1.02gb of internal storage.
 

Attachments

  • new.EBR1-MBR.zip
    334 bytes · Views: 247
  • old.EBR1-MBR.zip
    865 bytes · Views: 130
Last edited:
  • Like
Reactions: KunalKene1797

bresjanacp

Member
Jan 25, 2015
22
0
Thank you very much for this explenation.

I have just one question more.

In Partition 7, last four Hex, they are not size of partition, right? What is that?

capture.jpg


Thanks
 

bresjanacp

Member
Jan 25, 2015
22
0
I'm not sure that I understand. Maximal size, in sectors, of ExtSD that I can use in my phone? (32GB in sectors?)
 

a.marduk

Member
Oct 3, 2013
47
11
jakarta
I'm not sure that I understand. Maximal size, in sectors, of ExtSD that I can use in my phone? (32GB in sectors?)

i think it's just some kind of way to include all emmc (including there unmapped bootimg , recovery, nvram, pmt, uboot, etc) and unknown size of fat into mbr and ebr....
Means that the remining space in emmc from start sector of fat till the end of the space in emmc will be fat partition. So it doesn't matter if your phone's rom are 4 gigs, 8 , 16 or 32 gigs.

attachment.php

see MBR , first partition (blue one)
- 05 = partition type = extended partition
- 04 00 = start sector (in hex) = partition start at sector 1024
- FF FF FF FF = sector size (in hex) = sector size = 4294967295 sectors = 4294967295 x 512 bytes/sector = approximately 2 TB

now see EBR1 third partition (purple one = fat partition = phone storage)
- 83 = partition type = Linux native file systems (ext2/3/4, JFS, Reiser, xiafs, and others).
- 1BD400 = start sector of the partition = the sum of previous partition (yellow one) size + start sector of the previous partition = 03F000 + 17E400 = 1BD400
- FFE42BFF = the size of partition = the size of extended partition - ( the size of previous partition + start sector of previous partition ) = FFFFFFFF - ( 03F000 + 17E400 ) = FFE42BFF = approximately 2 TB
 
  • Like
Reactions: alecxs

jbliz

Senior Member
Dec 25, 2013
106
13
Kendari
mmcblk0p4
00 BA 01 00 - 0001BA00 (hex) 113152 (dec)
00 50 14 00 - 00145000 (hex) 1331200 (dec)
113151 + 1331200 = 2662400
1331200 x 512 = 681574400 Megabytes

how to make correct address in scatter? even I mode EBR to reduce system partition. MTK Droid Tools still read actual bite size. here my scattter.

- partition_index: SYS15
partition_name: ANDROID
file_name: system.img
is_download: true
type: YAFFS_IMG
linear_start_addr: 0x3D40000
physical_start_addr: 0x3740000
partition_size: 0x28A00000
region: EMMC_USER
storage: HW_STORAGE_EMMC
boundary_check: true
is_reserved: false
operation_type: UPDATE
reserve: 0x00
 

a.marduk

Member
Oct 3, 2013
47
11
jakarta
mmcblk0p4
00 BA 01 00 - 0001BA00 (hex) 113152 (dec)
00 50 14 00 - 00145000 (hex) 1331200 (dec)
113151 + 1331200 = 2662400
1331200 x 512 = 681574400 Megabytes

how to make correct address in scatter? even I mode EBR to reduce system partition. MTK Droid Tools still read actual bite size. here my scattter.

- partition_index: SYS15
partition_name: ANDROID
file_name: system.img
is_download: true
type: YAFFS_IMG
linear_start_addr: 0x3D40000
physical_start_addr: 0x3740000
partition_size: 0x28A00000
region: EMMC_USER
storage: HW_STORAGE_EMMC
boundary_check: true
is_reserved: false
operation_type: UPDATE
reserve: 0x00

what do you want to do?
give me your mbr ebr1 , ebr2 (if it has ebr2) and your scatterfile
 

lhandom

Member
Apr 14, 2016
28
7
Sorry may be this is an old post, but i need to do the same to may MBR or EBR1 and scatter file...can anyone give me a hand to do so?
 

Attachments

  • Scatter-MBR-EBR1.zip
    700 bytes · Views: 49

fred-0

Member
Aug 12, 2016
18
4
Screenshots
 

Attachments

  • Screenshot_2016-08-20-23-42-14.jpg
    Screenshot_2016-08-20-23-42-14.jpg
    71.2 KB · Views: 114
  • Screenshot_2016-08-20-23-42-53.jpg
    Screenshot_2016-08-20-23-42-53.jpg
    81.3 KB · Views: 117

Top Liked Posts

  • There are no posts matching your filters.
  • 47
    All MT6577 android phones are 'STILL' plagued by low internal memory issue...
    alamak.gif


    Credits to X-Dron from russia, now you'll have 2GB of internal storage instead of 512MB with this mod ! :good:

    I've included a google direct translated version for the help file, some sentence doesn't make sense but i'm sure you'll figure it out on how to use it...
    tongue.gif


    X-Dron claim his mod is universal & it can be use on all MT6577... :good:

    You can follow the original thread here...

    Added on Oct 04, 2012 - SdCard Swap
    What the f... , :D you have use up your 2GB Internal Memory & you can't install any more apps...
    alamak.gif


    Credits to EMF, he found this hack & it is working well on my MT6577... :good:

    Originally, this hack by 神族-bpok which install .smssecurity to app folder which is meant for V970 so attach copy here, i've deleted it so that it can be use on any MT6577 via cwmr... :D

    Having said that, it is best that you copy your original vold.fstab before installing this hack so that, if anything were to go wrong, you can still revert it back to original state... :p Just open revert2ori.zip with 7zip but don't extract it, drag & drop your original vold.fstab into it & flash via cwmr... :good:

    What this hack did is that it swap the mount points at vold.fstab...

    Original
    Code:
    dev_mount sdcard /mnt/sdcard [email protected] /devices/platform/goldfish_mmc.0 /devices/platform/mtk-sd.0/mmc_host
    dev_mount sdcard /mnt/sdcard[COLOR="blue"]2[/COLOR] auto /devices/platform/goldfish_mmc.1 /devices/platform/mtk-sd.1/mmc_host

    Hack
    Code:
    dev_mount sdcard /mnt/sdcard[COLOR="blue"]2[/COLOR] [email protected] /devices/platform/goldfish_mmc.0 /devices/platform/mtk-sd.0/mmc_host
    dev_mount sdcard /mnt/sdcard auto /devices/platform/goldfish_mmc.1 /devices/platform/mtk-sd.1/mmc_host

    It is also possible to manual edit vold.fstab as confirmed working by other thread...if it doesn't then power off, take out the battery, wait few sec then put it back & reboot...

    If it still doesn't work, you can try manual edit & add 2 to vold.fstab.nand

    Original
    Code:
    dev_mount sdcard /mnt/sdcard auto /devices/platform/goldfish_mmc.0 /devices/platform/mtk-sd.1/mmc_host

    Hack
    Code:
    dev_mount sdcard[COLOR="Blue"]2[/COLOR] /mnt/sdcard[COLOR="Blue"][B]2[/B][/COLOR] auto /devices/platform/goldfish_mmc.0 /devices/platform/mtk-sd.1/mmc_host

    Some report that this works well with 32GB SdCard too ! But make sure to use minimum Class 4 & above... :D

    Bravo to the original developer/ hacker...
    rclxms.gif


    --------------------------------------

    Added on Oct 17, 2012 WARNING : MEDIATEK SMART PHONE FLASH TOOL
    i've seen far too many times that fellow xda member make this same mistake over & over again, including myself...
    tongue.gif


    So pls pls people, don't use SP Flash Tool & download ROM not meant for your phone, it will brick it & there is no way to revive it back ! After you have download wrong PRELOADER, your phone will be completely dead, cannot power on, no charging, no recovery, no USB vcom detection & you can say
    rip.jpg
    to it...

    Here is the WARNING again :

    NEVER DOWNLOAD ROM NOT MEANT FOR YOUR PHONE. IT WILL BRICK IT !

    --------------------------------------

    Added on Dec 02, 2012 - INT2EXT on MT6575 / 77 for the extreme gamers !
    Finally found a way to install 200 over games on my MT6577 & i'm sure it will work on MT6575 too... :fingers-crossed:

    So here is the updated tut to do that... :D Works on ext 2, 3 or 4... :good:

    As usual the credits, without these Master Shifu's sharing, this mod would not be here...
    rclxms.gif


    int12.jpg


    croniccorey
    mastermind1024
    KarmaToBurn
    --------------------------------------
    Added on Jan 03, 2013 - Data Repartition APK for MT6577
    Full credits to jaydvn, he has found it, translated it & share with us this super easy to use app...
    thumbup.gif


    Refer to this post here onwards... ;)

    --------------------------------------
    Added on Feb 25, 2013 - Operation to Support & Reward our MTK SoC Developers
    Head up to here & show your support...
    thumbup_zpse78dc2e0.gif

    --------------------------------------
    Added on June 26, 2013 - How to use your 64GB Micro SDXC for Android-powered smartphone that supports only up to 32GB
    Found an interesting article here but i haven't try it b'cos i don't have a 64GB Micro SDXC... :D

    Its in Russian so use Google Chrome built-in translations, it makes more sense... :laugh:

    Its for people who already had a 64GB SDXC to try out, anyone care enough to report back whether it works... :fingers-crossed:
    --------------------------------------
    Added on Dec 12, 2013 - MT6589 MBR, EBR1, EBR2 explained
    MT6589 MBR, EBR1, EBR2 are the least explained thanks to Master Shifu nightcraw for the detail explanations, i'm a complete zero when it comes to Hex calculations...
    ag_zps1e5a29ec.gif


    Original idea by JohnnyInBriz i've requested Master Shifu nightcraw to edit it so here it is, all formula already setup so you can resize cache, android system, usrdata, fat & it will let you know what to edit to the MBR & EBR....
    rclxms_zps452ba9d3.gif


    Hopefully it will be useful to those DYI'er who wants to resize partition themselves & mod at your own risk... :laugh:
    --------------------------------------
    Added on Dec 25, 2013 - MoreApp.apk
    This mod was shared at another forum but under constant spamming...
    alamak_zps2e31ed77.gif


    Not to waste a good mod by Master Shifu Michfood here is the link... :good:

    WARNING : Make a backup first. This mod will shift all apps to sdcard ./android_secure & therefore freeing all internal space & CWMR/ TWRP does backup it too... :cowboy:
    24
    [Noob Guide]Understanding the Hex value of MTK's MBR/EBR1/EBR2

    Straight to the guide. First of all you need:
    • MtkDroidTools
    • cygwin (cos I'm using Windows, sucks isn't it)
    • Hex editor (I'm using HxD)
    • Notepad++ (or any text editor)
    • your scatter file

    In this guide, I'm using my Hisense EG980ae as an example. It is an MTK6589t phone and it doesn't has an EBR2 file. Setting up things first:
    1. Put your MBR and/or EBR1 file in the root folder of Cygwin (or linux user can staraight to type) and type:
      Code:
      file MBR
      you will get something like this:
      Code:
      MBR: x86 boot sector; 
      partition 1: ID=0x5, starthead 0, startsector 1024, 4294967295 sectors;
      partition 2: ID=0x83, starthead 0, startsector 26624, 20480 sectors;
      partition 3: ID=0x83, starthead 0, startsector 47104, 20480 sectors; 
      partition 4: ID=0x83, starthead 0, startsector 93184, 12288 sectors,
      code offset 0x0
      and
      Code:
      file EBR1
      you will get something like this:
      Code:
      EBR1: x86 boot sector;
      partition 1: ID=0x83, starthead 0, startsector 132096, 1433600 sectors;
      partition 2: ID=0x83, starthead 0, startsector 1565696, 258048 sectors;
      partition 3: ID=0x83, starthead 0, startsector 1823744, 4293143551 sectors,
      code offset 0x0
      Copy and paste the result to your text editor and let it open (don't close your text editor yet).

    2. Connect your MTK device to your PC and open MTK droid tools. Click "Blocks Map" and leave the window open, like this:

      attachment.php


    3. Open your MBR and/or EBR1/EBR2 with an Hex editor (choose 16 bytes per row), and you'll get a view like this:

      attachment.php



      On the left is my MBR and on the right is my EBR1. Just concentrate on the highlighted part, and copy them to your text editor and arrange them like this:

      attachment.php


    Its time to decrypt things!!!!
    Now just for an example, we concentrate on the hex value which I highlighted with the pink background (the MBR part):
    Code:
    [SIZE="5"][B][COLOR="Red"]00[/COLOR] [COLOR="Blue"]00 00 00[/COLOR] [COLOR="Purple"]83[/COLOR] [COLOR="Orange"]00 00 00[/COLOR] [COLOR="Lime"]00 68 00 00[/COLOR] [COLOR="YellowGreen"]00 50 00 00[/COLOR][/B][/SIZE]


    • The first hex number (red) gives two pieces of information. If it is 00, just like the example. then the partition is not the active partition (does not contain the boot loader). If it is 80 or greater, this means it is the active (bootable) partition. Only one partition can be marked as active. The second piece of information applies to fixed disks. If the first fixed disk contains the active partition, this number will be 80. If it were the second fixed disk, this number would be 81, and so on.
    • The hex number 83 (in purple) tells which type of file system the partition contains, and whether the Cylinder, Head, Sector (CHS) or the Large Block Addressing (LBA) system is to be used to locate the partition. In our case, 83 means Linux ext2fs partition.
    • And finally, there are two ways that the location of the partition is specified in the partition table entry:
      • The first is the Cylinder Heads Sectors method (CHS). The three blue numbers (00 00 00) specify the CHS location where the partition begins, and the three orange numbers 00 00 00 specify where it ends.
      • The Cylinder Head Sector method only works on drives up to 8 gigabytes because that is the maximum size that can be specified with the three bytes. I guess this is why MTK does not use this and provide a null value. And to get around this, they instead use the second method of specifying the location of the partition. It is called Logical Block Addressing, and it uses the last eight bytes in the partition table entry. These bytes give the location of the partition by counting the number of sectors from the start of the disk, which is much simpler. The four bytes in lime (00 68 00 00) give the number of sectors before the partition, and the following four bytes (00 50 00 00) in YellowGreen give the length of the partition.

    We have to know just one thing to interpret these bytes. They are in "little endian" order. This means that the lowest "place value" is held by the first byte. So to use them like we use ordinary numbers, we just have to reverse the order of the bytes. So 00 68 00 00 becomes 00006800 and 00 50 00 00 becomes 00005000. Using any hex converter, now we can convert these new hex numbers (00006800 and 00005000) to decimal (26624 and 20480). This new decimals tell us that there are 26624 sectors before the partition begins at the 26625th sector, and it is 20480 sectors long. Thus the partition ends at sector 26624+20480=47104. Notice that this is the same result we got with the CHS math.

    Now can you see how those numbers (26624, 20480, and 47104) correlated with the data we first acquired when we ran the "file" command on cygwin, which is on the second and third partitions of the "MBR":
    Code:
    MBR: x86 boot sector
    partition 2: ID=0x83, starthead 0, startsector [SIZE="4"][B]26624[/B][/SIZE], [SIZE="4"][B]20480[/B][/SIZE] sectors;
    partition 3: ID=0x83, starthead 0, startsector [SIZE="4"][B]47104[/B][/SIZE], 20480 sectors;

    But How the hell we convert sectors to bytes?!!!!
    Since the default sector-size for almost every single HDD is 512 bytes per Sector, why don't we just multiply all our numbers, especially the size of the MBR's partition number two above 20480 by 512.


    So we get 20480 X 512 = 10485760

    Now please compare the value with the "Blocks Map" window that we open earlier!!!!!!!

    attachment.php



    However, sometimes it would get more tricky. For example, let us look at the MBR's partition 3 and 4:

    Code:
    MBR: x86 boot sector; 
    [B][SIZE="4"]partition 3: ID=0x83, starthead 0, startsector 47104, 20480 sectors;
    [COLOR="YellowGreen"]00 B8 00 00[/COLOR] [COLOR="Lime"]00 50 00 00[/COLOR]
      [COLOR="YellowGreen"]0000B800[/COLOR]    [COLOR="Lime"]00005000[/COLOR]  
       [COLOR="Blue"]47104[/COLOR]       [COLOR="Orange"]20480[/COLOR]
                 [COLOR="Cyan"]10485760 Bytes[/COLOR]
    [/SIZE][/B]
     
    MBR: x86 boot sector; 
    [B][SIZE="4"]partition 3: ID=0x83, starthead 0, startsector 93184, 12288 sectors;
    [COLOR="YellowGreen"]00 6C 01 00[/COLOR] [COLOR="Lime"]00 30 00 00[/COLOR]
      [COLOR="YellowGreen"]00016C00[/COLOR]    [COLOR="Lime"]00003000[/COLOR]
       [COLOR="Red"]93184[/COLOR]       [COLOR="Lime"]12288[/COLOR]
                 [COLOR="Lime"]6291456 Bytes[/COLOR]
    [/SIZE][/B]

    This is where it gets tricky:

    Code:
    [B][SIZE="4"] [COLOR="Blue"]47104[/COLOR] + [COLOR="Orange"]20480[/COLOR] = [COLOR="Magenta"]67584[/COLOR] not [COLOR="Red"]93184[/COLOR][/SIZE][/B]

    Now where these extra sectors or bytes, to be precise 93184 - 67584 = 25600 sectors or 13107200 Bytes, go? To find the answer of this freak'n mystery, you have to re-open the MTKDroid Tool's "Blocks Map" window that we open earlier!!!!!!!


    attachment.php



    Ring a bell fellas?!!!!


    So.....
    Happy re-partitioning your MTK devices and keep on improvising!!!!!!!!!!!!!!
    17
    Translated Repartition APP

    I've translated Data Repartition Tool to English <DOWNLOAD>
    Hope you enjoy it!
    6
    But, 7z.exe needed to be updated to latest version (for my case, Windows 7 64bit).
    update (22/10/2012) : Error flashing zip file, back to kitchen..
    haha, been using x86 earlier b'cos of driver compatibility issue but now also lazy to upgrade...
    tongue.gif


    Yeoh bro, for Android Kitchen to work on MT6577, you'll need 'curi ayam' patching... :D

    There are so many MT6577 out there, to update edify_defs for all model is crazy... :eek:

    After extraction at AK, go to ADVANCED OPTIONS -> Convert update-script or updater-script -> Convert update-script to updater-script (Edify)

    Then go to AK -> tools\update_files folder, copy emmc-update-binary to WORKING folder \META-INF\com\google\android, delete existing copy & rename emmc-update-binary to update-binary

    Open updater-script with Notepad++ & delete the 2nd & 3rd line & add the following to the 2nd line & save it...

    Code:
    format("ext4", "EMMC", "/dev/block/mmcblk0p3");
    mount("ext4", "EMMC", "/dev/block/mmcblk0p3", "/system");

    Build ROM from working folder & Voila, you'll have Android Kitchen working on MT6577 & i believe it will work on MT6575 too... :fingers-crossed:

    If you need to add apps/ games to WORKING folder /data/app then you will need the below...

    Code:
    format("ext4", "EMMC", "/dev/block/mmcblk0p5");
    mount("ext4", "EMMC", "/dev/block/mmcblk0p5", "/data");
    package_extract_dir("data", "/data");
    set_perm_recursive(0, 0, 0777, 0777, "/data");
    
    format("ext4", "EMMC", "/dev/block/mmcblk0p3");
    mount("ext4", "EMMC", "/dev/block/mmcblk0p3", "/system");

    AK will works with either system.img or system.ext4.tar but *.tar will take a longer time to decode symlink...
    tongue.gif


    As usual, wipe data/ factory reset first before installing ur newly created update.zip... :eek:

    Actually you don't need to format statement also at updater-script since you already manually done it... :D
    5
    Yeoh Bro, did a full test & it is working great, thank you so much for sharing...
    thumbup.gif


    [Original Size] [500MB] [1GB] [2GB] [2.5GB] [3GB]

    However, Factory Reset at TWRP show error but it works after reboot. CWMR Wipe Data/ Factory Reset no error... :eek:
    Can i ask you one more question, i use android kitchen to make update.zip of rom, but after flash the zip file, my wifi can't be turned on, do you know it because of boot.img or updater-script?
    That problem was solved by Master Shifu dsixda since version 2.14 b'cos of symlink problem, refer to Release Notes here...