[HTC One S] modal11:
alternative fix

Same issue here for days now but it appears to be fixed. I will try to keep it short, I probably won't succeed. First post.

It all started when I installed Android 4.1.1 Jelly Bean CodefireX. After CWM failed to get past the HTC dev screen I installed TWRP and was successful. Except no SD card. After about 4 days of searching google, this forum and a few others I was unable to find an RUU that matches my Radio number (I'm new to Android, so bear with me if I don't know the proper terms) to go back in time. No system back up, yay me!

The strange thing was is I was still able to push files with adb to...something... that was labelled as /sdcard in TWRP but on reboot they would disappear. Didn't make sense. It's like the phone had decided that some temporary storage area was the sdcard.

Flashing to a stock recovery and running clear storage did not fix - SD still wasn't recognized. It would not show up as a mountable disk, any disk at all, in Windows or Linux either. Like an empty SD slot.

Was running out of ideas (literally had over 30 tabs open in Firefox), trying not to panic and decided to investigate the problem a bit further with the terminal emulator that came stock with CodefireX.

/sdcard was a symbolic link to /storage/sdcard0 with almost zero permissions (d---------) owned by system. I didn't know what to do about that as it would not let me alter the permissions on the symlink or the target. Then a possible solution hit me shortly after getting home from work today.

** IF YOU TRY THIS ~ BE CAREFUL!! ** DON'T DO THIS IF YOU HAVE DATA YOU NEED/WANT TO RECOVER!! **

If you are not familiar with linux/unix commands, I would probably ask someone who is to do this for you. Just in case, I am writing this as if speaking to someone who is going to do it anyway, but is new to it.

Requirements: Unlocked phone, Terminal Emulator & Superuser.

Ran Terminal Emulator,

su -

to get root/super user

Figured out which block device was the SD card

cd /dev/block/

fdisk -l *

/dev/block/mmcblk0p36 was listed as a 10GB block device and fdisk generated some errors regarding the cylinder size and an invalid partition table.

fdisk /dev/block/mmcblk0p36

fdisk generated a notice about automatically repairing the partition/device. At this point I figured "what do I have to lose?" and wrote the changes with "w" (no quotes).

The system generated a ioctl error and that the changes would not take effect until reboot.

reboot

Phone booted back up....first message was to mount the SD card - could not mount (I also still had my phone plugged into the computer, so that may have been why). Well of course, it's not formatted, so got out of that screen and went to Settings/Storage and the option to format the drive was there again and it WORKED!!

All folders appear to have been restored and no errors taking pictures etc. It's only been just over an hour now but I haven't run into any issues so far.

Hope this helps someone. I will update if I run into any issues or something goes wrong as a result.

P.S. How do I thank someone for a post? I see the Thanks Meter but no way to thank them (I bet it's a simple answer). **suddenly after posting I see it!**