[G2 and Desire Z Q&A, Help & Troubleshooting] ilf_:
I have a HTC Desire Z Model A7272 with the microSD microSDHC SanDisk 8 GB Class 4.

CyanogenMod 7.0.3

After rooting and installing CyanogenMod 7.0.3, I went to Settings -> Storage -> Erase SD Card. Doing that showed two confirmation screens Erase SD Card -> Erase everything and then the notification bar said:

SD card safe to remove
Blank SD card

Opening the notification bar sais:

Blank SD card
SD Card blank or has unsupported file system

with the option Format SD card. Doing that, enters the circle again, displaying one after another:

SD card safe to remove
Blank SD card
SD Card blank or has unsupported file system

Same with Settings -> Storage -> Mount SD Card and Erase SD Card.

After Googling and Reading I booted ClockworkMod Recovery:

ClockworkMod Recovery 3.0.2.4

There I did mounts and storage -> mount /sdcard, which resulted in:

Error mounting /sdcard!

Same with mounts and storage -> format /sdcard:

Formatting /sdcard...
Error mounting /sdcard!
Skipping format...

The option advanced -> Partition SD Card only displays ext sizes until 4 GB, my card is 8 GB.

So I enter the shell:

Android Debug Bridge version 1.0.26 shell

VBusyBox v1.16.2androidfull

Boot Log sais:

# [I]dmesg[/I]
<6>[ 4.893951] mmc2: new high speed SDHC card at address e624
<6>[ 4.894866] mmcblk1: mmc2:e624 SU08G 7.40 GiB
<6>[ 4.895202] mmcblk1: p1

List the partition table:

# [I]fdisk -l /dev/block/mmcblk1[/I]
Disk /dev/block/mmcblk1: 7948 MB, 7948206080 bytes
256 heads, 63 sectors/track, 962 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes

Device Boot Start End Blocks Id System
/dev/block/mmcblk1p1 * 1 963 7760896 c Win95 FAT32 (LBA)
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(1023, 255, 63) logical=(0, 32, 33)
Partition 1 has different physical/logical endings:
phys=(1023, 255, 63) logical=(962, 138, 10)

Trying to mount it by hand:

# [I]mount -v -t vfat /dev/block/mmcblk1p1 /mnt/sdcard[/I]
mount: mounting /dev/block/mmcblk1p1 on /mnt/sdcard failed: Invalid argument

System call trace of that:

# [I]strace mount -v -t vfat /dev/block/mmcblk1p1 /mnt/sdcard[/I]
stat64("/dev/block/mmcblk1p1", {st_mode=S_IFBLK|0600, st_rdev=makedev(179, 33), ...}) = 0
mount("/dev/block/mmcblk1p1", "/mnt/sdcard", "vfat", MS_VERBOSE, ""...) = -1 EINVAL (Invalid argument)
write(2, "mount: mounting /dev/block/mmcbl"..., 77mount: mounting /dev/block/mmcblk1p1 on /mnt/sdcard failed: Invalid argument
) = 77
mprotect(0x40008000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0x40008000, 4096, PROT_READ) = 0
munmap(0x40008000, 4096) = 0
SYS_248(0xffffffff, 0x1000, 0xafd46300, 0xafd46300, 0xffffffff <unfinished ... exit status 255>

Unfortunately, the following programs I am used to by Linux are not available on my phone: blkid, fsck, mkfs.

I tried creating a new partition table with one primary partition over the entire size. Neither ClockworkMod Recovery nor CyanogenMod wanted to format or mount this. However, one of them changed the partition table back to what can be seen above.

Unfortunately, I can not currently put the card into another device to debug/format/mount it there.

Any idea how I can debug this further on my phone?