[Sony Xperia T, TL, TX, V] Yokav:
Some infos about the swap of internal and external memory. (So I will not forget it and maybe another dev could look at this)

Actually, there is a script (init.d) available that work flawlessly:

#!/system/bin/sh
mount -t vfat -o umask=0000 /dev/block/vold/179:33 /storage/sdcard0
mount -o bind /data/media /storage/sdcard1

I don't know if other users use it but for me (on firmware .142) the mount of /storage/sdcard0 is KO and the mount of /storage/sdcard1 is OK. To have both of them OK, you've to trun the script again after the boot.

Another thing, I would like to be able to use the internal memory of the phone as sdcard1, could be usefull for backups. So making a "mount -o bind /mnt/int_storage /storage/sdcard1" will make this possible.

---- More information later :p (will update this post)

$Variable EXTERNAL_STORAGE set as "/storage/sdcard0"

$Variable SECONDARY_STORAGE set as "/storage/sdcard1"

/storage with permission 0050 and owners "root:sdcard_r"

/storage/sdcard0 with permission 0776 and owners "root:sdcard_rw"

symlink to "/sdcard" and "/mnt/sdcard"

/storage/sdcard1 with permission 0770 and owners "root:sdcardd"

symlink to "/sdcard1" and "/mnt/ext_card" and "/ext_card"

/mnt/int_storage with permission 0770 and owners "root:sdcardd"

The internal memory is only really mount in /mnt/int_storage as an ext4 filesystem.

If the property "ro.boot.emmc" is set to true then there's a "rmt_storage".

== something interesting with this solution (inti.d script) if you choose the MSC mode after to have swap the int/ext memory, it will still connect the external memory to your computer!

----- New edit: after many tests I got more information!

Generally on other roms (for other devices), I just have to change the file /system/etc/vold.fstab to be able to swap the int/ext memory. But that doesn't work on X.T, I don't know what Sony do...

If I try to change the mount point it doesn't work at all. If I try to comment the "dev_mount" option, there if a FC message about "USB settings". If I try to comment the "fuse_mount", you can no more use the patch /sdcard, it gives a message about "SD card not mount blabla" and that's crazy because /storage/sdcard0 is accessible!

Finally, we've to leave the vold.fstab file as it's and use a script to change the mount points. But unfortunately, the init.d script that I past above in this message works flawlessly because the "fuse mount" is run after this script and override the information about "/sdcard".

So I think that the best thing to do it running a script ourself after the boot but what can we put into this script? Here's some answers...

#!/system/bin/sh
umount /storage/sdcard1
mount -o bind /mnt/int_storage /storage/sdcard1
chmod 777 /storage/sdcard1

That will mount the internal storage on /sdcard1 and you will be able to use it.

#!/system/bin/sh
stop sdcardd
umount /storage/sdcard0
mount -t vfat -o umask=0000 /dev/block/platform/msm_sdcc.3/by-num/p1 /storage/sdcard0

That will mount the external storage on /sdcard and you will be able to use it.

Be careful with these scripts, they should work fine but it's a first idea and I don't try/use them a lot for now.