Re: adding swap when expanding root filesystem

Gordon Bergling <[email protected]>
Newsgroups gmane.os.freebsd.devel.arm
Message-ID <[email protected]>
Hi Mike,

On Mon, Nov 07, 2022 at 10:10:38AM -0600, Mike Karels wrote:
> This question is not really arm-specific, but I couldn't think of a better
> mailing list for it.
> 
> There are peridic issues reported on small systems like Raspberry Pi
> where people are running buildworld or poudriere and running out of
> memory.  As the user gets no control over the disk layout when installing,
> there is no option to add swap space on the install image.  I have added
> swap space on a USB disk, but this is often not an option.  It occurred
> to me that it might be reasonable to add swap space before expanding
> the root filesystem if there is sufficient space.  I have a prototype,
> and wondered if this is a good thing to do.  Granted, this will often
> create swap on microSD, which is not optimal, but probably better than
> nothing.
> 
> The current prototype creates a swap partition which is 1/10 of the disk
> if the disk is at least 15 GB and the initial root partition is no more
> than 1/3 of the disk, but only up to 1.5x of physical memory.  I would
> probably enable this by default, but provide a way to disable it via a
> kenv variable and/or a variable in /etc/rc.conf.
> 
> Thoughts?
> 
> 		Mike

That would be very welcomed addition. I personally ofter run into problems
when I try get a crash dump from my RPi4, since no dumpdev can be set
without a separate swap partion. An USB stick worked for I while, but it
just went dead at some point.

And the genet(4) driver doesn't support netdump(4).

--Gordon
signature.asc (application/pgp-signature, 618 B)
-----BEGIN PGP SIGNATURE-----

iQGTBAEBCgB9FiEEYbWI0KY5X7yH/Fy4OQX2V8rP09wFAmNqAiJfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDYx
QjU4OEQwQTYzOTVGQkM4N0ZDNUNCODM5MDVGNjU3Q0FDRkQzREMACgkQOQX2V8rP
09ztxggAnCQ2fqydmfBO9VsiTHYNh4tSlJpK8LNL7sMh+mdhFakjZPQtlmt8+Nnc
xEqQpJ2xA/ceJtS5ROLRX/7VOVhUGBys0EjkyKnff+NgCCiK1pUMV37BzfMy6MiV
8eycQuCPfl2kOnXCCC9NUUvQawgM5lPwEyqInrXUQMjOsO/GDo/5yJ3xRioDLPE6
yIhgL1OjYxDuhXu2926gRUQ31FdRnj1GC3RYXc70xWhuesmb5ZwnqPcxjfeeZwpc
vhWBwK0lw4MJgRPa+tAKcctWuSMIXGLxT6OEBcT6MvwrF+ga9em+amKP7JlCJa9f
TUAquQuWw3AX9MEXL+jb4Jv54DKAwA==
=frm+
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.