I have a Lenovo K30-W, and I installed a ROM designed for Lenovo A6000, which is virtually identical except for the smaller internal storage (16GB vs 8GB). I am happy with the ROM, but my partitions were resized, so now I have 8GB of unused space on internal storage. I am currently on Cyanogenmod 12.1 (Lollipop). As I understand, internal sdcard is no longer a separate partition, but merely a folder in data partition. Is there a way to increase data partition, without reinstalling (or alternatively, with reinstalling)?

I've seen similar questions, but the answers are mostly "don't do it, you'll screw things up". However, in this case I am sure I have unused space on the phone storage.

  • I'll briefly explain why "don't do it, you'll screw things up". See, each phone has a partition table (PIT), that states how the phone memory is to be subdivided: how many partitions, how much space per partition... Starting from the point that this file is hard to extract, if you edit it, reflash it, and you fail, you'll have an useless paperweight resembling a phone. – Death Mask Salesman Mar 14 '16 at 18:23
  • If it is used as a paperweight, then it is not useless. ;) Anyway, if I screw something up, I can always recover via fastboot, right? I bricked the phone several times before, but I was always able to load the recovery via fastboot and reflash the system. – Nikša Baldun Mar 14 '16 at 21:04
  • Messing with partitions means that the phone doesn't recognize "recovery", "bootloader" and such. – Death Mask Salesman Mar 14 '16 at 21:28

It turns out this particular modification isn't so difficult or dangerous. Data is the last partition (30th in this case), so it it merely needs to be deleted and recreated with new size. Just be careful with the starting block. Print the existing partition table beforehand.

  • reboot into recovery
  • make backup of data partition
  • copy parted utility to phone using adb push
  • enter adb shell and execute following code

    chmod a+x parted
    ./parted /dev/block/mmcblk0
    unit b
    rm 30
    mkpart primary ext4 2617245696 15634251263
    name 30 userdata
  • restore data from recovery

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.