[Desire Q&A, Help & Troubleshooting] infozerich:
Hello,

Okay, we have some things to work through.

You mentioned that there were errors accessing data from the sdcard and sometimes an error message appears such as the sdcard is damaged. Have you ever received an error message along the lines of: sdcard was unexpectedly removed?

Connectivity

I noticed some exceptions related to connectivity in the logcat:

E/ConnectivityService( 178): Exception trying to remove a route... No such process

For connectivity issues, try to toggle airplane mode to on and off. Additionally, I would check to make sure the APN settings are correct in Settings -> More. -> Mobile network settings -> Access Point Names.

If this doesn't work, toggling airplane mode on and off might help by restarting the radio. You can also type this from the phone app: *#*#4636#*#* and access Phone information. See if your signal strength is lower than -103 dBm. Around -70 dBm is acceptable.

Also, you can test other settings by setting your preferred network type to: GSM only, GSM auto (PRL) and WCDMA preferred. LTE and EvDo are not supported on this device.

Force closing apps and phone freezes

The only reference I could find for maildroid is:

W/ActivityManager( 178): Killing ProcessRecord{410478e0 919:com.maildroid/10051}: background ANR

I/ActivityManager( 178): Process com.maildroid (pid 919) has died.

I can only imagine the smartphone is under heavy load and the operation timed-out either because of an unhandled exception. That is, the device freezes, the app force closes and you return to the launcher homescreen.

Can you disable auto-rotate in the launcher and see if this helps? I noticed you've been using the default Trebuchet launcher, and the current ROM you're using is based on ICS. Have you tried Nova Launcher to see if it's more stable/responsive?

Also, what is the output of: cat /sys/devices/virtual/bdi/179:0/read_ahead_kb. The default value for the read-ahead cache for the sdcard is only 128kb.

Try flashing the attached zip files below. I'd start by flashing 2048kb first and seeing if the smartphone has stabilized. If problems still persist, we can rule this out.

http://xdaforums.com/showthread.php?t=1010807

I'm hoping increasing this will assist with access times to your sdcard and avoid a timeout. Furthermore, considering how you've tested many different ROMs, it's unlikely to be specific to a kernel parameter. We can learn more from a dmesg.

Optimize memory management to mitigate phone freezes

At the very least, try this universal solution: http://xdaforums.com/showpost.php?p=18703418&postcount=5021

From SManager -> Browse as Root -> Run the SuperCharger Starter Kit and install the included su, busybox and lib sqlite files. Then run V6_SuperCharger_for_Android_RC12_Test_6.sh.pdf as root (the skull icon).

Of course, if all else fails, we can always revert to stock. Here's a very detailed guide by bortak to address most issues with the HTC Desire:

http://xdaforums.com/showthread.php?t=1275632

Usually, the A2SD script needs to be manually activated through a terminal: a2sd install, before it makes changes to the filesystem. The INT2EXT script is universal, meaning it can work with any ROM as long as the sdcard has been partitioned accordingly: for every 100MB internal, have 500MB for sd-ext. Also, did you manage to see if the swap partition is being used as mentioned in the previous post?

I would highly recommend using Paranoid Android 2.54 with the INT2EXT script because it's the one I've been sticking to these past several months. So far it's very stable, and you simply flash the INT2EXT script right after flashing the ROM and GApps (optional).

There is probably a script that mounts these partitions so changing ROM that doesn't use the mount script will avoid this issue. tmpfs acts like a ramdisk, sacrificing the sdcard's durability for quick writes. The command to check the mount parameters is: dmesg /proc/partitions. You might see things along the lines of noatime, nodiratime, which is similar to disabling Last Access Time/Modified in Windows.

Unfortunately, using tmpfs wears down the sector of the disk where writes are being made. You can try using the Windows checkdisk tool to analyze and repair problems that appear, though.

Simply attach the HTC Desire (with sdcard) via USB to a PC running Windows and right-click the sdcard -> Go to Properties -> Tools -> Error-checking... Check now (grant admin rights). This will scan the sdcard for errors and attempt to repair them which is different from setting GUIDs in recovery.

Hopefully, it's simply the connector to the sdcard was loosened and can be adjusted to fit closely again if sent in for repair. Of course, there have also been many reported issues that suggests ICS is to blame: https://code.google.com/p/android/issues/detail?id=9736

However, reverting to stock via bortak's guide will certainly eliminate many outstanding questions, such as what are the build.prop settings and init.d scripts and kernel parameters and missing drivers? :)