[HTC One SV] -=GQ=-:
[MOD] one_sv-swaper: Swap "internal" sd (4GB fat), /data (1GB ext4) and external SD

Hello there.

I'm using my c525u for over a year and very upset with the size of /data partition, From the other side, it has "internal sd-card" I'm not using at all (well, some apps use it for it's data, but not all 4GB).

So one day I decided to swap them. Store data on 4GB partition and int_sd on 1GB one. Here is small instruction, how to do this.

one_sv_swapper

Goal: swap /data, /sdcard and /sdcard/ext_sd in different ways (see below). The main result is to allow one to "enlarge" /data partition.

How: modify boot (aka kernel) and /system to change mount points. Also modify recovery to force it to backup/restore with new partitioning scheme.

Requirements:

K2_UL, K2_U or K2_CL smartphone. (K2_PL_CPL should be supported too, but nobody has tested it yet.)

ROM: Stock JB based

Recovery: TWRP (Was tested with TWRP_2.7.1.1_K2_UL.img and openrecovery redo 2.8.5.0)

S-Off/S-On: S-Off is needed. Will not work with S-On.

Working adb on PC.

Do full backup of your phone before you begin (including android_secure)!

Also save any valuable content from your "internal" sd-card, because it will be formated.

Install instructions.

1. Boot into recovery!

2. Download archive from the link below and extract files to some directory on your PC.

3. Open console in the directory with the files. (Start/Run/cmd.exe or any other way)

4. Write the following 3 commands in the console (Do not loose " sign.)

adb push swapper /tmp
adb push abootimg /tmp
adb shell "cd /tmp&&chmod 755 *&&./swapper READONLY"

If scripts finishes successfully you will see Everything is done. message.

In case of troubles dump here script's output to get support.

After "remapping" your flash it is necessary to reboot your smartphone. Then you could start with your wiped system or boot into recovery and restore your data from the backup (but only /data and .android_secure)

Take a note: this mod modifies recovery partition, so do not reflash recovery after installing this mod, or you will not be able to use backup/restore/wipe functions.

Mod's modes =)

There is "READONLY" parameter written in the end of the last command. This is partitioning mode. You should write there any of the following variants:

READONLY

Do not modify anything on the phone, just unpack images and analyze them.

STOCK

/data - 1GB flash

/sdcard - 4GB flash

/sdcard/ext_sd - external SD

I_E_MOD

/data - 1GB flash

/sdcard - external SD

/sdcard/ext_sd - 4GB flash

D_I_MOD

/data - 4GB flash

/sdcard - 1GB flash

/sdcard/ext_sd - external SD

D_I_E_MOD

/data - 4GB flash

/sdcard - external SD

/sdcard/ext_sd - 1GB flash

Uninstall instruction

To remove this mod just run it again with parameter STOCK (see above).

Or follow the full restore instruction below.

Any of this methods means data loss, so do not forget backup data, android_secure and internal SD.

How to restore your phone in case of troubles:

1. Flash clean recovery from PC (with "fastboot flash recovery ...")

1'. Boot into recovery.

2. Restore all data from backup

3. Reformat int_sd as FAT from recovery "Format" menu

FAQ

Q: Could I install this mod on the phone with internal and external sd swapped.

A: Yes, this is one of supported state (called I_E_MOD). swapper should handle this perfectly.

Q: After installing this mod, I see "Unknown" in Settings/Storage/AppStorage size.

A: This is known issue in I_E_MOD and D_I_E_MOD modes. It doesn't affect any functionality.

Q: After reboot says Type Password to Decrypt Storage... what can i do?

A: This means that swapper failed to modify your boot/system correctly. You could restore your firmware from backup (see above). If you still want to do the modification, contact me with detailed info about your phone, we could try to debug the problem.