Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[DEV][S-OFF] Custom MTD Partitions (resize data, system, and cache)

OP daedelus82

12th October 2010, 09:14 AM   |  #1  
OP Senior Member
Thanks Meter: 38
 
154 posts
Join Date:Joined: Sep 2009
More
Good news for those who have disabled security on their HTC Desire.

Having tried Firerat's Custom MTD patch on my HTC Desire and almost bricking it twice, I decided to break it apart and examine things in more detail.

As it currently stands v1.5.3 of his patch will corrupt your mtd0 partition if applied to your desire, so do not try it!

I read through lbcoder's custom partitions layout thread, then broke apart Firerat's patch to determine what it was doing, and what was going wrong on the HTC Desire.

The result, I have modified Firerat's Custom MTD script so it works on the HTC Desire and have successfully modified the partitions on my phone so system is 125MB, cache is 5MB, and data is 317MB.

Now after moving all my apps & dalvik-cache from SD-EXT back to DATA I still have 130MB free! w00t!

I will be providing minimal support for this, I am purely providing this to allow others to modify their partition table just as I have done. Ensure you read Firerat's original thread for further information and/or troubleshooting, it's 99% his patch/work, I just made a small change to stop mtd0 from being overwritten.

These are the steps I performed on my phone and are based on ClockworkMod Recovery v2.5.0.7.
If none of this makes sense to you then this is not for you:
  1. Disable security on your phone. (S-OFF in FASTBOOT)
  2. Place bravo-recovery-v1.5.3-CustomMTD.zip & bravo-boot-v1.5.3-CustomMTD.zip on SD card
  3. Reboot into recovery
  4. Take a Nandroid backup
  5. Create mtdpartmap.txt on SD card with size of system & cache, the example provided sets system to 125MB and cache to 5MB, this will depend on your ROM: echo "mtd 125 5" > /sdcard/mtdpartmap.txt
  6. Format system, data, and cache (found under mounts and storage)
  7. Flash bravo-recovery-v1.5.3-CustomMTD.zip, this patches recovery to use the new partition sizes
  8. Reboot into recovery
  9. Format system, data, and cache again for good measure (found under mounts and storage)
  10. Flash ROM, or restore Nandroid backup, it will be flashed to NAND based on new partition sizes
  11. Prior to rebooting, flash bravo-boot-v1.5.3-CustomMTD.zip, this patches ROM kernel to load with same partition sizes.
  12. Enjoy

Warnings:
Do not attempt to flash radio via recovery/ZIP, only do it via fastboot.
Has only been tested on HTC Desire, may not work on other phones.
Some users have suggested small cache size affects performance in games, if you play games on your phone it may be worth setting cache to 20-35MB

Uninstalling:
Removing this is simple.
Boot in to fastboot
Fastboot flash the original unmodified clockwork img
Reboot into recovery
Format system, data, cache
Install ROM/ZIP, gapps etc, reboot

Download:
bravo-recovery-v1.5.3-CustomMTD.zip
bravo-boot-v1.5.3-CustomMTD.zip

Credits:
  • AlphaRev - for bringing S-OFF to HTC Desire
  • Firerat - for the original patch. I will be forwarding you the exact changes/details shortly.
  • Lbcoder - for coming up with the idea
  • Skraw ( CM forums ) - for getting lbcoder interested
  • Koush - for AnyKernel
  • Cyanogen & Co - for giving us all such great ROMs to play with
  • Amon_RA and Koush - for giving us something to patch
  • Techjosh - for fixing the patchers for use with Rogers (EBi1)
  • Mblaster - for pointing out my nasty habit of using -r zip flag at the end of command ( breaks compatibility with older zip versions, fixed in AutoPatcher v1.5)
  • Kali- for porting CM6 to Desire thanks a bunch
  • I don't take any credit for this, other than the time invested to get it working on the Desire.


Code:
Filesystem           1K-blocks      Used Available Use% Mounted on
tmpfs                   208112         0    208112   0% /dev
tmpfs                   208112         0    208112   0% /mnt/asec
/dev/block/mtdblock3    128000    123932      4068  97% /system
/dev/block/mtdblock5    315008    184048    130960  58% /data
/dev/block/mtdblock4      5120       776      4344  15% /cache
/dev/block/mmcblk0p2    505636      2307    477224   0% /sd-ext
/dev/block/vold/179:1
                       7431564   5413644   2017920  73% /mnt/sdcard
/dev/block/vold/179:1
                       7431564   5413644   2017920  73% /mnt/secure/asec
/dev/block/dm-0           3124      1504      1620  48% /mnt/asec/com.google.android.stardroid-1
Last edited by daedelus82; 19th October 2010 at 01:57 PM.
The Following 25 Users Say Thank You to daedelus82 For This Useful Post: [ View ]
12th October 2010, 09:15 AM   |  #2  
OP Senior Member
Thanks Meter: 38
 
154 posts
Join Date:Joined: Sep 2009
More
Reserved
Just in case
12th October 2010, 09:19 AM   |  #3  
zHk3R's Avatar
Senior Member
Flag Hoth
Thanks Meter: 1,452
 
1,271 posts
Join Date:Joined: Aug 2009
Donate to Me
More
Interesting

Nice work.
12th October 2010, 09:23 AM   |  #4  
Narfx's Avatar
Senior Member
Flag A Coruņa
Thanks Meter: 12
 
223 posts
Join Date:Joined: Jul 2010
Now THIS is what I was waiting for when I s-offed my desire
12th October 2010, 09:24 AM   |  #5  
mercianary's Avatar
Senior Member
Flag Brum
Thanks Meter: 71
 
722 posts
Join Date:Joined: May 2010
More
Good stuff can't wait to try it out.

Thanks.
12th October 2010, 09:32 AM   |  #6  
Senior Member
Thanks Meter: 30
 
242 posts
Join Date:Joined: Jun 2010
Yeahaa ... that's what many people waiting for ... Thank you very much for that work !
12th October 2010, 09:41 AM   |  #7  
karmatt's Avatar
Member
Flag Gothenburg
Thanks Meter: 11
 
81 posts
Join Date:Joined: Apr 2010
More
Nice work!
12th October 2010, 09:47 AM   |  #8  
Junior Member
Thanks Meter: 0
 
4 posts
Join Date:Joined: Nov 2007
Very very Interesting...


HTC Desire
DeFrost 5.1 rom
12th October 2010, 09:47 AM   |  #9  
fridlack's Avatar
Senior Member
Flag Gava, Barcelona
Thanks Meter: 93
 
659 posts
Join Date:Joined: May 2009
More
Which is the command to see the partition sizes? i undestand is under adb but cant find the commands
12th October 2010, 09:56 AM   |  #10  
Senior Member
Thanks Meter: 5
 
223 posts
Join Date:Joined: Jul 2010
wait a sec... couldn't this be used to resize the /system to fit the complete Desire HD rom... ofc that would not allow you to have custom apps, but still o.O

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes