[HTC Desire S] kibril:
I have bricked EMMC chip on my HTC Desire S, but bootloader and recovery working in readonly mode. I created the partition table on the external memory card (Micro SD), similar to the structure of internal memory in the extended partition. I modified the init.saga.rc in boot.img for using new partitions on sdcard. After booting over fastboot, I got a working phone

But i need help to configure the phone to use the internal memory, 1st partition on sdcard mmcblk1p1(vold/179:65 - fat32) or /data partition for DCIM, Music and etc.

I see several solutions, but do not know how to do:

1. "/data" partition, like /data/Documents...

2. Automounting through DirectVolume manager 1st partion on sd

3. Mount through init.rc, but system cant find STORAGE

4. Make 2nd storage like PHONE_STORAGE/INTERNAL_STORAGE

5. ?????

# logcat | grep Vold
logcat | grep Vold
I/Vold ( 1217): Vold 2.1 (the revenge) firing up
D/Vold ( 1217): Volume sdcard state changing -1 (Initializing) -> 0 (No-Media
)
D/Vold ( 1217): Volume sdcard state changing 0 (No-Media) -> 2 (Pending)
D/Vold ( 1217): USB connected
D/Vold ( 1217): Share method ums now available
D/Vold ( 1217): USB connected
D/VoldCmdListener( 1217): volume list
D/VoldCmdListener( 1217): share status ums

# logcat | grep Volume
logcat | grep Volume
D/Vold ( 1217): Volume sdcard state changing -1 (Initializing) -> 0 (No-Media
)
D/Vold ( 1217): Volume sdcard state changing 0 (No-Media) -> 2 (Pending)
W/DirectVolume( 1217): Invalid 'PARTN' value
W/DirectVolume( 1217): Invalid 'PARTN' value
W/DirectVolume( 1217): Invalid 'PARTN' value
W/DirectVolume( 1217): Invalid 'PARTN' value
W/DirectVolume( 1217): Invalid 'PARTN' value
W/DirectVolume( 1217): Invalid 'PARTN' value
W/DirectVolume( 1217): Invalid 'PARTN' value
W/DirectVolume( 1217): Invalid 'PARTN' value

# logcat | grep Mount
I/SystemServer( 1332): Mount Service
D/MountService( 1332): got storage path: /mnt/sdcard description: USB storage pr
imary: true removable: true emulated: false mtpReserve: 0 allowMassStorage: true
maxFileSize: 4294967296
E/MountService( 1332): Error processing initial volume state
E/MountService( 1332): java.lang.Exception: Unexpected state 2
E/MountService( 1332): at com.android.server.MountService$2.run(MountService.ja
va:656)
D/MountService( 1332): volume state changed for /mnt/sdcard (null -> removed)

# mount
mount
rootfs on / type rootfs (ro,relatime)
tmpfs on /dev type tmpfs (rw,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
none on /acct type cgroup (rw,relatime,cpuacct)
tmpfs on /mnt/asec type tmpfs (rw,relatime,mode=755,gid=1000)
tmpfs on /mnt/obb type tmpfs (rw,relatime,mode=755,gid=1000)
none on /dev/cpuctl type cgroup (rw,relatime,cpu)
/dev/block/mmcblk1p8 on /system type ext4 (ro,relatime,barrier=1,data=ordered)
/dev/block/mmcblk1p9 on /data type ext4 (rw,nosuid,nodev,noatime,barrier=1,data=
ordered,noauto_da_alloc)
/dev/block/mmcblk1p10 on /cache type ext4 (rw,nosuid,nodev,noatime,barrier=1,dat
a=ordered)
/dev/block/mmcblk1p11 on /devlog type ext2 (rw,nosuid,nodev,noatime,barrier=1,da
ta=writeback)
/sys/kernel/debug on /sys/kernel/debug type debugfs (rw,relatime)

# ls -l dev/block/vold
brw-rw---- 1 root root 179, 64 Jul 3 11:09 179:64
brw-rw---- 1 root root 179, 65 Jul 3 11:09 179:65
brw-rw---- 1 root root 179, 66 Jul 3 11:09 179:66
brw-rw---- 1 root root 179, 69 Jul 3 11:09 179:69
brw-rw---- 1 root root 179, 70 Jul 3 11:09 179:70
brw-rw---- 1 root root 179, 71 Jul 3 11:09 179:71
brw-rw---- 1 root root 179, 72 Jul 3 11:09 179:72
brw-rw---- 1 root root 179, 73 Jul 3 11:09 179:73
brw-rw---- 1 root root 179, 74 Jul 3 11:09 179:74
brw-rw---- 1 root root 179, 75 Jul 3 11:09 179:75
brw-rw---- 1 root root 179, 76 Jul 3 11:09 179:76

# cat /etc/vold.fstab
# Mounts the first usable partition of the specified device
dev_mount sdcard /mnt/sdcard auto /devices/platform/msm_sdcc.4/mmc_host/mmc2

PS: Manual mount

mount /dev/block/mmcblk1p1 /mnt/sdcard

working, but system applications still want to EXTERNAL_STORAGE.