root partition's size on different phone
After the nexus 5 mobile phone is installed with ubuntu touch, the root partition is only 2Gb, and I basically have no way to install any packages using apt. I checked some information and community posts, there is no feasible way to help make the root partition bigger.
I have a few questions
- What is the basis for ubuntu touch to assign the root partition;
- If I install ubuntu touch with a large storage phone, does the root partition become larger?
- Is there any way to adjust the root partition as needed
- How to install opencv on ubuntu touch
Thanks to everyone who tried to help
Apt outside of a Libertine container is a very bad idea so much so it got anther mention in a Q&A https://ubports.com/blog/ubports-blog-1/post/ubuntu-touch-q-a-77-279 Libertine setup is in the System Settings if you want to try, but you probably no that all ready.
aptisn't really supported in UT because its rootfs is mounted as read-only. You can still use
aptthough and even resize the rootfs if you really want and accept the risk and consequences. In general, using
aptwon't break your device unless maybe you remove a vital package in the system. OTA updates may remove all your changes in the root or in rare instances perhaps have conflict with your changes and break your system.
Anyway, if you really want to resize your rootfs, you can search in this forum, I believe there's a post with the commands on how to do it.
@Lakotaubp Thanks for the reply, but I need to use apt to install, for example, I want to install opencv. Why is there so little root partition capacity? If installing with a large-capacity mobile phone, can the root partition become larger?
@kugiigi Thanks for the reply, but I need to use apt to install, for example, I want to install opencv. Tried some of the methods provided in the community, and it was unsuccessful. Why is there so little root partition capacity? If installing with a large-capacity mobile phone, can the root partition become larger?
@bigwang I think the size is mainly because of the limitation in android-based devices...I believe it's the cache partition which is used for applying updates. These are the commands I used to resize on my Nexus 5. DO THIS AT YOUR OWN RISK AND DON"T BLAME ME FOR ANYTHING THAT WILL HAPPEN
This resizes it to 5GB.
sudo dd if=/dev/null of=/userdata/system.img bs=1MiB seek=5000 count=0 sudo e2fsck -f /userdata/system.img sudo resize2fs -f /dev/loop0
Or if you insist on using apt you break the system
@kugiigi Thanks, I know the risks. But after I executed three commands in sequence, the root partition was still 2G. I don't know what went wrong.
@Lakotaubp Well, because I have to install OpenCV. If you know how to install or whether the root partition of a large-capacity mobile phone will also become larger, please let me know, thank you.
You need to install OpenCV ?
That is not a utility program, but a library.
So if you're trying to build an app using OpenCV then you should start by reading how to make apps for Ubuntu Touch.
Dependencies are a bit tricky and you can either copy the binary lib within you click package or compile the library along with your code.
If OpenCV is a dependency for another app, then use Libertine container.
Understand what is blocking you and follow our instructions. Insisting in your direction won't probably help you achieve your goal. Resizing the rootfs and mounting it RW is 99% a bad idea.
Camera scanner is using opencv https://open-store.io/app/camerascanner.jonnius
if your app also needs opencv you can look there how to handle that dependencie
@bigwang Sorry, I forgot to say that this doesn't work while booted anymore. It was working before but now it's not. You have to do it in recovery or fastboot
Why can't you install OpenCV in libertine?