Data/SDCard Partition Swap for the HTC DROID Incredible 4G LTE

What is this?

The /data partition on this device is quickly being outgrown by the size of apps available for Android. This is partly why newer devices have moved to a /data/media structure, where a large partition is shared by both apps and internal storage. This problem can be partly mitigated, though: redefine the internal storage partition to become a 4GB /data partition. For the builds of CyanogenMod 11 – 12.1 offered on this website, the old data partition becomes a small 1GB /sdcard partition. For the builds of CyanogenMod 13 offered on this website, the old data partition is ignored and the new 4GB data partition is treated as /data/media storage.

This partition swap is non-invasive and completely reversible. We aren’t moving or resizing partitions; we’re just repurposing two of them.

What ROMs support this?

Unofficial releases of CyanogenMod and LineageOS that support this change are available: here for CyanogenMod and here for LineageOS. You’ll notice they have fireballx in the filename. These packages only install on a device which has already performed the partition swap.

Caution: There is no data migration available when transitioning from standard to swapped partition layout, or vice versa. You will lose all of your data and apps by performing this change.

Other AOSP-based ROMs can support this partition layout by cherry-picking one of these commits:

I strongly encourage device maintainers to ensure TARGET_OTA_ASSERT_DEVICE is supported by their build environment. This adds an assert for the fireballx device name to the top of updater-script.

It is feasible that the stock ROM for this device could support this change, but it would require editing of init.fighter.rc and vold.fstab. It’s not clear to me whether any kernel hackery would be necessary. Please don’t ask me to do this for you. I have no plans to support custom stock ROMs.

How do I proceed (or revert)?

  1. Flash TWRP (it must come from this website, do not use the official version):
    fastboot flash recovery filename.img
    Windows 8.1 users: fastboot trouble?
  2. Backup all of the files on internal storage (/sdcard) to your computer
  3. In recovery, make a full backup of your ROM to MicroSD

Reference this table for the directions below (sizes are approximate). You can choose either one of the swapped layouts, depending on the filesystem you prefer. ext4 is tried and true; f2fs is newer and designed for flash memory.

  Partition
Size: 1150MB
Partition
Size: 4250MB
Cache
Partition
Standard Layout EXT4 FAT EXT4
Swapped Layout (ext4) FAT EXT4 EXT4
Swapped Layout (f2fs) FAT F2FS F2FS

Stock or CyanogenMod 11 – 12.1 (or other AOSP ROM based on Android 4.4 – 5.1)

These instructions assume you’re using the TWRP builds labeled Dual partition scheme support. Also, note that the CyanogenMod 11 builds on this site do not include F2FS support. Kernel support for F2FS was added beginning with CyanogenMod 12.

  1. Boot to recovery and navigate to: Wipe > Advanced Wipe
  2. Select the Data partition, then hit Repair or Change File System
  3. Look at the Size output on the screen and take note of the filesystem you want from the table above.
  4. Choose Change File System, select the correct filesystem, and confirm
  5. Repeat steps 2-4 for the Internal Storage partition.
  6. Repeat steps 2 and 4 for the Cache partition (the size doesn’t matter here since it isn’t being swapped to a new location).
  7. Reboot recovery; i.e. from the reboot menu, choose Recovery.

This reboot allows TWRP to auto-detect the changed filesystems, apply a device name (fireball or fireballx), and re-associate the /data and /sdcard paths. To verify the mode in which your device has booted recovery, use adb:
adb shell getprop ro.product.device

You can now use your device as usual. When you format (wipe) partitions in the future, there’s nothing special to remember. You can use the standard Wipe screen (not Advanced Wipe) and your partitions will retain their filesystems.

CyanogenMod 13 / LineageOS 14.1 (or other AOSP ROM based on Android 6.0 / 7.1) and

These instructions assume you’re using the TWRP builds labeled Datamedia scheme.

  1. Boot to recovery and navigate to: Wipe > Advanced Wipe
  2. Select the Data partition, then hit Repair or Change File System
  3. Choose Change File System, select either EXT4 or F2FS, and confirm
  4. Repeat steps 2-3 for the Cache partition, selecting either EXT4 or F2FS.
  5. (Optional) Repeat steps 2-3 for the Unused Storage partition, but choose the FAT file system type. This partition will not be accessed by Android, it is only visible to TWRP as general storage (only 1GB in size).
  6. Reboot recovery; i.e. from the reboot menu, choose Recovery.

This reboot allows TWRP to auto-detect the changed filesystems, apply a device name (fireball or fireballx), and re-associate the /data and /sdcard paths. To verify the mode in which your device has booted recovery, use adb:
adb shell getprop ro.product.device

You can now use your device as usual. When you format (wipe) partitions in the future, there’s nothing special to remember. You can use the standard Wipe screen (not Advanced Wipe) and your partitions will retain their filesystems.