From nobody Mon Nov 7 17:52:06 2022 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4N5f24324vz4hWB7 for ; Mon, 7 Nov 2022 17:52:12 +0000 (UTC) (envelope-from fbsd@www.zefox.net) Received: from www.zefox.net (www.zefox.net [50.1.20.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "www.zefox.com", Issuer "www.zefox.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4N5f2313Hwz4NNH; Mon, 7 Nov 2022 17:52:11 +0000 (UTC) (envelope-from fbsd@www.zefox.net) Received: from www.zefox.net (localhost [127.0.0.1]) by www.zefox.net (8.16.1/8.15.2) with ESMTPS id 2A7Hq8eS053590 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 7 Nov 2022 09:52:09 -0800 (PST) (envelope-from fbsd@www.zefox.net) Received: (from fbsd@localhost) by www.zefox.net (8.16.1/8.15.2/Submit) id 2A7Hq6Fs053589; Mon, 7 Nov 2022 09:52:06 -0800 (PST) (envelope-from fbsd) Date: Mon, 7 Nov 2022 09:52:06 -0800 From: bob prohaska To: Mike Karels Cc: freebsd-arm@freebsd.org, jmg@freebsd.org Subject: Re: adding swap when expanding root filesystem Message-ID: <20221107175206.GA49113@www.zefox.net> References: <202211071610.2A7GAcHl090048@mail.karels.net> List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202211071610.2A7GAcHl090048@mail.karels.net> X-Rspamd-Queue-Id: 4N5f2313Hwz4NNH X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of fbsd@www.zefox.net has no SPF policy when checking 50.1.20.27) smtp.mailfrom=fbsd@www.zefox.net X-Spamd-Result: default: False [-1.09 / 15.00]; AUTH_NA(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; NEURAL_HAM_LONG(-1.00)[-0.997]; MID_RHS_WWW(0.50)[]; WWW_DOT_DOMAIN(0.50)[]; MIME_GOOD(-0.10)[text/plain]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_SPF_NA(0.00)[no SPF record]; TO_DN_SOME(0.00)[]; ASN(0.00)[asn:7065, ipnet:50.1.16.0/20, country:US]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[freebsd-arm@freebsd.org]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; DMARC_NA(0.00)[zefox.net]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N 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? For starters, is there any hope of making bsdinstall run from the microSD and installing FreeBSD via the traditional process on USB? No need to limit to USB, but that's a useful option for RPi and one option for many more devices. That treats microSD like a boot floppy. I haven't looked at bsdinstall in a very long time, so maybe the traditional installation process isn't as I remember it. ISTR it allowing selection of a boot device, a swap device and at least one /usr device. Maybe I'm confusing it with Jordan Hubbard's installer. Thanks for reading, and apologies if I'm hopelessly out of date. bob prohaska