[G2 and Desire Z Android Development] ohyonghao:
My Semi-bricked Desire Z

I'm not sure how I did it but I semi-bricked my Desire Z. I think it may have been when I tried to install cwmsrc-3.0.0.2.zip by using cwm install from a zip on sdcard. The zip only contained the image cwmsrc-3.0.0.2.img. This was also after failing to install cm7 with a status 7 error.

I have both fastboot and adb. Fastboot doesn't let me flash anything though, it gives a FAILED (remote: not allow) error. My best bet then is adb and cwm.

I try flashing to my last known good backup using restore. It restores, but rebooting brings me to the HTC screen, typing adb gives me the "/system/bin/sh" No such file or directory (2) error.

Reboot, may have to press power and vol-dwn to get back into recovery by first going through bootloader. Once in I then install from zip and reinstall cm6.1.1. Reboot and I'm stuck on the HTC screen, but good news! I can adb into the system.

From here I notice it's in the Audio loop that I've seen before while cooking custom mods that didn't work. I analyze the logcat dump and notice a couple things. First there is a chdir error as the first line after the Cyanogen logo, the second line is similar complaining about not finding any kernel modules.

Further down where the android system starts up there are complaints about certain files missing. I adb shell into the system and type mount on the command prompt. I notice that /data and /cache are missing; these are the places that I notice giving errors in the logs.

/data is /dev/block/mmcblk0p26

/cache is /dev/block/mmcblk0p27

I mount /data with // Note: you should mount /data before cache each time.

mount /dev/block/mmcblk0p26 /data

then I type

ls /data

I discover that it is empty. I start to fill the missing directories.

I then mount /cache with

mount /dev/block/mmcblk0p27 /cache

and then type

ls /cache

I notice strangely that this is also empty. It might not be too strange since I did a data wipe and cache wipe before, but the system doesn't seem to be restoring the file structure.

Once I have created some basic directories, such as the following

/data/data

/data/local

/data/dalvik-cache

/data/app

/data/app-private

/data/misc

/data/system

/data/backup

/data/dontpanic

/cache/dalvik-cache

it then started seeing a ton of action and I got a Cyanogen Mod boot screen.

After a while (about 5 minutes, the same for doing a clean install) I get the fresh install setup wizard. But there are some fc's going on and it seems hard to use. What I really want to do is try to get cwm back to version 2.5.1.3 and see if that helps me at all.

Try as I may the network connection is broked and su keeps spitting out errors and not working.

I reboot into recovery and try to restore a backup I made this morning. Reboot again and it's the same as the first time, missing "/system/bin/sh".

I reinstall cm6.1.1 from zip, but this time I don't clear data or the cache. I get the same boot problems where the directories aren't mounting. I mount them using the above commands again. The directories are there from the previous time, plus they have all the data from my restore. When it boots it's my old restore that is running (the restore is from a cm6.1.1 install). All my apps are there, my internet works, and su works.

I flash cwm and also run fix-permissions for safe measure. I reboot and recovery doesn't come up at all, but adb is working but with the same problem of not mounting /data and /cache. After mounting them it boots up normally.

That's as far as I've gotten now. A little afraid to turn off/reboot the phone without a working recovery. I did test that the bootloader still works, but trying to load to recovery from the bootloader does not and also no adb.

If anybody has any suggestions on how to finish the job I'm all ears.

I hope this helps somebody.