[Sony Xperia T, TL, TX, V] bsined:
Ever since I bought my Xperia TL (LT30at), I've been upset at the ridiculous allocation of onboard memory: only 1.97GB were available for apps. The rest was allocated to an emulated external SD card, which meant that any app installed on it would lose widgets and suffer from other weird glitches on reboot. I've searched all over the place and couldn't find a solution until [MENTION=1017894]teidus[/MENTION] shared his method (per my research, it has been used on older devices from other manufacturers as well). I tried it and adjusted the steps to ensure 100% compatibility with my phone (and added explanations so that other devices could be tested).

See proof in the attached screenshots.

WARNING: You will lose a lot of data if you don't follow this guide!

WARNING: These operations require a rooted device. If you are running unrooted Android 4.3 or newer, you cannot proceed.

NOTE: All of these changes will be reversed if you flash an FTF that includes partition-image.sin.

DISCLAIMER: I'm not responsible for bricked devices and data loss from power surges, hardware damage, or changes to the linked software. Always check the native manuals for all the tools listed here!

Required Downloads:

1. Flashtool, which includes ADB (got questions about it? - ask them here) - requires installation

2. [MENTION=4904057][NUT][/MENTION]'s dual XZDualRecovery. I'm linking to v2.7.94 BETA installer. If you wish to check for a more recent version, go to his download page and do a page search (CTRL+F) for XT-lockeddualrecovery[version-goes-here].installer.zip. (got questions about it? - ask them here) - unzip to a location you'll remember (say, C:\xperia-resize\recovery\)

3. FTF with your phone's 4.1.2 firmware - save it to the default Flashtool firmware directory (C:\flashtool\firmwares\)

4. File system utilities (attached) - unzip to a location on your phone's physical SD card you'll remember (say, fs-utils\)​

The Guide (skip all the way to the bottom for the short guide if you know how to backup and flash FTFs):

1. Back up all data stored on internal storage:

Option 1: Connect your phone to the computer and save it to a computer drive.

Option 2: Open a file manager on the phone and copy it to a physical SD card (/sdcard1).​

2. Back up your current installation with either Online Nandroid or your current recovery and remove the SD card for safety.

3. Flash your phone with basic 4.1.2 install.

3.1 Turn off the phone.

3.2 Launch Flashtool.

3.3 Click the thunderbolt icon on the left and select Flashmode.

3.4 Select the appropriate 4.1.2 FTF from the list (it'll be there if you saved it to c:\Flashtool\firmwares\).

3.5 Tick "No final verification" checkbox on the right, click Flash, and when prompted, hold the VOLUME DOWN button, and connect the phone to the computer. The operation will take about 10 minutes. DISREGARD THE INSTRUCTIONS IN THE ANIMATION. Xperia T/TL doesn't have a hardware Back button.

3.6 When flashing is complete, boot the phone.​

4. Connect your phone to the computer and let the computer recognize it.

5. Enable USB debugging.

5.1 Go to (System) Settings -> Developer options and flip the switch in the top-right corner of the screen.

5.2 Look a bit down (toward the middle of the screen) and check USB debugging.​

6. Install the dual recovery.

6.1 Go to the location on your computer where you extracted dual recovery (e.g., C:\xperia-resize\recovery\).

6.2 Double-click install.bat.

6.3 Press 3 on your keyboard for the option 3. Installation on unrooted ROM.

6.4 Follow the instructions on your computer's screen.

6.5 When you will try to reboot the phone back into Android, the recovery will prompt you to root the OS. Do that.​

7. Boot into PhilZ Touch recovery by opening App Drawer, starting NDR Utils, and selecting the appropriate option.

8. When the phone boots into recovery, connect it to the computer.

9. Start ADB.

If you don't know where ADB is, press WIN + R on your computer keyboard, type cmd in the pop-up window, hit ENTER, then copy & paste this command (paste by right-clicking the command prompt window): cd C:\Flashtool\x10flasher_lib. Then type adb shell and hit ENTER again.​

10. Execute the following commands one-by-one (you can copy & paste, hit enter, and wait for the output):

umount /storage
parted /dev/block/mmcblk0
print

These commands unmount all drives, launch parted utility for mmcblk0 (onboard flash storage), and show the partition table.​

11. Record the beginning of the partition Userdata and the end of the partitionSDCard. These are the limits of your new partitions The numbers are in megabytes (MB) unless specified.

For Xperia T/TL, Userdata begins at 1621 and SDCard ends at 15.6GB. Xperia V (and any other device with less than 16GB of storage) will definitely have a different value.​

12. Remove the last 2 partitions by executing the following commands:

rm 14
rm 15

13. Calculate the new end point for Userdata, which is also the new start point for SDCard:

1621 (or another number you recorded in step 11) + additional space = new end. I added 4GB (4 ×1024MB = 4096MB) so my new end point was 7865. I advise to add at least 2GB (2048MB) to feel safe about having enough storage for apps. DON'T TRY TO REMOVE SDCARD ALTOGETHER BY ALLOCATING ALL OF THE AVAILABLE SPACE TO USERDATA! Emulated storage is coded into OS environment and requires additional modifications to work properly.​

14. Create and name new partitions by executing the following commands (don't copy the text in parentheses):

The system might throw several errors in the process. When prompted, just type ignore and hit ENTER.​

mkpartfs logical ext2 1621 7865 (change the numbers as appropriate for your device)
name 14 Userdata
mkpartfs logical ext2 7865 15.6GB (change the numbers as appropriate for your device and notice the GB to make sure the partition extends to the end of the onboard storage)
name 15 SDCard
quit

These commands create the partitions with ext2 file system and given beginning and end parameters, rename them as required, and close parted.​

15. "Damage" the internal, emulated SD card so that it could be formatted properly later.

Tap Mounts and storage -> Format /storage/sdcard0 -> default and confirm the operation.​

16. Insert the physical SD card (sdcard1) that you removed in step 2 back into the device.

Make sure it's mounted by tapping Mounts and storage and checking its status (it should say unmount /storage/sdcard1/). If not, mount it by tapping on the appropriate option.​

17. Execute the following commands one-by-one in the ADB command prompt:

cd /storage/sdcard1/fs-utils (the directory name will be different if you didn't follow my conventions)
tune2fs -j /dev/block/mmcblk0p14
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p14
e2fsck -fpDC0 /dev/block/mmcblk0p14

These commands convert Userdata partition into the appropriate ext4 filesystem, which is not supported natively in the recovery environment.​

18. Reboot the device into full Android.

18.1 Remove the physical SD card for safety.

18.2 Tap Back until you make it to the top level of recovery. Then tap the top option Reboot the device.​

19. When Android loads fully, you'll notice a notification about storage file system. Tap it and follow the prompts to format it.

20. Insert the physical SD card and reboot into the recovery you used to create the backup in step 2 to restore it.

In PhilZ, that's Backup and Restore -> Restore from /storage/sdcard1.​

21. Reboot back into full Android and copy the files saved from internal storage back into it. Then reboot again so that apps recognize the data.

DONE!​

Short guide/list of ADB commands and other events (*enclosed in asterisks*) if you know the safety drill:

*flash 4.1.2 & install dual recovery*
*boot into PhilZ Touch*
adb shell
umount /storage
parted /dev/block/mmcblk0
print
*record start point of Userdata and end point of SDCard*
rm 15
rm 14
mkpartfs logical ext2 1621 7865
name 14 Userdata
mkpartfs logical ext2 7865 15.6GB
name 15 SDCard
*Mounts and storage -> Format /storage/sdcard0 -> default -> confirm*
*insert physical SD card*
*Mounts and storage -> Mount /storage/sdcard1*
cd /storage/sdcard1/fs-utils
tune2fs -j /dev/block/mmcblk0p14
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p14
e2fsck -fpDC0 /dev/block/mmcblk0p14
*remove physical SD card*
*reboot*
*format emulated SD card*
*reboot recovery*
*restore backup*
*reboot*
*restore sdcard0/*
*reboot*