[MOD][RECOVERY] Firerat's Custom MTD Partitions (resize Data,System and Cache)

Search This thread

bigmoneygrip23

Senior Member
May 10, 2011
136
11
St. Louis
Is it possible to change the partition sizes without flashing a new ROM?

I flashed firerat's recovery
rebooted into recovery
I flashed ROM
I flashed firerat's boot
installed all my apps


I now want to resize the system partition without having to reflash and install all my apps again; is this possible?

I'd recommend just taking backup of your existing ROM in your recovery. Then, to re-setup firerats:

edit your mtdpartmap.txt file
flash new recovery
run firerats recovery mod
reboot into recovery
wipe cache, data, system, boot, and dalvik (might not be necessary, but if youre restoring a backup, it shouldn't hurt anything)
restore nand backup
run firerats boot mod
reboot
 
Last edited:

trip187

Senior Member
Sep 25, 2010
82
6
Is it possible to change the partition sizes without flashing a new ROM?

I flashed firerat's recovery
rebooted into recovery
I flashed ROM
I flashed firerat's boot
installed all my apps


I now want to resize the system partition without having to reflash and install all my apps again; is this possible?

No it's not possible. You can change the mtdpartmap.txt file all you want but the only way to make it take effect is by formatting everything and flashing the recovery file. As stated above you can flash a nand backup instead of a Rom but there's no getting around the formatting step

Sent from my HERO200 using XDA
 

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    If you dont understand what this Modification is doing, why it needs to be done, or what possible benefits come from it, then...

    PLEASE DO NOT TRY THIS MOD.


    ***Even tho it is impossible to brick your phone when flashing this i still highly recommend you UNDERSTAND what you are attempting to do before you do it. If someone explains you are freeing up internal memory from other places not using it and you still have to ask what the benefit is, then you obvisouly dont fully understand the mod and your phone and should turn away now.***

    Thank You.


    Now onto the mod: Heres a quick description of what this mod is doing. Pretend your phone is a pizza cut into 3 even pieces. Each piece is memory for /cache, /system, /data. Your aneroxic sister "aka cache" doesnt eat a lot so most of her slice will always be left, your fat obese brother "/data" always eats his whole slice and is left wanting more. You are healthy "/system" and only eat what you need and never less never more.

    What this mod is doing is taking that original pizza and RECUTTING the slices to better fit whos eating them, so since your aneroxic sister barely eats and your obese brother is always hungry it takes all the extra pizza "aka memory" from your sister and gives it to your brother. As for you "aka /system" you only eat exactly what you need "aka the size of the rom and files it install" so it resizes your own slice to exactly the number it needs to install the rom and its gapps/files and leaves you with just a little wiggle room.

    That being said, i tried this on my buddies CDMA Hero that i rooted for him and it worked like a charm. he went from something around 170mb internal storage to around 350+mb internal storage while on CM6 - Froyo 2.2.

    ***One thing i noticed when using a hero CDMA is that adb is crucial. one of the steps after flashing the recovery file is to reboot back into recovery and i noticed it was impossible to do it the right way without plugging your phone in and using ADB***


    Original Files and Instructions: Firerats Original G1/MT3G thread found here - http://xdaforums.com/showthread.php?t=717874

    After you read thru firerats original instructions just know that itll be slightly different on your hero!

    1. Click on the link i posted above and download these files: FR-recovery-v1.5.3-CustomMTD_S.zip and FR-boot-v1.5.3-CustomMTD_S.zip

    2. Put both those files onto your SDCard.

    3. While in your SDCard, make a .txt file named "mtdpartmap.txt"

    4. Open your new mtdpartmap.txt file and...
    - If you are using CM6 then type
    Code:
    mtd 102 2
    - If you are using a larger Sense Rom like Fresh or ZenHero then type
    Code:
    mtd 182 4

    5. Once all 3 files are saved on the root of your SDCard, reboot your phone into recovery

    6. Format/Wipe your system and cache.

    7. Flash the file: FR-recovery-v1.5.3-CustomMTD_S.zip

    8. Once the file is done flashing, itll prompt you to wipe cache, system, and dalvik again.

    9. Once its wiped, plug ur phone in and pull up command to adb reboot recovery (if you try to reboot into recovery any other way itll mess up the partitions and ull get cache memory.log errors and that will mean the mod didnt work correctly) by using this
    Code:
    adb shell
    reboot recovery

    10. if you did step 9 correctly, then youll get back to your recovery menu and itll say "formatting cache..." at the bottom of your screen but your recovery menu is instantly able to be used and you dont have to wait. ***On the newest version i think it no longer says this and your just got to go***

    11. Flash CM6 if you used 102 for /system or Flash your larger Sense Rom if you used 182 for /system

    12. Optionally, flash any kernal you may be choosing to use

    13. Flash the file: FR-boot-v1.5.3-CustomMTD_S.zip

    14. Click the top option on your recovery menu to reboot your system.

    15. Once your system is fully booted you can go into menu > settings > sd card and internal storage , and check all the new added internal memory you have.


    FYI : anytime you flash a new rom after this mod, or flash a new kernal to a currently flashed rom, you will ONLY NEED TO FLASH THE SECONDARY FIRERAT BOOT file named "FR-boot-v1.5.3-CustomMTD_S.zip".

    so say after this mod you want to try a new kernal, you flash the kernal, flash boot, and reboot the system.

    or say you want to flash a new cm6 nightly update, you flash the new rom/update, flash boot, reboot.

    or say u want a new nightly and a new kernal, you flash the nightly, flash the kernal, flash the boot, reboot.

    its very simple, if anything u flash overwrites current kernal specifications, u need to flash the boot file to make sure it knows how to set itself up. this goes for nandroid back ups aswell.

    Fine Tweaking/Trouble Shooting: To get the most space you possibly can do go into adb or terminal and type
    Code:
    df -h

    and it'll tell you what % you are using on your system. if you are at 60% then you can go ahead and decrease your /system value in your mtdpartmap.txt to about 2mb over the value it says you are using. so if your rom uses 115mb of /system you can change your mtd to "mtd 117 2".

    So if you are getting an error while trying to flash a rom after doing this modification you most likely dont have enough /system space and will want to up your value to something more then enough like "mtd 200 4" then run the above code and re-scale down back to 2mb over what the current rom is using.

    Enjoy CDMA users!!!
    3
    I have a HeroC with CM7 on it. If I install this mod, will it really bump my storage available from 160mb to 300+mb???

    Also, if I install this on top of my current setup, will i have to reinstall all my apps and my ROM? Thank you.

    Yes, I use it and it bumped by available storage to 300+ MB.
    No, you don't have to reinstall anything :) just follow these steps:

    1) Create mtdpartmap.txt. mine says "mtd 100 4" and it fits just fine + gapps
    2) Create nandroid backup
    3) wipe everything! data + cache
    4) flash fr-recovery
    5) wipe everything again! data + cache
    6) reboot to recovery. this is important! if you have clockworkmod just go to advanced > reboot recovery. if not, connect to pc and do adb reboot recovery
    7) restore nandroid
    8) flash fr-boot
    9) reboot normally

    Then you should be good to go! I've messed up giving instructions with firerat more than once, so if any veterans could confirm what I wrote that would be great :)
    3
    Hope you folks don't mind but there have been a handfull of people wanting to know how this works and what it exactly entails, so I have been sending this info to folks in pm, so I figured what the heck, and post it here. It's the same exact info as the main screen just maybe a tad bit simplified for clarity.

    Last person who pm'd me about it said:
    Hey, didn't you say you did the firerat method? How did it work? I don't really understand all the settings etc and how to implement them. Think you could explain it in a "teach the dumb Guy how to" kinda way? Lol

    No problem man!
    In a nutshell:

    There are three parts to the partition system:
    -making the mtdpartmap.txt (holds settings for what you want the partitions to be)
    -the FR-recovery-v1.5.3-CustomMTD_S.zip file (edits recovery to use the mtdpartmap.txt file to 'virtually' change the size of the partitions
    -the FR-boot-v1.5.3-CustomMTD_S.zip (which tells the kernel of your rom how to use the space set by the virtual partitions)

    Here is the theory: virtually (but not really) resize the partitions that are usually left empty, and giving that space to the partitions that usually could need it. i.e. the data partition.

    Example and explanation of the mtdpartmap.txt file:
    mtd 180 30 (this is my sizes)

    The way it works is like this: the first number is the amount to allocate for the system partition, the second for the cache partition, and the third (or rather whatever is left) is for the data partition. The firerat mod system will automatically recalculate what is left for data to use.

    The data partition is the key cause that's technically where apps would be installed (if not using apps2sd). Also instead of using the cache partition for dalvik, it will symlink it to data, therefore relieving any real use over 4mb for the cache partition (btw usually the cache partition is rather big)

    The point your really looking to get to is to have 2mb available for the system partition, and then 2mb availible for the cache partition, effectively throwing the rest into the data partition, which is how I have 152mb of space left on my phone (had 162mb at install :p) (the space left IS from the data partition)

    To install: make the mtdpartmap.txt file in notepad, select what sizes you want (strongly recommended somewhere around 160 to 180mb for system, and for 2.2w/sense start with 10mb for the cache because you can get errors, or missing apps upon install) inside the file, and save to the memory card.

    Boot into recovery and make a nandroid if you wish to use the rom already on the phone. Afterward, wipe everything on the phone itself, and then flash the FR-recovery-v1.5.3-CustomMTD_S.zip file. After that, using adb, type adb reboot recovery to reboot the phone into recovery (even though your already in recovery, because you need to effectively 'reboot' the recovery for the new settings to stick from the FR-recovery file) (or if your using clockwork mod, go to advanced and then select reboot recovery).

    After getting back into recovery, wipe again so to ensure there is no random crap left on the phone before you either restore your nandroid (will give errors about cache but don't worry, it will rebuild the cache in the right place), or flash a new rom.

    NOW VERY IMPORTANT! After you nandroid back or flash a new rom, you have to make sure the kernel knows how to use the partitions (i.e. patch the kernel so that it knows to change the location of the actual cache to the data partition). To do this, after EVERY flash or nandroid restore, you have to flash the FR-boot-v1.5.3-CustomMTD_S.zip Yes this can be a bit of a pain in the ass cause you have to keep that file handy incase you forget when you flash a new rom :p

    **btw, great work firerat!**
    2
    Guys,

    The reason firerat's mod is having issues with CM7 is because the two are fighting against each other.

    Firerat's mod contains a script to bind the /cache partition to the /data partition. But CM7 already contains scripts to do this if necessary. The problem is that firerat's script gets called too late. It isn't really needed.

    After applying fr-boot, if you remove /system/etc/init.d/06BindCache, CM7 should take care of the rest.
    2
    Steps to install Radio...

    Nandroid
    Put Radio on sd card along with fresh 2.4 (prl update, if needed)
    Flash Clockwork Recovery from current set up
    Reboot recovery
    WIPE!
    Install Fresh 2.4
    Reboot recovery
    Flash Radio
    Reboot and update PRL
    Reboot recovery
    WIPE!
    Flash Firerats FR-recovery-v1.5.3-CustomMTD_S.zip
    WIPE!
    Reboot recovery VIA clockwork OR ADB
    Nandroid back to original set up
    Reboot recovery
    Flash FR-boot-v1.5.3-CustomMTD_S.zip
    Reboot system now

    WOW! That is quite a few things but it didnt take me more than 1/2 hour. That is WELL worth it to have this MOD :)

    Thanks Again Firerat :)



    I have the new radio and my signal at home has decreased by 2 dbm's :cool:
    Incase you are wondering the lower the dbm's the better :)

    Thanks!