[HOW-TO][ROOT][4NOOBS] Resize sdcard0 and internal storage to maximize space for apps

Search This thread

bsined

Senior Member
Mar 22, 2013
229
134
Washington, DC
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 @teidus 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. @[NUT]'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.
cA4MJUd.png


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):
Code:
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:
Code:
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.​
Code:
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:
Code:
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:
Code:
*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*
 

Attachments

  • fs-utils.zip
    431.3 KB · Views: 3,862
  • 2014-04-10_015902.png
    2014-04-10_015902.png
    180.3 KB · Views: 14,509
  • 2014-04-10_015912.png
    2014-04-10_015912.png
    184.3 KB · Views: 13,618
  • 2014-04-10_015919.png
    2014-04-10_015919.png
    185.4 KB · Views: 13,224
  • 2014-04-10_015927.png
    2014-04-10_015927.png
    205.1 KB · Views: 11,190
Last edited:

raghulrr

Member
Mar 21, 2013
5
5
Nokia 8.1
nice, i was looking for a way to increase the /data after switching to Omni and ART

Will try ASAP..

PS: i think this thread should be added in ALL IN ONE THREAD Section:good::victory::victory::victory:
 

norti

Senior Member
Feb 16, 2008
817
484
41
Budapest
twitter.com
#6 would be the most welcomed way to resize partitions, but unfortunately it's not so easy as it was e.g. with ZTE Blade. But altogether it's good to know that you can resize them now! ;) Thanks!
 

Partitionator

Senior Member
Sep 9, 2011
147
33
@TO: I couldn't test ist but I think made a little mistake:
I think you want want to execute the programms wich are in the Directory in wich you made the cd. So you have to add ./ before each command.

I don't have such a device, to test it by myself: You said you have to make a new virtual SD. Some ROMes have a vold.fstab in /etc. Mayby it't enough to change this file to be able to remove the SD Partition completly.
 

bsined

Senior Member
Mar 22, 2013
229
134
Washington, DC
@TO: I couldn't test ist but I think made a little mistake:
I think you want want to execute the programms wich are in the Directory in wich you made the cd. So you have to add ./ before each command.

I don't have such a device, to test it by myself: You said you have to make a new virtual SD. Some ROMes have a vold.fstab in /etc. Mayby it't enough to change this file to be able to remove the SD Partition completly.

I was writing the guide as I was executing commands so everything is exactly as I entered it. I obviously removed all steps that turned out to redundant and wrong.
 
  • Like
Reactions: alexbo

metaljoker

Senior Member
Jul 11, 2009
240
35
----
Will that work with the Xperia Arc S?!
What is the difference between your method and the [MOD]{CM10.1}{CM10.2}{CM11}{AOSP}Working Int2Ext for Xperia 2011 [ART-compatible]?
 
Last edited:

bsined

Senior Member
Mar 22, 2013
229
134
Washington, DC
Will that work with the Xperia Arc S?!
What is the difference between your method and the [MOD]{CM10.1}{CM10.2}{CM11}{AOSP}Working Int2Ext for Xperia 2011 [ART-compatible]?

These are some great questions! This approach is very different from all Int2Ext scripts:
  1. HUGE NOTE: This works only for devices where the onboard NAND capacity is at least 8GB. That means that 2011 devices with 1-4GB of onboard memory are better off with mounting the physical SD card as /data.
  2. This is a semi-permanent modification to the partition table (it'll work fine if you do factory reset and flash a new ROM .zip but the allocation will be reset every time you flash FTF, possibly even if you exclude partition-image because each .sin contains its offset and size bits).
  3. This approach is compatible with locked bootloaders because support of init.d comes from the kernel.
  4. This approach allows you to allocate as much or as little of onboard NAND storage to each of the 2 partitions (/data and /storage/sdcard0) used for storing apps and their data instead of just allocating the entire physical SD card.
  5. This approach allows you to live a life independent of your physical SD card (i.e., your apps still work and your phone boots up just fine even if the physical SD card dies).
 

metaljoker

Senior Member
Jul 11, 2009
240
35
----
These are some great questions! This approach is very different from all Int2Ext scripts:
  1. HUGE NOTE: This works only for devices where the onboard NAND capacity is at least 8GB. That means that 2011 devices with 1-4GB of onboard memory are better off with mounting the physical SD card as /data.
  2. This is a semi-permanent modification to the partition table (it'll work fine if you do factory reset and flash a new ROM .zip but the allocation will be reset every time you flash FTF, possibly even if you exclude partition-image because each .sin contains its offset and size bits).
  3. This approach is compatible with locked bootloaders because support of init.d comes from the kernel.
  4. This approach allows you to allocate as much or as little of onboard NAND storage to each of the 2 partitions (/data and /storage/sdcard0) used for storing apps and their data instead of just allocating the entire physical SD card.
  5. This approach allows you to live a life independent of your physical SD card (i.e., your apps still work and your phone boots up just fine even if the physical SD card dies).

That's a great info! There are steps in the thread that aren't clear enough not only for me but also for others, that's for sure.
For those who have partitioned their SDcard, unlocked BL & rooted phones, should have their own line of steps, however I feel like I might mistake something in case I use it.

P.S.:
01. You didn't answer my question whether this is compatible with my phone, did you?!
02. There should be a video demonstration for this method for it is new in this website, don't you think?!
03. unzip to a location on your phone's physical SD card you'll remember (say, fs-utils\) what do you mean by remember "say, fs-utils\" ??
 
Last edited:

metaljoker

Senior Member
Jul 11, 2009
240
35
----
@up
It depend on your partition scheme, which ones are on the end of memory (physical).

Wysłane z mojego GT-I8160 przy użyciu Tapatalka

I have a 1GB partitioned SDcard for the apps! Does this info help?!

How the heck could I install the TeamWin Recovery Project (TWRP) ??!!
 
Last edited:

bsined

Senior Member
Mar 22, 2013
229
134
Washington, DC
That's a great info! There are steps in the thread that aren't clear enough not only for me but also for others, that's for sure.
For those who have partitioned their SDcard, unlocked BL & rooted phones, should have their own line of steps, however I feel like I might mistake something in case I use it.

P.S.:
01. You didn't answer my question whether this is compatible with my phone, did you?!
02. There should be a video demonstration for this method for it is new in this website, don't you think?!
03. unzip to a location on your phone's physical SD card you'll remember (say, fs-utils\) what do you mean by remember "say, fs-utils\" ??

SD partitioning and status of the bootloader should not have any effect on the process. However, root is required in order to install recovery.

1. Theoretically, this mod is compatible with any device that has the latest version of CWM or TWRP. I've tested it with Xperia TL and Nook Tablet 16GB. However, if your device's total available user storage (/data + /storage/sdcard0) is 4GB or less, you will likely require a physical SD card for storing your apps, user data, and whatever is written to sdcard0 by default.
2. Although I realize that some people learn best by watching instead of reading, this procedure is very quick when your device's recovery supports all the required commands. I repartitioned Nook Tablet in barely 10 minutes. If I were to make a screen cast of it, 90% of the video would be just moving the mouse around or waiting for the phone to boot. The longest operation is to create the journal, which takes about 10 seconds by the phone.
3. "Say" = "for example". Create a folder on the physical SD card and call it "fs-utils".
 
  • Like
Reactions: metaljoker

metaljoker

Senior Member
Jul 11, 2009
240
35
----
SD partitioning and status of the bootloader should not have any effect on the process. However, root is required in order to install recovery.

1. Theoretically, this mod is compatible with any device that has the latest version of CWM or TWRP. I've tested it with Xperia TL and Nook Tablet 16GB. However, if your device's total available user storage (/data + /storage/sdcard0) is 4GB or less, you will likely require a physical SD card for storing your apps, user data, and whatever is written to sdcard0 by default.
2. Although I realize that some people learn best by watching instead of reading, this procedure is very quick when your device's recovery supports all the required commands. I repartitioned Nook Tablet in barely 10 minutes. If I were to make a screen cast of it, 90% of the video would be just moving the mouse around or waiting for the phone to boot. The longest operation is to create the journal, which takes about 10 seconds by the phone.
3. "Say" = "for example". Create a folder on the physical SD card and call it "fs-utils".

WOW! I am very impressed for answering each question in an informative way! W E L L D O N E! ! :good:

I'll take my chances since I've read your lines. Wish me luck!
I'll get back to you once I encounter the unexpected, or maybe not. We'll see! Here goes nothing...
 

bsined

Senior Member
Mar 22, 2013
229
134
Washington, DC
WOW! I am very impressed for answering each question in an informative way! W E L L D O N E! ! :good:

I'll take my chances since I've read your lines. Wish me luck!
I'll get back to you once I encounter the unexpected, or maybe not. We'll see! Here goes nothing...

I realized that I've forgotten to include roll-back instructions if anything goes wrong. Here's the short version:
1. You better have made Nandroid backup of your system and have copied the content of your /storage/sdcard0
2. Find a stock, rootable FTF on the forums, download it, and flash it using Flashtool
3. Install recovery on the reflashed device
4. Restore backup from recovery and copy the content back to /storage/sdcard0
 

thunder888

Senior Member
Oct 28, 2010
598
418
Bandung
ADB Shell

Sorry if this silly questions

I want use your mod on my XV, but I've some problem (on Windows 8.1 Pro 64bit)
1. When I reboot from PhilZ Touch recovery for a first time, i don't get root question
2. Cause i don't get about root question, so i try root from PhilZ Touch recovery menu
3. When I try run adb shell on TWRP recovery, there no device notif (I already install Windows Update : http://support.microsoft.com/kb/2917929 and use Flashtool Driver 1.5)

So, am i mis something? Where i got wrong? Thanks before
 

bsined

Senior Member
Mar 22, 2013
229
134
Washington, DC
Sorry if this silly questions

I want use your mod on my XV, but I've some problem (on Windows 8.1 Pro 64bit)
1. When I reboot from PhilZ Touch recovery for a first time, i don't get root question
2. Cause i don't get about root question, so i try root from PhilZ Touch recovery menu
3. When I try run adb shell on TWRP recovery, there no device notif (I already install Windows Update : http://support.microsoft.com/kb/2917929 and use Flashtool Driver 1.5)

So, am i mis something? Where i got wrong? Thanks before

I guess is the problem is with Win8 and ADB drivers. However, just to be sure, try attaching the phone to the computer to test ADB when it's booted to PhilZ and full Android. If the phone is not recognized, search the forum for a fix (there should be one). Unfortunately, my only Win8 machine is Surface RT, which doesn't accept ADB drivers, so I can't test anything myself.
 
  • Like
Reactions: thunder888

thunder888

Senior Member
Oct 28, 2010
598
418
Bandung
I guess is the problem is with Win8 and ADB drivers. However, just to be sure, try attaching the phone to the computer to test ADB when it's booted to PhilZ and full Android. If the phone is not recognized, search the forum for a fix (there should be one). Unfortunately, my only Win8 machine is Surface RT, which doesn't accept ADB drivers, so I can't test anything myself.
Yes, i agree. But if I attach phone at full Android and run ADB, it can be recognized. I'll reinstall my windows and will give a report later. Thanks :good:
 

metaljoker

Senior Member
Jul 11, 2009
240
35
----
My dearest friend...

My phone was revered back to original. In order to have it rooted it took me 17 hours

1] Regarding the "Flash your phone with basic" my phone's already rooted which means that I do not need to flash an FTF file. In case I need to, which version?! Would that harm anyhow?
2] I'm stopped at 6.5. Because I do not have the TWRP installed on my phone.
3] My Recovery is CWM-based Recovery v6.0.4.7, if no problem then how can I Start ADB?!!!

Obviously, I'm not even half way. I need your help my friend! :(

* Xperia Arc S
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 63
    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 @teidus 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. @[NUT]'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.
    cA4MJUd.png


    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):
    Code:
    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:
    Code:
    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.​
    Code:
    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:
    Code:
    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:
    Code:
    *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*
    6
    What purpose does all the stuff with using the Stock ROM plus the special recovery serve?
    I'm just curious whether I can do the stuff on a Custom ROM, too. I can "adb shell" into it already, so that's no that of a problem. The partitions are just "plain" ext4 - so nothing problematic there, too.
    Is the Stock ROM needed for Step 19? It's actually the only thing I'm kinda worried about...

    EDIT:
    Just looked at the linked thread, there you say sth. that there were issues with the "current" recovery, so this might be over now ;).
    Never seen something that a special ROM is needed for that, why did you include that in the thread?
    With my phone I even have make_ext4fs, so this *might* even be easier :)

    UPDATE #1:
    Just tried it with Neo's mint ROM, seems to boot already :good:

    Maybe I'm providing a script that makes it even more easier later on - but currently final exams are waiting.

    UPDATE #2:
    Everything works. CM at first didn't recognize the sdcard0, but I could open it in filemanager but nowhere else, but after going to Settings->Storage->Erase SDCard this is completely fixed :good:

    UPDATE #3:
    Maybe this *could* work. I don't know whether everybody has make_ext4, nor whether the parted version of android can do that --script stuff, but if, it should work...
    Code:
    #!/bin/sh
    umount /storage
    parted --script /dev/block/mmcblk0 rm 14
    parted --script /dev/block/mmcblk0 rm 15
    parted --script /dev/block/mmcblk0 mkpartfs logical ext2 1621 7865
    parted --script /dev/block/mmcblk0 mkpartfs logical ext2 7865 15.6GB
    parted --script /dev/block/mmcblk0 name 14 Userdata
    parted --script /dev/block/mmcblk0 name 15 SDCard
    make_ext4fs /storage/sdcard0
    /storage/sdcard1/fs-utils/tune2fs -j /dev/block/mmcblk0p14
    /storage/sdcard1/fs-utils/tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p14
    /storage/sdcard1/fs-utils/e2fsck -fpDC0 /dev/block/mmcblk0p14

    EDIT: Ofcourse you need to extract fs-utils to /storage/sdcard1/fs-utils as described in the OP.
    Then just execute the stuff above or run it as script (be sure to change the partition size if needed as described in the OP).
    5
    Thanks for your guide.

    Just used it on my XV. Only problem I had is that I couldn't get adb to work in Philz touch recovery, with adb debugging enabled, on mac OS X 10.9.
    Got adb to work in cwm recovery from another kernel I flashed, parted worked fine with this but for some reason it wouldn't let me cd to the external sdcard even though it was mounted, so I couldn't complete step 17... I thought what the hell and just formatted the two partitions in recovery, then fastbooted my cm12 kernel, and restored my TWRP backup.. noticed that it formats all partitions with ext4 before restoring anyway...

    Rebooted, and all works fine apart from having to change sdcard0 owner & user back to media_rw..

    Not sure if it is a cm12 thing but partition sizes, although changed, are not reported correctly!!

    :)

    MY STEPS ON XPERIA V (rooted with unlocked bootloader)

    1)Backup sdcard0
    2)Backup data partition in recovery (FULL BACKUP FOR SAFETY)
    3)flash this kernel(includes CWM recovery): N-Kernel for XV
    4)Boot into recovery & connect to computer:
    5)enter these commands:(remove external sdcard if you are nervous)
    Code:
    adb shell
    [B](unmount storage in CWM recovery)
    [/B]parted /dev/block/mmcblk0
    print
    [B](copy partition table and work out new sizes)
    [/B]rm 14
    rm 15
    mkpartfs logical ext2 1621 (your value here)
    name 14 Userdata
    mkpartfs logical ext2 (value as above) 7818
    name 15 SDCard
    quit
    6)flash a kernel with TWRP recovery that can format ext4
    7) format data partition & sdcard0 with ext4
    8)restore data partition and sdcard0
    9)Reboot and enter one of these in android terminal emulator app to get correct owner and group on sdcard0: (maybe good to check what it is before hand!!!)
    Code:
    su
    busybox chown -R 2800:2800 /mnt/media_rw/sdcard0
    
    [B]OR for me Using a kernel modified to work with FolderMount[/B]
    su
    busybox chown -R media_rw:media_rw /mnt/media_rw/sdcard0
    10)reboot.......WIN!!
    3
    That means, you where on Neos Rom and "only" booted to TWRP and made all needed steps in TWRP and then booted normally in NEOs Rom?
    Can you just describe how? I don't need a detailed Instruction Manual.
    But the "not enough memory" errors are constantly disturbing me!

    You may try these steps :D
    1. Fastboot Neo's kernel and enter TWRP.
    2. Unmount storage, enter terminal.
    3. Use Parted to delete the last two partitions, then recreate them with desired size.
    4. Exit terminal, format /data and /sdcard with TWRP.

    If something goes wrong, you can flash stock ftf and the phone will boot normally. And Internal sdcard may be corrupted even after you flashed stock ftf, so you will need to format it with Philz Touch recovery to make it work properly.
    3
    Will that work with the Xperia Arc S?!
    What is the difference between your method and the [MOD]{CM10.1}{CM10.2}{CM11}{AOSP}Working Int2Ext for Xperia 2011 [ART-compatible]?

    These are some great questions! This approach is very different from all Int2Ext scripts:
    1. HUGE NOTE: This works only for devices where the onboard NAND capacity is at least 8GB. That means that 2011 devices with 1-4GB of onboard memory are better off with mounting the physical SD card as /data.
    2. This is a semi-permanent modification to the partition table (it'll work fine if you do factory reset and flash a new ROM .zip but the allocation will be reset every time you flash FTF, possibly even if you exclude partition-image because each .sin contains its offset and size bits).
    3. This approach is compatible with locked bootloaders because support of init.d comes from the kernel.
    4. This approach allows you to allocate as much or as little of onboard NAND storage to each of the 2 partitions (/data and /storage/sdcard0) used for storing apps and their data instead of just allocating the entire physical SD card.
    5. This approach allows you to live a life independent of your physical SD card (i.e., your apps still work and your phone boots up just fine even if the physical SD card dies).
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone