All of lore.kernel.org
 help / color / mirror / Atom feed
* partitions resizing on the fly
@ 2018-06-05 14:33 Mihaela Apetroaie-Cristea
  2018-06-05 14:50 ` Iván Castell
  2018-06-06  9:17 ` ChenQi
  0 siblings, 2 replies; 8+ messages in thread
From: Mihaela Apetroaie-Cristea @ 2018-06-05 14:33 UTC (permalink / raw)
  To: yocto

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: partitions resizing on the fly
  2018-06-05 14:33 partitions resizing on the fly Mihaela Apetroaie-Cristea
@ 2018-06-05 14:50 ` Iván Castell
  2018-06-05 14:59   ` Mihaela Apetroaie-Cristea
  2018-06-06  9:17 ` ChenQi
  1 sibling, 1 reply; 8+ messages in thread
From: Iván Castell @ 2018-06-05 14:50 UTC (permalink / raw)
  To: Mihaela Apetroaie-Cristea; +Cc: Yocto Project

[-- Attachment #1: Type: text/plain, Size: 509 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 799 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: partitions resizing on the fly
  2018-06-05 14:50 ` Iván Castell
@ 2018-06-05 14:59   ` Mihaela Apetroaie-Cristea
  2018-06-06  8:46     ` Zoran Stojsavljevic
  0 siblings, 1 reply; 8+ messages in thread
From: Mihaela Apetroaie-Cristea @ 2018-06-05 14:59 UTC (permalink / raw)
  To: Iván Castell; +Cc: Yocto Project

[-- Attachment #1: Type: text/plain, Size: 1242 bytes --]

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@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
> 
> 


[-- Attachment #2: Type: text/html, Size: 2268 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: partitions resizing on the fly
  2018-06-05 14:59   ` Mihaela Apetroaie-Cristea
@ 2018-06-06  8:46     ` Zoran Stojsavljevic
  2018-06-06 15:05       ` Philip Balister
  0 siblings, 1 reply; 8+ messages in thread
From: Zoran Stojsavljevic @ 2018-06-06  8:46 UTC (permalink / raw)
  To: Mihaela Apetroaie-Cristea; +Cc: Yocto Project

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.

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@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@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@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: partitions resizing on the fly
  2018-06-05 14:33 partitions resizing on the fly Mihaela Apetroaie-Cristea
  2018-06-05 14:50 ` Iván Castell
@ 2018-06-06  9:17 ` ChenQi
  2018-06-06  9:33   ` Zoran Stojsavljevic
  2018-06-06 19:06   ` Ferry Toth
  1 sibling, 2 replies; 8+ messages in thread
From: ChenQi @ 2018-06-06  9:17 UTC (permalink / raw)
  To: yocto

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?

Best Regards,
Chen Qi


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: partitions resizing on the fly
  2018-06-06  9:17 ` ChenQi
@ 2018-06-06  9:33   ` Zoran Stojsavljevic
  2018-06-06 19:06   ` Ferry Toth
  1 sibling, 0 replies; 8+ messages in thread
From: Zoran Stojsavljevic @ 2018-06-06  9:33 UTC (permalink / raw)
  To: Yocto Project

Here is one good topic which I already know about. Virtual Box virtual
disks' sizes!
https://superuser.com/questions/1096549/file-based-dynamically-allocated-hard-disk-on-linux

Two questions (stress on [1]):

[1] VirtualBox allows you to create VDI, VMDK, and VHD types of
hard-disks that can be either fixed- or dynamically-sized. Is there
any way to make a file-based dynamically-sized hard-disk for use by a
Linux host OS?

(although I never the found way how to dynamically shrink VDI VD, the
expansion is obvious)

[2] Is it possible to employ any of these three types of file-based,
dynamically-sized hard-disks outside of VirtualBox, on a Linux host
OS?

Zoran
_______

On Wed, Jun 6, 2018 at 11:17 AM, ChenQi <Qi.Chen@windriver.com> 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?
>
> Best Regards,
> Chen Qi
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: partitions resizing on the fly
  2018-06-06  8:46     ` Zoran Stojsavljevic
@ 2018-06-06 15:05       ` Philip Balister
  0 siblings, 0 replies; 8+ messages in thread
From: Philip Balister @ 2018-06-06 15:05 UTC (permalink / raw)
  To: Zoran Stojsavljevic, Mihaela Apetroaie-Cristea; +Cc: Yocto Project

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@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@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@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/yocto
>>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: partitions resizing on the fly
  2018-06-06  9:17 ` ChenQi
  2018-06-06  9:33   ` Zoran Stojsavljevic
@ 2018-06-06 19:06   ` Ferry Toth
  1 sibling, 0 replies; 8+ messages in thread
From: Ferry Toth @ 2018-06-06 19:06 UTC (permalink / raw)
  To: yocto

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
> --




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-06-06 19:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-05 14:33 partitions resizing on the fly Mihaela Apetroaie-Cristea
2018-06-05 14:50 ` Iván Castell
2018-06-05 14:59   ` Mihaela Apetroaie-Cristea
2018-06-06  8:46     ` Zoran Stojsavljevic
2018-06-06 15:05       ` Philip Balister
2018-06-06  9:17 ` ChenQi
2018-06-06  9:33   ` Zoran Stojsavljevic
2018-06-06 19:06   ` Ferry Toth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.