How to increase cache partition ( or any partition ) on Ubuntu Touch phone? Question.
-
I would like to ask if someone could write a step by step tutorial how to increase a cache partition (or any other ) on Meizu Pro 5, as currently Xenial builds are failing to install in Recovery. Apparently the cache/recovery partition is too small for that image. 15.04 install without any problem though. Anyone to help? I managed to unpack the ubuntu*. tar.xz (or ubports*.tar.xz) to system and tried with fdisk, but I'm unable to delete the right partition and create a new one. So I'm pretty stuck at the moment. Any advice is appreciated. Thanks.
-
@stefano did you flash ubuntu touch first and then flash 15.04…or 16.04. as flashing U T first sorts out the partition
-
@marathon2422 I have tried to flash 16.04 version 14 and it fails at recovery. The version 1 I installed without any problem, but this version 14 and also later ones doesn't. Same message in recovery, contact support.
15.04 install without any issue. -
@marathon2422 what did you mean the flashing UT sorts out partition?
-
The way I did it (taking space from the 'custom' partition and adding it to the 'cache' partition):
- it is not possible to do it from inside ubuntu so you need to install twrp and reboot that
- now the fdisk inside twrp is too weak and cannot help us so mount the ubuntu system now which contains the fdisk we need:
mount /dev/block/sda41 /system mount -t proc proc /system/proc mount -t sysfs sys /system/sys mount -o bind /dev /system/dev chroot /system /bin/bash
- now we have an fdisk that can do this:
- fdisk: delete the 'custom' partition (partition 42 for my meizu pro 5)
- fdisk: create the 'custom' partition with a smaller size (I calculated: 512 - (700 - 512) = 512 - 188 = 324MB so that 188 would be available to add to the current size of the 'cache' partition)
- parted: give name 'custom' to the newly created partition
name 42 custom
- format that partition:
mke2fs -t ext4 -m 0 /dev/block/sda42
- now, from what I understand from my notes, that didn't work so I had to reboot in twrp and then it worked - check if you want with
df -h
that you have a smaller 'custom' partition - check if you want that you can boot your phone and everything is ok
- now repeat the above instructions for booting the twrp recovery and then mounting the ubuntu system
- now repeat the above instructions do delete and recreate the 'cache' partition with a bigger size and then format it:
- fdisk: delete 43 (that is the number of my cache partition on my meizu pro 5)
- fdisk: recreate 43 - with the max size - I decreased the 'custom' partition so that the new 'cache' would be 700MB
- parted:
name 43 cache
- reboot in twrp and format it:
mke2fs -t ext4 -m 0 /dev/block/sda43
df -h
orsudo parted -l
- there you go!
-
@mihael I'll give it a try. Thanks.
-
@mihael I think I managed to do that. How would I verify how big my cache is now?
-
Oh, with
df -h
-
@mihael with adb shell or ?
-
@mihael /dev/disk/by-partlabel/cache 496M 4.2M 482M 1% /android/cache what that means ??? Cos I changed it to 700 and saved it that way.
-
From terminal even...
I don't know... Mine shows
/dev/disk/by-partlabel/cache 679M 768K 664M 1% /android/cache
-
@mihael for some reason it did not change/save even after I saved id with w and rebooted and formated the cache ???
Device Start End Sectors Size Type
/dev/block/sda1 1024 1279 256 1M Microsoft basic data
/dev/block/sda2 1280 1343 64 256K Microsoft basic data
/dev/block/sda3 1344 1407 64 256K Microsoft basic data
/dev/block/sda21 2048 3071 1024 4M Microsoft basic data
/dev/block/sda22 3072 5119 2048 8M Microsoft basic data
/dev/block/sda23 5120 5631 512 2M Microsoft basic data
/dev/block/sda24 5632 6655 1024 4M Microsoft basic data
/dev/block/sda25 6656 7679 1024 4M Microsoft basic data
/dev/block/sda26 7680 13823 6144 24M Microsoft basic data
/dev/block/sda27 13824 22015 8192 32M Microsoft basic data
/dev/block/sda28 22016 30207 8192 32M Microsoft basic data
/dev/block/sda29 30208 35327 5120 20M Microsoft basic data
/dev/block/sda30 35328 40447 5120 20M Microsoft basic data
/dev/block/sda31 40448 45567 5120 20M Microsoft basic data
/dev/block/sda32 45568 50687 5120 20M Microsoft basic data
/dev/block/sda33 50688 55807 5120 20M Microsoft basic data
/dev/block/sda41 65536 720895 655360 2.5G Microsoft basic data
/dev/block/sda42 720896 851967 131072 512M Microsoft basic data
/dev/block/sda43 851968 983039 131072 512M Microsoft basic data
/dev/block/sda44 983040 7633914 6650875 25.4G Microsoft basic dataBut when I saved it the table was this:
dev/block/sda21 2048 3071 1024 4M Microsoft basic data
/dev/block/sda22 3072 5119 2048 8M Microsoft basic data
/dev/block/sda23 5120 5631 512 2M Microsoft basic data
/dev/block/sda24 5632 6655 1024 4M Microsoft basic data
/dev/block/sda25 6656 7679 1024 4M Microsoft basic data
/dev/block/sda26 7680 13823 6144 24M Microsoft basic data
/dev/block/sda27 13824 22015 8192 32M Microsoft basic data
/dev/block/sda28 22016 30207 8192 32M Microsoft basic data
/dev/block/sda29 30208 35327 5120 20M Microsoft basic data
/dev/block/sda30 35328 40447 5120 20M Microsoft basic data
/dev/block/sda31 40448 45567 5120 20M Microsoft basic data
/dev/block/sda32 45568 50687 5120 20M Microsoft basic data
/dev/block/sda33 50688 55807 5120 20M Microsoft basic data
/dev/block/sda41 65536 720895 655360 2.5G Microsoft basic data
/dev/block/sda42 720896 797700 76805 300M Microsoft basic data
/dev/block/sda43 797952 983039 185088 723M Microsoft basic data
/dev/block/sda44 983040 7633914 6650875 25.4G Microsoft basic dataSO WHAT NOW, WHY IT DID NOT SAVE???
-
I'm sorry, I really don't know... Maybe it's some linux issue that someone with more experience could shed light upon...
-
What does
df -h
from twrp console show? -
@mihael Did you do it on the phone TWRP terminal or via adb? I mean the whole repartitioning. Cos I have used adb shell for it.
-
@mihael /dev/disk/by-partlabel/cache 496M 4.2M 482M 1% /android/cache
-
@Stefano I believe I did it through ssh...
-
@mihael I give it a try again later, maybe I'll figure it out. (will try with TWRP terminal as well)
-
Let me know...
-
@mihael I managed to do it. The problem was that I did not format the newly created partitions properly and did not change the names of them as I did not seen such an option in fdisk , but, there is an expert menu under ,x, and there is option to rename. After I renamed it, I format it and now it shows partition 43 = 723m, so I think that should suffice. Will try now to flash 16.04 now, we'll see what happens now! Thank you a lot for your help.
Edit. It flashed 16.04 without failing in recovery