Go Back   Android Forums > Android Phones > HTC Desire > Desire - All Things Root

New Forums: Nexus Player | Nexus 9
test: Reply
 
LinkBack Thread Tools
Old March 1st, 2011, 02:18 PM   #1 (permalink)
Senior Member
Thread Author (OP)
 
Rastaman-FB's Avatar
 
Join Date: Sep 2009
Location: UK
Posts: 6,113
 
Device(s): HTC Desire (depreciated) Blue Galaxy s3 (international)
Carrier: Not Provided

Thanks: 114
Thanked 1,016 Times in 838 Posts
Default [GUIDE] Custom MTD (system/data/cache) Layout for Desire with AmonRA 2.0.x

Long title i know but this needs to be done as all guides refer to clockwork and a few questions are asked but not answered with regards to whether this is possible with AmonRA and or a custom Alpharev hboot setup.

YES IT IS

1st things 1st, you must have S-OFF from Alpharev AlphaRev 1.8 1.8 is the latest and i would recommend flashing to this is you are on 1.5 or below
I was on N1table but it should work with all (other than oxygen)
Use "quick system info" from the market to determine your minimum layout requirements

Get the needed files from here [DEV][S-OFF] Custom MTD Partitions (resize data, system, and cache) - xda-developers and place them into a folder of choice on the SDCARD (i made one called "00CustomMTD" so it appeared at the top of the list

Create a file on the root of the SDCard called "mtdpartmap.txt" in the txt files put the values of the layout you are wanting to create (in my example i put "140 25" which is 140 system and 25 cache) - do not use quotes

once you have the files in place boot to recovery and make a nandroid backup with ext (remember this is amonRA 2.0.x)
Power down the device and boot back to hboot then select fastboot, connect device and use the following commands:
Code:
fastboot erase system
fastboot erase data
fastboot erase cache
select recovery then go to "flash zip from sdcard" navigate to your folder and choose "bravo-recovery-v1.5.3-CustomMTD.zip"
once complete you will need to reboot recovery, you cannot do this in amonRA so open command prompt on pc and use :
Code:
adb shell reboot recovery
once rebooted go back to backup/restore and restore your backup but do not reboot
once you have restored go back to "flash zip from sdcard" navigate to your folder and choose "bravo-boot-v1.5.3-CustomMTD.zip"
once done "reboot system now" and you will have your new custom layout

note: use system info to see your new layout

Advertisements
__________________
Samsung Galaxy S3 (playing with roms still)
Siyah Kernel

Rastaman-FB is offline  
Last edited by Rastaman-FB; March 1st, 2011 at 03:08 PM.
Reply With Quote
The Following 12 Users Say Thank You to Rastaman-FB For This Useful Post:
chronicfathead (July 23rd, 2011), Exiled_SouL (June 18th, 2011), FoX777 (February 13th, 2012), GingaB (July 20th, 2011), Hadron (March 2nd, 2011), kewlbuddy (March 1st, 2011), LfcFan1977 (January 5th, 2012), porter_james (March 2nd, 2011), Sak01 (June 12th, 2011), shauny13 (March 1st, 2011), Staggers (March 3rd, 2011), SUroot (March 1st, 2011)
sponsored links
Old March 3rd, 2011, 12:24 PM   #2 (permalink)
ROM Developer
 
SUroot's Avatar
 
Join Date: May 2010
Location: Riddlesden, West Yorkshire, UK
Posts: 23,926
 
Device(s): SGS3 (Current) HTC Desire (Retired)
Carrier: 3 UK

Thanks: 1,923
Thanked 5,326 Times in 3,995 Posts
Default

Oh damn, so theres no format / erase option in the recovery itself?
SUroot is offline  
Reply With Quote
Old March 3rd, 2011, 02:18 PM   #3 (permalink)
Senior Member
Thread Author (OP)
 
Rastaman-FB's Avatar
 
Join Date: Sep 2009
Location: UK
Posts: 6,113
 
Device(s): HTC Desire (depreciated) Blue Galaxy s3 (international)
Carrier: Not Provided

Thanks: 114
Thanked 1,016 Times in 838 Posts
Default

no thats why there are the fastboot commands in the guide
you can format sdcard using partition but for erasing mtd partitions there are no commands
Rastaman-FB is offline  
Last edited by Rastaman-FB; March 3rd, 2011 at 02:21 PM.
Reply With Quote
Old March 3rd, 2011, 03:43 PM   #4 (permalink)
Member
 
Staggers's Avatar
 
Join Date: Apr 2010
Location: Brighton, UK
Posts: 197
 
Device(s): Samsung Galaxy Nexus,HTC Desire
Carrier: Not Provided

Thanks: 38
Thanked 40 Times in 36 Posts
Default

Thanks for this. I've decided to hold off on flashing GV 1.3 and re-doing my custom MTD setup using CWM given all the worries other people are reporting between here and XDA. Glad to know I at least have another option if need be.
Staggers is offline  
Reply With Quote
Old March 3rd, 2011, 04:41 PM   #5 (permalink)
Senior Member
Thread Author (OP)
 
Rastaman-FB's Avatar
 
Join Date: Sep 2009
Location: UK
Posts: 6,113
 
Device(s): HTC Desire (depreciated) Blue Galaxy s3 (international)
Carrier: Not Provided

Thanks: 114
Thanked 1,016 Times in 838 Posts
Default

by the looks of things its not the mtd thats caused it. its simply flashing a zip that does something
maybe there is an bit of code that is not closed that causes a trigger when accessed by certain scripts
Rastaman-FB is offline  
Reply With Quote
Old March 24th, 2011, 04:29 PM   #6 (permalink)
New Member
 
Join Date: Jan 2011
Posts: 3
 
Device(s): HTC Desire A8181
Carrier: Not Provided

Thanks: 0
Thanked 1 Time in 1 Post
Default

I have read and understood the procedure and the principle of custom partitioning the internal flash. Now I have another question. On the Alpharev site, there are several versions of HBOOT with custom MTD layouts. How are they built? I have performed a binary comparison between 2 versions and I have not been able to sort the things out (changing bytes between them to take into account the endianness hasn't helped).
AlxMAX is offline  
Last edited by AlxMAX; March 24th, 2011 at 04:31 PM. Reason: Corrected some typos.
Reply With Quote
Old March 24th, 2011, 05:10 PM   #7 (permalink)
ROM Developer
 
SUroot's Avatar
 
Join Date: May 2010
Location: Riddlesden, West Yorkshire, UK
Posts: 23,926
 
Device(s): SGS3 (Current) HTC Desire (Retired)
Carrier: 3 UK

Thanks: 1,923
Thanked 5,326 Times in 3,995 Posts
Default

the alpharev hboots are not custom. By custom here, we refer to the ability to set your own custom sizes, not whatalpharev have designed.

Alpharev controls the partition sizes via hboot but these custom layouts are defined by a text file which is then used to patch recovery and romm boot.img

2 totally different methods to achieve the same thing, however with this method you can define your own sizes.

Rastaman's guide is if you use amon ra as your recovery. If you use clockwork, the original version of this is linked in my signature.
SUroot is offline  
Reply With Quote
Old March 24th, 2011, 05:49 PM   #8 (permalink)
New Member
 
Join Date: Jan 2011
Posts: 3
 
Device(s): HTC Desire A8181
Carrier: Not Provided

Thanks: 0
Thanked 1 Time in 1 Post
Default

Thank you for your answer.

Quote:
Originally Posted by SUroot View Post
the alpharev hboots are not custom. By custom here, we refer to the ability to set your own custom sizes, not whatalpharev have designed.
Well, I must admit that you are right. They are adapted by ieftm & co according to the most popular ROMs.

Quote:
Originally Posted by SUroot View Post
Alpharev controls the partition sizes via hboot (...)
This is precisely what I would like to understand and maybe do it: control the partitions sizes via hboot. I have found nothing on the internet so far. Maybe I am using the wrong query terms...

Quote:
Originally Posted by SUroot View Post
(...) but these custom layouts are defined by a text file which is then used to patch recovery and romm boot.img
I have understood that too: the kernel is forced to "find" the partitions at specific places via the command line by rebuilding the boot.img (for the rom and for the recovery).
AlxMAX is offline  
Last edited by AlxMAX; March 24th, 2011 at 05:51 PM. Reason: rephrased.
Reply With Quote
Old March 24th, 2011, 06:00 PM   #9 (permalink)
ROM Developer
 
SUroot's Avatar
 
Join Date: May 2010
Location: Riddlesden, West Yorkshire, UK
Posts: 23,926
 
Device(s): SGS3 (Current) HTC Desire (Retired)
Carrier: 3 UK

Thanks: 1,923
Thanked 5,326 Times in 3,995 Posts
Default

Ah I see.

There's not much the internet can tell you about this to be honest.

I don't know how alpharev would respond to queries, but you can ask
SUroot is offline  
Reply With Quote
Old July 23rd, 2011, 02:34 PM   #10 (permalink)
New Member
 
Join Date: Jul 2011
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi

I tried it as per your instructions, but I still had the same layout.

I'm not sure if it was because I created the TXT file in TextEdit on the Mac, and changed the extension to .TXT, or if it was because the second time I changed the text in the file to " mtd 120 20 " (minus the ")

In the end I created the mtdpartmap.txt file using TextEdit, but changed it to a plain text file using the format menu and choosing the "make plain text" option, before saving it. (see attachment)

It didn't brick my phone, or cause any issues when I booted, but I still had the same layout when I used the renamed .RTF file instead of a true .TXT file. After using the proper .TXT file with mtd 120 25 in, it worked perfectly.

Thanks
Attached Images
File Type: jpg Textedit plain text.jpg (20.6 KB, 6 views)
chronicfathead is offline  
Reply With Quote
sponsored links
Old July 24th, 2011, 06:16 AM   #11 (permalink)
Senior Member
Thread Author (OP)
 
Rastaman-FB's Avatar
 
Join Date: Sep 2009
Location: UK
Posts: 6,113
 
Device(s): HTC Desire (depreciated) Blue Galaxy s3 (international)
Carrier: Not Provided

Thanks: 114
Thanked 1,016 Times in 838 Posts
Default

yeah it must be a proper .txt file
you can have mtd 120 20 or just 120 20
Rastaman-FB is offline  
Reply With Quote
Old June 6th, 2012, 07:54 AM   #12 (permalink)
New Member
 
Join Date: May 2012
Location: London
Posts: 10
 
Device(s): HTC Desire, S-Off, Rooted
Carrier: Not Provided

Thanks: 4
Thanked 0 Times in 0 Posts
Default

Ok, I just tried flashing my own custom MTD and the results are in. I wanted to set system at 260 (from 250) and cache at 30 (from 202) with the rest for data. In the mtdpartmap.txt I put "mtd 260 30" (minus parentheses)

It seems after going through the process above, I've got system at 260 but the cache is still at 202 which leaves not a great deal room left for data.

Any thoughts, help or suggestions on why this might've happened and what to do next?

Would love some advice on this -thanks!
BobbyKSmooth is offline  
Reply With Quote
Old June 6th, 2012, 10:38 AM   #13 (permalink)
AF Contributor
 
Hadron's Avatar
 
Join Date: Aug 2010
Location: Dimension Jumping
Posts: 12,485
 
Device(s): HTC One (S-Off), HTC Desire (retired)
Carrier: Orange UK

Thanks: 2,305
Thanked 5,242 Times in 3,768 Posts
Default

What ROM are you using?

The reason I ask is that I don't think you actually have a 202 MB /cache partition. 260 system + 202 cache would be 462 MB, which is larger than the internal space available on a Desire (stock configuration is 250 system + 40 cache + 147 data = 437 MB). I suspect that your ROM is using some other trick, such as an ext partition or a RAM disk, in place of the cache for market downloads and so the size of cache you see there is not the actual cache partition size. For example, I'm using dGB (which uses a temporary RAM disk for market downloads) with a 5MB /cache, but Quick System Info thinks my system cache is 203 MB.

What /data size do you think you have? I suspect that has not changed, because you've increased /system by 10MB and reduced /cache by the same (40 -> 30). If your ROM is using some other trick for market downloads you can probably get away with a much smaller /cache.
__________________
Forum Rules & Guidelines - Android Forums FAQ
If a post helps you, use the Thanks! button.
Spam or offensive? Don't respond, report it /!\
Hadron is offline  
Reply With Quote
The Following User Says Thank You to Hadron For This Useful Post:
BobbyKSmooth (June 6th, 2012)
Old June 6th, 2012, 03:17 PM   #14 (permalink)
New Member
 
Join Date: May 2012
Location: London
Posts: 10
 
Device(s): HTC Desire, S-Off, Rooted
Carrier: Not Provided

Thanks: 4
Thanked 0 Times in 0 Posts
Default

Hi Hadron, thanks for the reply.

This is my first ever attempt at anything like this and it's taken me two weeks of solid reading and trial and error to get this far, so I'll do my best to explain what I've done!

I'm using AceSMod007-3D here: [ROM] AceSMod007-3D (Sense 3.0 | GB 2.3.5 | A2SD+) [STOCK | CM7] [v28 | 19/02] - xda-developers

I created a 1Gb partition on my SD card and used A2SD transferring the Dalvik Cache with Terminal Emulator. I did notice after installing the apps I wanted/needed that I was starting to get internal memory messages, which led me to trim back to only the essential apps. Hence my attempt at this.

If I understand you correctly, you're absolutely right those numbers don't add up. Quick System Info tells me the following:

Internal storage: 148mb /15mb
System storage: 260mb / 17.27mb
System cache: 202mb / 202mb

(A grand total of 610mb? Not possible surely?)

Also A2SD is 0.98Gb / 720mb

As I said, I had intended to set the custom MTD at 260 system 30 cache with the rest for data. Could it be the ROM is interfering with that?

Any further thoughts on why this might be happening or what next? I've managed to get this far without help but feel a bit stuck on this one.
BobbyKSmooth is offline  
Reply With Quote
Old June 6th, 2012, 03:42 PM   #15 (permalink)
AF Contributor
 
Hadron's Avatar
 
Join Date: Aug 2010
Location: Dimension Jumping
Posts: 12,485
 
Device(s): HTC One (S-Off), HTC Desire (retired)
Carrier: Orange UK

Thanks: 2,305
Thanked 5,242 Times in 3,768 Posts
Default

OK, I'm sure that the "cache" is misleading, i.e. isn't really showing the size of your cache partition. I don't know this ROM, so don't know what solution it is using, but it clearly has some way of dealing with small cache partitions if there is a CM7r2 version (that table uses a 5MB cache partition). Without downloading and dissecting the ROM I don't know what that solution is, but your numbers look like I suspected: 148 MB system = default, which is what I'd expect if you make /system 10MB larger and simultaneously shrink /cache by the same amount. I rather suspect that this would work fine with 250 system, 5 cache, which would gain you 35MB.

One question: why did you increase the size of /system? You now have 17MB free rather than 7MB, but unless you plan on moving stuff into /system that is just wasting space.

OK, back on topic. Your ext partition is clearly being used, but as this is a Sense 3.0 ROM that may just be the ROM using it. To be honest, unless you have a lot of apps, or some app has gone crazy with its data usage, you have too little space left in /data so I suspect the a2sd may not be working. You could use a root capable file browser to see what is actually using it (Root Explorer or ES File Explorer). Or you could try reinitialising the DarkTremor a2sd script: open a terminal emulator and type

su
a2sd reinstall

After that the phone will reboot. Then try

su
a2sd cachesd

See whether this makes a difference to your free space.
Hadron is offline  
Last edited by Hadron; June 6th, 2012 at 03:44 PM.
Reply With Quote
The Following User Says Thank You to Hadron For This Useful Post:
BobbyKSmooth (June 6th, 2012)
Old June 6th, 2012, 04:20 PM   #16 (permalink)
New Member
 
Join Date: May 2012
Location: London
Posts: 10
 
Device(s): HTC Desire, S-Off, Rooted
Carrier: Not Provided

Thanks: 4
Thanked 0 Times in 0 Posts
Default

Ah, my resizing of the system cache is probably showing up my inexperience there. I thought that was a fluctuating figure and that by adding an extra 10mb it might buy it some more 'breathing room' as it were. I'm guessing now that is not the case and I should reduce it to 250 again?

I reinitialised the Dark Tremor script as suggested and it was successful. However, the numbers didn't change at all.

I have ES File Explorer installed already - what should I be looking for?

If I flash CM7r2 instead would that buy me more space or am I barking up the wrong tree there? Should I stick with using a custom table?

Thanks once again for your help.
BobbyKSmooth is offline  
Reply With Quote
Old June 6th, 2012, 05:20 PM   #17 (permalink)
AF Contributor
 
Hadron's Avatar
 
Join Date: Aug 2010
Location: Dimension Jumping
Posts: 12,485
 
Device(s): HTC One (S-Off), HTC Desire (retired)
Carrier: Orange UK

Thanks: 2,305
Thanked 5,242 Times in 3,768 Posts
Default

It's probably worth reading the root memory faq again.

The Desire has 3 internal storage partitions: /system, /data and /cache. The sizes of all of these are fixed. The way the custom mtd works is that you specify the sizes of /system and /cache, and the rest is left for /data (which is what is shown as the "internal storage" space on the phone.

What you should look for? It's been a while since I used an a2sd script, so I can't give a definite answer and have to rely on memory. You need to look at the whole system, rather than the sd card (the default). Touch the star ("favourites") icon and select "/". You may have to enable "root explorer" in the settings. Just look in sdext and see what seems to be in there. Look for a dalvik-cache directory, for example (may be inside a "data" directory or something similar). Also an app directory. And see whether there is anything inside them.

You might also learn something by using the infamous terminal emulator and typing

su
ls -l /data/app

If that shows as a link (e.g. something like "/data/app -> /sdext/...) that would suggest that it's set up correctly.

Question is, how many apps have you got if it is working and only have 15MB left? I could believe that if the dalvik cache was still internal, but otherwise it should take effort to fill 133MB. Are any apps using crazy amounts of data (Quick System Info can display apps sorted by data size, and even the manage applications menu can sort by total size)? Remember that system apps use space for their data too.
Hadron is offline  
Reply With Quote
The Following User Says Thank You to Hadron For This Useful Post:
BobbyKSmooth (June 6th, 2012)
Old June 6th, 2012, 05:42 PM   #18 (permalink)
New Member
 
Join Date: May 2012
Location: London
Posts: 10
 
Device(s): HTC Desire, S-Off, Rooted
Carrier: Not Provided

Thanks: 4
Thanked 0 Times in 0 Posts
Default

Ok, so I had a look in sdext and Dalvik Cache and it seems there is plenty in there - so I guess that is a good thing. Running the line on Terminal Emulator gave me a link to sdext/apps so that seems to be set up correctly too.

Sorting the apps by size showed that the second biggest for data use (after Contacts) was MyFitnessPal with 25mb. All others were 5mb or less (and I don't have that many). I guess that must be the problem but I do use it everyday.

Is there any way around this with a custom mtd or am I going to have to bite the bullet and just delete the app? Would an alternative ROM be worth considering?
BobbyKSmooth is offline  
Reply With Quote
Old June 6th, 2012, 05:57 PM   #19 (permalink)
AF Contributor
 
Hadron's Avatar
 
Join Date: Aug 2010
Location: Dimension Jumping
Posts: 12,485
 
Device(s): HTC One (S-Off), HTC Desire (retired)
Carrier: Orange UK

Thanks: 2,305
Thanked 5,242 Times in 3,768 Posts
Default

Second biggest after contacts? How much space was contacts using? I have several hundred contacts and order of 1000 phone numbers, and Contacts Storage is using 1.4 MB. If your contact storage is > 25MB it's worth looking into that a bit deeper. It may be that you have a lot of duplicated data - the normal contacts display hides this, but if you edit a contact you may see the duplication (or multiplication). This is something that does sometimes happen, and a known cause of low memory problems (it comes up in the non-root low memory threads often enough).
Hadron is offline  
Reply With Quote
Reply
Tags
"custom mtd", "data partition", "mtd layout", desire, mtd


Go Back   Android Forums > Android Phones > HTC Desire > Desire - All Things Root
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 01:37 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.