[yocto] partitions resizing on the fly

Philip Balister philip at balister.org
Wed Jun 6 08:05:47 PDT 2018


On 06/06/2018 04:46 AM, Zoran Stojsavljevic wrote:
> Before asking this question to YOCTO community, the simplier question
> will be to ask if anybody knows any Linux distro (RHEL, Fedora,
> Debian, Ubuntu, SuSE etc.), with the feature which can do this?
> 
> I am dealing with Linux for years, but such a mechanism did not
> see/experience. As well, never found anybody who asked this question
> as a such even for the normal distros.
> 
> In contrary, it is impossible to expand/shrink dynamically active
> (mounted) partitions, AFAIK.

man resize2fs :)

A carefully crafted script that uns on first boot should expand a
partition to fill all available space.

Philip


> 
> For this to happen, somebody needs to invent the new dynamically
> expanding active fs (the feature of it), which can do that.
> 
> Zoran
> _______
> 
> On Tue, Jun 5, 2018 at 4:59 PM, Mihaela Apetroaie-Cristea
> <apetroaiecristeamihaela at gmail.com> wrote:
>> Hi,
>>
>> Thanks for your answer. However, my question is whether there is a mechanism
>> such that the root will keep it’s minimal size, but be able to expand if
>> there is free space on the disk when new files are added (not necessarily to
>> occupy the whole free space), and shrink back if files are deleted. At the
>> moment I am happy to flash it with the minimal size, but it runs out of
>> space when I want to add something to the partitions, although there is
>> extra space on the disk that it could take. I know the implementation of
>> this is complicated, but I am wondering if anyone knows a solution for this.
>>
>> Thank you
>>
>>
>> On 5 Jun 2018, at 15:50, Iván Castell <icastell at nayarsystems.com> wrote:
>>
>> I managed this issue redefining this script in my custom layer (rocko
>> branch):
>>
>>     scripts/lib/wic/canned-wks/mkefidisk.wks
>>
>> and setting a bigger size for the root partition (80GB in my case):
>>
>>     part / --source rootfs --ondisk sda --fstype=ext4 --label platform
>> --align 1024 --use-uuid --size 80000
>>
>> Its not very nice, I know. But yocto can't know the real size of your root
>> device until writing the final image.
>>
>> I don't know if this is the best way to fix this  but it works.
>>   -- Ivan
>>
>>
>>
>>
>> --
>> _______________________________________________
>> yocto mailing list
>> yocto at yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/yocto
>>


More information about the yocto mailing list