I need to expand the flash partition size to fit my rootfs. I know I have to pass the command AT!APPPARTCHG, but I have no idea about the command syntax. Can anyone give the command details - its syntax, usage and examples if possible ?
If you run the command as a query you should see something like:
Total APP partition size: 261886 kB
That will list the sizes of the partitions. The one you care about for your rootfs is “SYSTEM”. Depending on how large it is you can steal some space from the subsequent partitions without too many consequences. e.g. increase size by 10MB …
Some stuff you should be aware of:
This is destructive. If you move a boundary for a partition it will be deleted.
- Be very careful to make sure the numbers add up. You don’t want to brick your device which is entirely possible.
- Maybe you should try booting from NFS or SD card first. There are examples in the README for the Yocto build.
Thank you very much! But I may have some problems…
Can’t these partitions (such as USERDATA and USERAPP) be unified in a single one (rootfs + userdata + userapp)? For my application requires Java machine, my ROOTFS got a little bigger (something around 130MB), plus my data space.
I don’t know if these partitions make part of the android system scheme (maybe I’m talking trash, please correct me if I’m wrong) or it’s just an convenient partitioning, but comparing with the majors embedded linux solutions, the rootfs+data partition are always in same place.
In short, Can I make it in the same space?
You can’t collapse them into the same space, but you can steal as much space as you want from the others. The partitions are used as follows:
APPSBL - the bootloader. Leave this one alone
APPS - kernel
SYSTEM - rootfs
USERDATA - We put the Legato framework here in some instances, but you don’t have to. You can reclaim all of this space if you like. As of 15.01 it is mounted as /mnt/legato.
USERAPP - The big writable area for your use (mounted as /mnt/flash)
You could take space from USERDATA and USERAPP to add to your SYSTEM partition. If you want to be able to leave the option oppen to write the Legato app framework into its own partition then you should leave at least 10MB of space in USERDATA. For example, if you need 150MB in SYSTEM then you could run:
Note - I haven’t tested these numbers. Double check everything!
As I mentioned before, you can also boot from SD, NFS or a USB stick until you have fine-tuned everything and are sure you have the numbers right.
Thanks again, this is exactly what I need!
Well, not everything went ok…
AT!APPPARTCHG=768,50,19000,384,160000,300,10000,384,71000,0 (these numbers were based on my previous partition)
No matter what I put after “AT!APPPARTCHG=”, I’m still getting ERROR response - even using the original partition numbers.
Do I need to unlock something else? (I’m using WP7104 module)
It’s not possible to have a size of 0 for any partitions. Do you get this error with other combinations?
You were right! Although my original partition had a block with 0 size (which I took as a base), I couldn’t set it again after typing the original numbers… Who knows why?
Anyway, I set my partitions as follow and it worked fine! Now I have plenty of room for my Java machine and other stuff!
After erasing and flashing…
Filesystem Size Used Available Use% Mounted on
/dev/root 156.8M 132.8M 24.0M 85% /
/dev/mtdblock4 72.0M 2.3M 69.7M 3% /mnt/flash
/dev/mtdblock3 10.5M 1.5M 9.0M 14% /mnt/legato
/dev/mtdblock5 5.3M 2.8M 2.4M 53% /mnt/userrw
unionfs 72.0M 2.3M 69.7M 3% /etc
unionfs 72.0M 2.3M 69.7M 3% /data
Thank you very much!!!