[yocto] partitions resizing on the fly

Ferry Toth ftoth at telfort.nl
Wed Jun 6 12:06:05 PDT 2018


ChenQi wrote:

> On 06/05/2018 10:33 PM, Mihaela Apetroaie-Cristea wrote:
>> Hello,
>>
>> I have a minimal yocto OS built for RPI, which has three partitions:
>> boot, root and data. Is there any way to resize root and data such that
>> root expands/flattens when files and others are added/deleted? Such that
>> I can make more space for the data partition. At the moment my partitions
>> are built with minimal size and I expand them with gparted after I added
>> them on the sd card. But if I put my device somewhere unreachable it
>> would be very useful to have a way to expand and flatten portions on the
>> fly.
>>
>> Thank you,
>> Mihaela
> It is said that btrfs supports such feature? Frankly I didn't try it out.
> Yocto supports building out btrfs images. Maybe you can give it a try?
With btrfs you can have multiple partitions (on the same or different 
disks), the partitions can form a single pool. In this single pool you can 
have multiple volumes. Space from the pool gets allocated to the files in a 
particular volume. The volume size is not really restricted, but when you 
ask df, it will give you the size of the pool. With 3 volumes on the 
partition you might think you have 3x the pool available, which is not true 
of course. If you run out of space it will hit all volumes at the same time. 
But you can then (temporarily) add f.i. a usb disk to instantly add space to 
all volumes.
> Best Regards,
> Chen Qi
> --




More information about the yocto mailing list