Resize data partition 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.
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
quit

restore data from recovery