[Sony Xperia S, Acro S, Ion] xminirom:
Attention!​

I know there are already some posts about it. If you find it annoying PLEASE ignore this post. Do Not bother to comment. Just Ignore it.​

Disclaimer: I'm Not Responsible for Anything. If you wish do it as your own risk.​

These things are goning to happen

For the reason of Formating data will be lost - So backup everything to PC

You'll lose google sign in, contacts, messages, social networking etc. - backup before proceed

Things You will Need

Drivers - For Detecting your device properly (Sony Users can use "Flashtool")

ADB - Use mini version. You don't have to install Android SDK for this

USB Cable

CMD - Use "ConEmu" or "Console2" more flexible than cmd. Provides easy copy of text from console

TWRP Recovery - Download it from twrp site

I'm Going to put this assuming you as Novice. So I'll Explain as much as possible

Step 1 -

* Installing flashtool

Download flashtool from the link given above

Install flashtool as usual.

Then from "C:\Flashtool\drivers" install drivers for your phone.

Open Flashtool (Keep it open for this step)

* Phone Detection

After installing drivers - enable "USB debugging" in phone. Connect your phone to pc see if it is detected or not.

If not try doing uninstall & installing flashtool again. If it is not detected yet I shall say "STOP" forget partitioning. Look in the forum for a solution. Fix it and then continue.

If your device detects properly in normal mode then proceed

Turn off phone. Connect USB cable to PC and while pressing volume up button and connect cable to Phone.

A blue light will flash & Driver will install if necessary. In Flashtool window it will show fastboot mode after detecting phone. If not "STOP" try again. Fix it and then continue.

Step 2 - Install mini adb

If you have downloaded mini ADB.exe version install it to root directory of PC for example C:\ADB. Double click to open the .exe when ask for location of install show to C:\ADB

If you have downloaded Mini ADB as .zip/.rar file. Right click on the file> Extract to > C:\ADB

Step 3 - TWRP

Download from the link given above.

Move Downloaded TWRP image such as twrp-3.0.0-0-nozomi.img to ADB folder (C:\ADB)

Rename the file to twrp.img.

(Optional) - also move rom.zip for later use. If you want to install a fresh rom.

Step 4 - Kernel flash

* Flashing Kernel by flashtool

Turn off phone, conncet it to pc while pressing volume + button

open flashtool> flash device (thunder icon)> fastboot> Flash kernel> select twrp-3.0.0-0-nozomi.img

See the flashtool log if it says "OK" then Reboot/start the phone. Otherwise redo this step.

When starting press volume + - button several time it will bring up recovery screen.

* Flashing kernel into Fota Kernel.

You have to Upload the recovery.img into your phone & Flash to do this: Open Command Window by default in windows it is called cmd.

Opening Command window

* By CMD:

Go to ADB folder> Press Shift + Right Mouse button> Open Command window here> it will open a command window

* Using Other console software:

ConEmu or Console2 can't be open this way. You have to use "cd" command to go to adb folder.

In conEmu or console2 write: cd your adb location for example: cd c:\ADB

Now write these in command window-

adb push twrp.img /sdcard/ <<<<---- this will copy twrp.img to your phone sdcard. Remember to change recovery name to twrp.img

dd if=/sdcard/twrp.img of=/dev/block/mmcblk0p11 <<<<---- this will write twrp to FOTA block of your phone.

** Rebooting phone will bring up recovery screen. In the recovery screen it will ask you whether system should be put into "Read only mode". Don't do that.

** In twrp Go to Mount> deselect System, data, cache, Sdcard and read only system > select again > again Deselect

Before You Procced Any Further Make Sure:

PC can detect your device Normally

PC Can detect device in Fastboot mode

If you really want to do this or not?

Step 5 - Partitioning

[*] Connect USB Cable while in TWRP recovery. (It dosen't matter which screen you are in just Stay in twrp recovery)

[*] Open ADB Folder> Open CMD or ConEmu from there (See Step 4 - opening command window section for this)

Write these command

adb shell <<<<----- it will start ADB

then write

fdisk /dev/block/mmcblk0 <<<<----- It will enable partitioning commands to work

This will bring some info & It will Look Like this:

The number of cylinders for this disk is set to 973824.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help):

**NOTE** " Command (m for help): " will show automatically if you successfuly entered in partitioning mode if not redo steps again.​

Now we need to see each block of default partition and detect SDCARD & Internal Storage: Write this-

p <<<<<<----- This will print or show each partition. Command (m for help): already be there just write p for example Command (m for help): p

It will show this:

[HIDE]Disk /dev/block/mmcblk0: 31.9 GB, 31910264832 bytes
4 heads, 16 sectors/track, 973824 cylinders
Units = cylinders of 64 * 512 = 32768 bytes

Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 65 2048 f0 Linux/PA-RISC boot
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 * 65 81 512 4d Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 129 768 20480 48 Unknown
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 769 954240 30511104 5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 785 800 512 46 Unknown
/dev/block/mmcblk0p6 833 928 3072 4a Unknown
/dev/block/mmcblk0p7 961 1056 3072 4b Unknown
/dev/block/mmcblk0p8 1089 1184 3072 58 Unknown
/dev/block/mmcblk0p9 1217 1376 5120 70 Unknown
/dev/block/mmcblk0p10 1409 1664 8192 83 Linux
/dev/block/mmcblk0p11 1665 2176 16384 f0 Linux/PA-RISC boot
/dev/block/mmcblk0p12 2177 34944 1048576 83 Linux
/dev/block/mmcblk0p13 34945 42944 256000 83 Linux
/dev/block/mmcblk0p14 42945 108480 2097152 83 Linux
/dev/block/mmcblk0p15 108481 954240 27064320 c Win95 FAT32 (LBA)

Command (m for help):[/HIDE]

STOP​

COPY THESE PARTITIOIN INFO TO A TEXT FILE AND SAVE IT. EVERY PHONE HAS SEPERATE PARTITION SETTING. IF ANYTHING GOES WRONG IT WILL BE NECESSARY TO SEE AND GIVE EXACTLY SAME VALUE TO RECOVER ORIGINAL PARTITION.​

Identifying SDCARD & Internal Storage - From the print output we see lots of blocks and lots of data. But We need to know which partition belongs to which.

/dev/block/mmcblk0p14 <<<---- this is the Internal Storage. See the blocks column its like 2 GB (2097152)

/dev/block/mmcblk0p15 <<<---- this is the SDCARD. Blocks look like it's around 27GB and there is also win95 FAT32 type partition.

As we need to increase Internal Storage Size. From where these extra storage will come from? Well, it's from SDCARD. That's why SDCARD & Internal Storage has to be deleted and repartition again. As for delete do this

d <<<<<---- for deleting partition Command (m for help): d

Partition number (1-15): <<<<---- it will ask which partition you want to delete?

15 <<<<<---- First delete mmcblk0p15

then again give

d <<<<<---- for deleting partition Command (m for help): d

Partition number (1-15): 14 <<<<----- Deletes Internal storage partition which is mmcblk0p14

You can give P command to see whether those partition deleted or not

Command (m for help): p

Now creating new partition for Internal storage. Write

n <<<<<----- this is for creating new partition Command (m for help): n

this will show this:

First cylinder (769-954240, default 769):

To Understand properly look at this table you generated earlier using p command:

start	end
/dev/block/mmcblk0p13 34945 42944
/dev/block/mmcblk0p14 42945 108480
/dev/block/mmcblk0p15 108481 954240

Here mmcblk0p13 started ended at 42944. mmcblk0p14 started at 42945. And mmcblk0p14 ended 108480 just after that mmcblk0p15 started at 108481. Ending is beginning. Quiet easy actually.

So when asked to put first cylinder: you take mmcblk0p13 end value plus 1 write that in first cylinder. for example if End value of mmcblk0p13 is 2 then first cylinder will be 3. if mmcblk0p13 end value is 1000 then first cylinder value will be 1001. if mmcblk0p13 End value is 42900 then first cylinder Value will be 42901. I think that's enough for understanding.

First cylinder (769-954240, default 769): 42945 [<<<<----- in my case mmcblk0p13 end value is 42944 so first cylinder value is 42945 this will not be same for you. press Enter]

Then it will ask for Last Cylinder value: There is three way to put this in kilobyte, in megabyte or in default size but we have to put + sign before size. For example: +100000k or +4000M or +2000000. Easiest one will be using Megabyte. 4000 megabyte is 4 gb, 8000 is 8GB. By default when partitioning system keep some space for recording partition info that's why we never get full size in Memory card, Hard disk, Flash drive etc. This will also be applied here. If you give +4000M command you will get 3.6GB or 3.7GB Something like that. So calculate give some more to keep it even if you want.

Last cylinder or +size or +sizeM or +sizeK (42945-954240, default 954240):

I want my internal storage is around 4GB So I Gave

+4192 <<<<----- Last cylinder or +size or +sizeM or +sizeK (42945-954240, default 954240): +4192

Now The SDCARD Partition. To create This partition we have to give First cylinder value. As we don't know mmcblk0p14 has which Ending cylinder value. We have to generate the partition table and see. So give the P command.

Command (m for help): p <<<<--- shows partition table. Note the END Value of mmcblk0p14. suppose End value is 170875

Give n command

Command (m for help): n <<<<--- new partition for SDCARD or mmcblk0p15. It will ask for first cylinder

First cylinder (769-954240, default 769): <<<<---- put noted Ending value of mmcblk0p14 + 1 here. (170875+1 = 170876) press enter

Now Last cylinder: Just press enter it will take default

Last cylinder or +size or +sizeM or +sizeK (42945-954240, default 954240):

Change partition type for SDCARD by giving these command.

Command (m for help): t <<<--- t for change partition type.

Partition number (1-15): 15 <<<--- It asks which partition to be changed give 15 for SDCARD/mmcblk0p15

Hex code (type L to list codes): c <<<--- FAT32 from win95 for most compatibility give c to choose this. Do not change to any other system type it might not recognized by PC or even your device. Press enter.

Writing all these changing permanently

Command (m for help): w <<<--- give w for write permission. if successful you'll see these message.

The partition table has been altered.
Calling ioctl() to re-read partition table

**NOTE** if you see something like below line. Partition is not altered or changed. Redo all steps carefully and properly.

fdisk: WARNING: rereading partition table failed, kernel still uses old table: Device or resource busy

Step 6 - Formatting Partition.

Your Partition table redefined or resized only. No Formatting has done yet. Your phone do not read memory unless its properly formatted.

If you wish to use stock or stock based rom DO NOT CHANGE PARTITION FORMAT. It will cause problem even brick. Search around forum for more info about this.

Changing Partition format is good for the Upgraded OS version like lolipop 5.0.0 or 5.1.1 or Marshmallow 6.0.0 to work some features. But not always necessary.

Disconnect Phone from pc> Boot into recovery

TWRP> Wipe> Advance> Format data, cache, system and SDCARD.

If you want to change Format>

From TWRP>Wipe>Advance>select system or data or cache> change file format> select desiered one> change.