On Sun, Aug 04, 2024 at 09:16:52PM +0200, David Uhden Collado wrote:
> To address this limitation, I had to
> write a custom program that calculates partition sizes to maintain their
> initial proportions while occupying the entire storage device.

Why not just use a custom disklabel template that suits your needs?

This is the -t option to /sbin/disklabel.

As a starting point, the following template is broadly equivalent to the
defaults that are hard-coded in to /sbin/disklabel for 'large' volumes:

/               150M-1G         5
SWAP            80M-256M        10
/tmp            120M-4G         8
/var            80M-4G          13
/usr            1500M-30G       10
/usr/X11R6      384M-1G         3
/usr/local      1G-20G          15
/usr/src        2G-5G           2
/usr/obj        5G-6G           4
/home           1G-300G         30

Although note that /sbin/disklabel has code to modify the swap and var
partitions based on the physical memory of the machine, and this logic
cannot, (currently), be expressed in such a template.

Whilst we're here, there is still a comment in editor.c that says that
the swap and var entries are further adjusted from the defined values
in editor_allocspace().

In fact, this code was moved out to allocate_physmemincr() in revision
1.412 last year.  Maybe the comment should be updated to reflect this.

Reply via email to