yashsingh1/xdaforums huggingface dataset:
[Sony Xperia S, Acro S, Ion] ajayzone2:
So here we are!
After almost a year with broken USB i back upped everything via AirDroid and I proceeded to increase data partition.

Just to be sure, first of all I copied the zip of a rom in /tmp folder with built-in file manager (you never know how far you can mess up things)
Then I went on.

Unmount every partition from mount menu.
Next open terminal command
[CODE]echo p | fdisk /dev/block/mmcblk0

This will print your actual partition table.

Take note of the start sector of partition 14

Let's call that XXXXX, and the amount of megabytes you want to assign to data partition YYYY

echo -e "d\n15\nd\n14\nn\nXXXXX\n+YYYYM\np\nq" | fdisk /dev/block/mmcblk0

Now take note of the end sector of partition 14.

Done? Increase that number by 1 and let's call it ZZZZZZ

echo -e "d\n15\nd\n14\nn\nXXXXX\n+YYYYM\nn\nZZZZZZ\n\nt\n15\nc\nw" | fdisk /dev/block/mmcblk0

Enjoy!

System partition is not touched at all, and if you feel bold you can flash aforementioned rom in /tmp straightaway[/CODE]

Can U Plz Replace XXXXX, YYYYY <,ZZZZZZ to Actual value

I want 8gb Partition as Data Partition
[Sony Xperia S, Acro S, Ion] prohibeat:
Why do you want to do it on your phone? it's easier and safer with adb. Read instructions carefully. If somehow your values differ from default then you can end up with broken device.
[Sony Xperia S, Acro S, Ion] ajayzone2:
I am Completely New About This And PC Needs Drivers and all That's y

Plz Tell me The Values That Can I Use it Directly Via Recovery from TWRP Terminal

If anything messed i will Reflash Stock
[Sony Xperia S, Acro S, Ion] prohibeat:
Values are shown on the screen after issuing print command in terminal. I don't have time to run adb and look for values because you are too lazy to install drivers or search this thread for answers. Maybe someone posted his partition table in this thread somewhere looking for troubleshooting/answers and you can get values from there.
[Sony Xperia S, Acro S, Ion] hisomraj:
how to do data partition from windows 7 laptop

I read the thread on resizing but I use a windows 7 phone. So I do I do it? I am new so can you let me know how do I get shell. In the thread below is mentioned. Please can anyone elaborate on this.

Get a shell:

Code:

(PC) adb shell

---------- Post added at 06:26 PM ---------- Previous post was at 06:18 PM ----------

when you say "Next open terminal command" - how to do it exactly? I am in TWRP screen of my mobile from there how do I open terminal command.
[Sony Xperia S, Acro S, Ion] vayavalla:
You should read this post

http://xdaforums.com/showthread.php?p=60540140

On TWRP, under ADVANCED, you have the button to open a terminal.

Enviado desde mi ifive_mini_3GS mediante Tapatalk
[Sony Xperia S, Acro S, Ion] ivanasecas01:
Oh yes finally i increase data partition thanks all !!!

Enviado desde mi Xperia S mediante Tapatalk
[Sony Xperia S, Acro S, Ion] sajedn:
thx for awesome tutorial , but,

i can't access to adb on TWRP (i can't even access to sd card via mount usb ) , i tried to reinstall adb drivers but still nothing.

using TWRP 2.8.5.0 manually installed on cm12.1

if u know any other kernel with stock TWRP that adb works on it plz let me know
[Sony Xperia S, Acro S, Ion] ivanasecas01:
Hello, when i did it, i had the same problem, if you can wait to tomorrow i share one file to install the recovery drivers to adb ok?

Enviado desde mi Xperia S mediante Tapatalk
[Sony Xperia S, Acro S, Ion] mirhl:
Latest adb drivers can be found in the android ndk.

Besides, you can even repartition from built-in terminal
[Sony Xperia S, Acro S, Ion] YYvo:
Hello All!

I just have one question if anybody can answer me. In the tutorial by Mihrl it is noted that the rom is saved in /tmp folder. Since i have the same issue and have to repartition from twrp i was wondering where to create the temporary folder (/tmp) ? Is it in Root folder, as there is already tmp folder and i should set it inside there or in some other location or subfolder.

Thank you in advance!
[Sony Xperia S, Acro S, Ion] nageswarswain:
Trere is already a tmp folder under root...
[Sony Xperia S, Acro S, Ion] mirhl:
No. I just said I copied it in that folder (because I feared system partition could be formatted when editing the partition table)

Yes, /tmp is indeed /tmp.
[Sony Xperia S, Acro S, Ion] sajedn:
thx,

i did it (terminal method) step by step (twice) but nothing changed ! even sdcard remained unchanged. what can i do ?

update : i could install adb drivers by adbDriverinstaller.exe successfully.

just one q:

is this method going to increase system volume as well ? for installing more zip files (including 5.1.1 stock gapps)
[Sony Xperia S, Acro S, Ion] 3vilhomer:
do anyone know do i need to do anything using the PC, i have a windows 10 and it cant recognize my phone in any mode. it only charge my phone. it use to work while i have windows 8.1
[Sony Xperia S, Acro S, Ion] ivanasecas01:
[MENTION=6434012]vilho[/MENTION]mer try to reinstall drivers
[Sony Xperia S, Acro S, Ion] 3vilhomer:
i fixed it, i realized my windows 10 pro N have a problem with MTP....

anyway is there a youtube guide for increase data partition? i really want to increase the system storage on my XPERIA S. after i flash a LP rom, it seems like ART is using so much space that i cant install other apps, but my phone is very smooth comparing to KK
[Sony Xperia S, Acro S, Ion] mirhl:
So follow the instructions in the OP or in my from-phone procedure. Seriously, it's easy..

It's not like you have to figure out commands
[Sony Xperia S, Acro S, Ion] rowny:
Can someone please explain how to do it step by step? Why do I need a Linux computer? What is Android SDK and which one should I install? How do I get a shell? Very unclear description in OP, especially considering the risks!

Thank you:)
[Sony Xperia S, Acro S, Ion] vayavalla:
You only need to read the previous page

Enviado desde mi ifive_mini_3GS mediante Tapatalk
[Sony Xperia S, Acro S, Ion] imAnkitPatel:
Steps to increase the data partition in "STOCK ROM".

Note : All data on the phone may or may not be lost. (backup your data first).

Steps :

1) Download XperiaS_LT26i_6.2.B.1.96_KernelOnly.ftf here.

2) Download TWRP Recovery image from here.

3) Place these files in firmwares folder of flashtool.

3) Open flshtool with admin privilege

4) Boot the device in Fastboot Mode > Select the kernel to flash > select (twrp-2.8.7.0-nozomi.img or later) > Flash

5) Open TWRP Recovery in Boot-loader. Backup your current Stock Rom.

6) Connect your phone to the PC and copy the TWRP folder which contains backup of your current backup to PC.

7) Follow these steps to increase the data partition. Steps

8) "wipe" data and sdcard to format your new partitions. (May require to mount the SDCARD)

9) Open TWRP Recovery & connect the cable to PC then Copy & Paste previously copied folder from PC to SDCARD via USB cable.

10) Recover the last backup data with TWRP.

11) Open flash tool with root privilege & Boot the device in Fastboot Mode > Select the kernel to flash > select (XperiaS_LT26i_6.2.B.1.96_KernelOnly.ftf) > Flash

12) Restart the phone and Done.
[Sony Xperia S, Acro S, Ion] rowny:
Gee, thanks a lot... I did not ask how to flash a kernel...
[Sony Xperia S, Acro S, Ion] farrokh19:
I need some info

Hi to all, i need some info before proceed.

I have a problem with my pc (it's broken) and so i think to follow mirhl guide in order to increase data partition directly with phone.

The procedure is clear and simple but i don't understand if i have to format the new partitions in the end, as the page 1 guide.

Also if i'm not wrong, i can restore a backup (of system, data and sdcard) after the repartition, obviously just if i copy it first on a pc...

Thanks
[Sony Xperia S, Acro S, Ion] mirhl:
You can restore your backup and there's no problem with formatting or not formatting
[Sony Xperia S, Acro S, Ion] farrokh19:
Done it !!!

The procedure is really simple in the end. I unmount every partition from twrp recovery and i stay in that screen (step 3). Then i follow the procedure step by step. In the end I format data and sdcard from twrp recovery menu, then I flashed rom and gapps and restore the backup which i've made previously. The last step is restore sdcard and stop...

Now I have a 8gb data partition !!!! :D:D:D

p.s. i can't install facebook app from playstore so i download the apk and install it and in this way is perfect !
[Sony Xperia S, Acro S, Ion] FunFrog:
Hi. Few months after i did the same partitions resize operation on Acro S, it suddenly died. At night, on charger. And there are other seven people who suffer from exact those symptoms on 4pda forum. We all have used a 5.1.1 rom and we all did the same resizing operation. So the problem is now i have only first 4 partitions and i cant make any other because of

fdisk: WARNING: rereading partition table failed, kernel still uses old table: I/O error

The only thing i can do with this phone now is change kernels via fastboot. Maybe i`m missing something?
[Sony Xperia S, Acro S, Ion] mirhl:
Flash stock rom in flash mode?
[Sony Xperia S, Acro S, Ion] FunFrog:
I tried that few times with no success - it was flashing for like 4 or 5 hours and only get to the fotakernel, then battery dies and process stops.

Now i solder two wires to the battery cable so i can charge it anytime with iMax, but the problem is, flash mode doesn`t work anymore:

24/058/2015 14:58:25 - INFO - List of connected devices (Device Id) :
24/058/2015 14:58:25 - INFO - - USB\VID_0FCE&PID_ADDE\6&2FBC2876&0&8	Driver installed : true
24/059/2015 14:59:58 - INFO - Selected Bundle for Xperia acro S_LT26w. FW release : 6.2.B.1.96. Customization : PCT
24/059/2015 14:59:58 - INFO - Preparing files for flashing
24/000/2015 15:00:02 - INFO - Please connect your device into flashmode.
24/000/2015 15:00:06 - INFO - Device connected in flash mode
24/000/2015 15:00:06 - INFO - Opening device for R/W
24/000/2015 15:00:06 - INFO - Reading device information
24/000/2015 15:00:06 - INFO - Phone ready for flashmode operations.
24/000/2015 15:00:06 - INFO - Opening TA partition 2
24/000/2015 15:00:06 - INFO - Current device : Unknown: Jul 25 2013/14:37:45 - CB51232US4 - Unknown: Jul 25 2013/14:37:45 - Unknown: Jul 25 2013/14:37:45 - Unknown: Jul 25 2013/14:37:45
24/000/2015 15:00:06 - INFO - Closing TA partition
24/000/2015 15:00:06 - INFO - Start Flashing
24/000/2015 15:00:06 - INFO - Processing loader.sin
24/000/2015 15:00:06 - INFO - Checking header
24/000/2015 15:00:06 - INFO - Flashing data
24/000/2015 15:00:08 - INFO - Loader : S1_Root_de72 - Version : R5C011 / Boot version : R10C008 / Bootloader status : ROOTED
24/000/2015 15:00:08 - INFO - Max packet size forced to 128K
24/000/2015 15:00:08 - INFO - Making a TA backup
24/000/2015 15:00:08 - INFO - Opening TA partition 1
24/000/2015 15:00:08 - INFO - Opening TA partition 2
24/000/2015 15:00:08 - INFO - No flash script found. Using 0.9.18 flash engine
24/000/2015 15:00:08 - INFO - Opening TA partition 2
24/000/2015 15:00:08 - INFO - Ending flash session
24/000/2015 15:00:08 - ERROR -
24/000/2015 15:00:08 - ERROR - Error flashing. Aborted
24/000/2015 15:00:08 - INFO - Flashing finished.
24/000/2015 15:00:08 - INFO - Please unplug and start your phone
24/000/2015 15:00:08 - INFO - For flashtool, Unknown Sources and Debugging must be checked in phone settings
24/000/2015 15:00:09 - INFO - Device connected in flash mode
24/000/2015 15:00:10 - INFO - Device disconnected
24/000/2015 15:00:12 - INFO - Device connected in flash mode
[Sony Xperia S, Acro S, Ion] yunamunchy:
this works on different devices right?
[Sony Xperia S, Acro S, Ion] Super98:):
Hi, guys, I'm attempting to follow this procedure on my Xperia S, but I'm facing a major issue. I have still not touched the partitions, but to check if ADB was working I tried to push gapps and rom to the sd card with it. Although after 70-80 seconds a message appears on the ADB window claiming that the file transfer has been successful, since it displays the transfer speed and how much time it took, I can't find gapps and rom in the sd card. I'm using a Windows 7 computer and I followed the ADB installation instructions that [MENTION=5314292]Darth Inferno[/MENTION] posted. ADB recognizes the device, because if I type adb devices I can get a message with the status of the phone (recovery) and its serial number. I think it is safer not to proceed any further. What could this problem be related to? I think it could be a driver issue, but the phone actually gets recognized.... Please help me guys

Thanks a lot in advance
[Sony Xperia S, Acro S, Ion] nageswarswain:
Go here and try
[Sony Xperia S, Acro S, Ion] C0D3FR34K:
EDIT 3:

DONE FOlks

I now have a 7.6GB internal partition :)
[Sony Xperia S, Acro S, Ion] mirhl:
[MENTION=5538593]C0D3FR34K[/MENTION] Unmount every partition before starting.
[Sony Xperia S, Acro S, Ion] C0D3FR34K:
Thanks brother ! I figured it out but thanks for the quick response :)

Already done installing oneofakind ROM on it :)

To summarise my quandary for future gen: (in case you encounter the resource busy error after step 10)

1. In the step where it asks you to unmount the sdcard, don't. Go to TWRP->mount and untick all the partitions.

2. Continue with the instructions.

3. After you do a "w" in step 10, make sure you go to TWRP and format the /data and /sdcard partitions to ext4. (will attach a screenshot later. Basically in the middle of the screen there will be this options asking you to modify or format partitions)

4. Mount all the partitions (/system /cache /data /sdcard)

5. Push ROM and enjoy your phone :good::good::good:

In case of any problems, just go through the 46 pages. It's chaotic but covers all issues which can ever be encountered.
[Sony Xperia S, Acro S, Ion] hussainr:
Nice thread , i even repartitioned system to make some free space for stock gapps and also cache which i dont know if needed.

system 1.5GB

Cache 0.5GB

Data 4.0GB

InternalSD 9.0GB(around 9)

Thanks alot
[Sony Xperia S, Acro S, Ion] 3vilhomer:
help, after i install the rom and gapps my phone will start up but stuck in the screen encryption unsuccessful and hit reset the phone will bring me in TWRP and reboot back to encryption unsuccessful
[Sony Xperia S, Acro S, Ion] mirhl:
Encryption? You on MM?

You ain't getting normal TWRP working with that. Check the relative thread for a working one.

And please take note this repartition method was just for <6 roms.
[Sony Xperia S, Acro S, Ion] anth0nymDROID:
Is it possible to repartitiin cache also?
[Sony Xperia S, Acro S, Ion] 3vilhomer:
i am installing oneofakind 5.1 rom

update!

i go in adb again and check the table, found out 14 and 15 is gone. i repartition again and now is fine
[Sony Xperia S, Acro S, Ion] DizXDA83:
anyway to make this process more user friendly? i would like very much to try one of the roms based of MM but it seems a little tricky to follow the steps to partition internal memory... Is it possible to developop some sort of a script to automaticly partition the device or without so many command lines?
[Sony Xperia S, Acro S, Ion] mpranay25:
In step 7, (Last cylinder) -> +8192M (this will create a 8gB partition)

the sign '+' is to be write or just write 8192M?
[Sony Xperia S, Acro S, Ion] mirhl:
http://linux.die.net/man/8/fdisk
[Sony Xperia S, Acro S, Ion] PunchUp:
Do not use this tutorial for MM ROMs. Follow the instructions provided by mickybart

---------- Post added at 12:50 PM ---------- Previous post was at 12:49 PM ----------

Yes you need to type that man
[Sony Xperia S, Acro S, Ion] PunchUp:
Unmount all the partitions from TWRP
[Sony Xperia S, Acro S, Ion] mpranay25:
bro can u tell me step by step procedure how to partition.

since yesterday morning i keep trying but nothing is working out.

i just want to partition storage and install one of a kind LOLLIPOP.

i dont want to install Marshmallow.

i came back on stock rom JB 4.1.2 with rooted phone.

thanks for ur big help
[Sony Xperia S, Acro S, Ion] PunchUp:
I don't understand. Just saw your post on Marshmallow thread. If you managed to boot up that ROM, why are you so confused about this procedure? It's pretty much the same
[Sony Xperia S, Acro S, Ion] mpranay25:
Ok fine thanks bro..

Once again I will try to partition.

And I will inform u.
[Sony Xperia S, Acro S, Ion] BlackLotus97:
device unauthorized :(
[Sony Xperia S, Acro S, Ion] mirhl:
Check adb driver.

And TWRP version.
[Sony Xperia S, Acro S, Ion] spreadjava:
Internal Storage shrunk to 2GB in Xperia SL

I have followed the same procedure and I have received the Kernel using the current partition table once.,then succeeded on the next time. But on going to the TWRP Advanced Wipe and after installing ROM, the Internal storage is shrunk to just 2048MB.

Tried to remake the partition just before the operation, still the same. One key point is none of the contents in the internal storage is getting deleted even after the delete and create partitions.

Please help.
[Sony Xperia S, Acro S, Ion] nageswarswain:
Can you write something how you repartitioned your system and cache
[Sony Xperia S, Acro S, Ion] Cleberfsc:
Could increase the internal space, but the sd not appear on android. Only appears when the PC started in TWRP mode. What did I do wrong?
[Sony Xperia S, Acro S, Ion] nageswarswain:
I think you are using marshmallow rom...on mm rom you can't use sd card while system is on...
[Sony Xperia S, Acro S, Ion] hussainr:
well if i remember correctly it was number 13 and 12 in partition table , my goal was to flash stock gapps but it failed , cause i couldnt flash the rom in the first place(some errors).

so i reverted back to default system and cache partition,
[Sony Xperia S, Acro S, Ion] mirhl:
[MENTION=7297337]bombev[/MENTION]

/dev/block/mmcblk0p36..? What hell of phone are you using?
[Sony Xperia S, Acro S, Ion] bombev:
Htc One S
[Sony Xperia S, Acro S, Ion] vayavalla:
This instructions are for the Sony Xperia S

Enviado desde mi ifive_mini_3GS mediante Tapatalk
[Sony Xperia S, Acro S, Ion] bombev:
Well, the phone does it matter?

I think the tutorial is very good and can work for other android phone if you conform the things which apply for your phone

The only different I see is when I use fdisk /dev/block/mmcblk0

is the number of the partitions, main are with other numbers

/dev/block/mmcblk0p33 49153 262144 1703935 83 Linux ====> /system

/dev/block/mmcblk0p34 262145 294912 262143+ 83 Linux ====> /cache

/dev/block/mmcblk0p35 294913 606208 2490367+ 83 Linux ====> /data

/dev/block/mmcblk0p36 606209 1908480 10418176 c Win95 FAT32 (LBA) ====> /sdcard

The problem I have after step 10, I am not able to mount back to follwing partitions, to be able to format it with the changed partition table.....
[Sony Xperia S, Acro S, Ion] mirhl:
Xperias are lucky enough not to have any particular artificial limitation.

Other phones are different. For example htc has all its stupid s-off/on stuff. For as much as I know partition table could be read only.
[Sony Xperia S, Acro S, Ion] nico1983:
I have a problem, once made partitions I can not mount the SD card form TRWP, at the beginning i unmont it from ADB and from TRWP, but once the process is ready, I can not copy the room because there are no sdcard mount , achieve copy and install room directly from adb but remains hung on the home screen of Marsmhallow, the gapps could not copy them.
[Sony Xperia S, Acro S, Ion] :
Is there any way to increase system partition to flash a larger gapps instead the minimal one?

I'm sure i won't use all the 29 gb that has left for internal storage.
[Sony Xperia S, Acro S, Ion] mirhl:
Of course you can adjust basically every partition (but TA i guess, never touch it)

Just adjust commands with the right number/cylinders of the partition to delete/increase.
[Sony Xperia S, Acro S, Ion] :
I'll leave it, seems to dangerous for me that don't know very much about it.

It would be a disaster if something gone wrong.
[Sony Xperia S, Acro S, Ion] :
This is my partition now:

12	2177	34944	1048576	/system
13	34945	42944	255992	/cache
14	43945	954240	29161464 /data

This is what I want to system, nearly 5gb in system. Guessing that I calculated right.

12	2177	163835	5242880	/system
13	163836	171835	255992	/cache
14	171835	/data

One question that I have is the rest of data the adb shell will be shown to me, like when I did the partition to exclude sdcard?

First cylinder (769-954240, default 769): 42945
Last cylinder or +size or +sizeM or +sizeK [B](42945-954240, default 954240[/B]): (just press enter if the default value is the good one)
Using default value 954240

And [MENTION=4900593]mirhl[/MENTION] i have made a backup of TA.. just in case.
[Sony Xperia S, Acro S, Ion] mirhl:
I don't really recall fdisk syntax now, but I guess that with no ending cylinder /data should extend up to the end
[Sony Xperia S, Acro S, Ion] anisiqbal:
Finally achieved it.

Guys.

I have followed all the steps but for some strange reason I can only create 1 partition of whatever size.

The other partition i create for sdcard doesn't show up.

So I created a single partition of the whole space available after deleting partition 14 & 15, and installed nAOSProm 6.0.1 in my

Xperia SL which i working flawlessly.

Thanks guys for such a great guide.
[Sony Xperia S, Acro S, Ion] lucam75:
Hello all,

First thank you for this amazing tutorial !

I follow all the steps and can resize my partition table successfully, but applications like Gallery and Camera can be used because says No available external storage or "Insert an SD card before using the camera". If I use a file manager I can see the sdcard and the files like ROM and GAPPS inside, so what I did wrong ? and how can fix this?

EDIT: I'm using Chroma, a 5.1.1 Android version Rom.

Attach my actual partition table using fdisk /dev/block/mmcblk0
[Sony Xperia S, Acro S, Ion] mirhl:
Switch to emulated storage without ADB

Hey again.

Another year, another desperate guide it seems.

So, first of all copy the files you need in /data.

Second, use Rashr to flash latest recovery and kernel (extracted from zips).

Reboot into recovery.

Don't wipe anything and Install your rom/gapps.

Unmount every partition and navigate to Advanced > Terminal:

fdisk -l /dev/block/mmcblk0

This is your partition table.

Let's call XXXXX the start cylinder of /dev/block/mmcblk0p14.

echo -e "d\n15\nd\n14\nn\n[I]XXXXX[/I]\n\nt\n14\n83\nw" | fdisk /dev/block/mmcblk0

Reboot in recovery.

Convert /data and /cache to F2FS if you haven't already done, otherwise just Format Data and Factory Reset for safety.

Profit!
[Sony Xperia S, Acro S, Ion] nageswarswain:
Hello mirhl,nice to see your post after long time...I think this command will bring us a complete data storage of 27 GB and after reboot we will have a completely fresh ROM left with no recovery.??

One doubt by rashr app we can only flash either kernel or recovery.now a days the recovery needs to be flashed to the fota.I think it will be better if you add a step to flash recovery to fota before hand.
[Sony Xperia S, Acro S, Ion] mirhl:
After a long time, I damn decided to move to mm, yes. I'm euphoric.

Now I'm back at complaining devs ^^

And yes, that's what you have to do to switch to single big partition for /data and /sdcard.

And.. I think rashr is already FOTA aware.

Hell, I even flashed recovery.img inside the zip (instead of the .img on TWRP website) and every time I booted the phone recovery was starting.

So.. I guess it should be okay?