From nobody Fri Jan 06 05:42:22 2023 X-Original-To: dev-commits-src-main@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 4NpC0K6lwpz2qtkl; Fri, 6 Jan 2023 05:42:25 +0000 (UTC) (envelope-from mike@karels.net) Received: from mail.karels.net (mail.karels.net [216.160.39.52]) by mx1.freebsd.org (Postfix) with ESMTP id 4NpC0K2dPVz3FSb; Fri, 6 Jan 2023 05:42:25 +0000 (UTC) (envelope-from mike@karels.net) Authentication-Results: mx1.freebsd.org; none Received: from mail.karels.net (localhost [127.0.0.1]) by mail.karels.net (8.16.1/8.16.1) with ESMTP id 3065gNvC028013; Thu, 5 Jan 2023 23:42:23 -0600 (CST) (envelope-from mike@karels.net) Received: from [10.0.2.130] ([10.0.1.1]) by mail.karels.net with ESMTPSA id yk4+Dr+0t2NrbQAA4+wvSQ (envelope-from ); Thu, 05 Jan 2023 23:42:23 -0600 From: Mike Karels To: Eugene Grosbein Cc: Mike Karels , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 8664e266d6a4 - main - growfs(7): clarify assumptions and limitations Date: Thu, 05 Jan 2023 23:42:22 -0600 X-Mailer: MailMate (1.14r5921) Message-ID: In-Reply-To: <91eca973-ca30-2e0d-d421-aaa729192c25@grosbein.net> References: <202301060044.3060iOli020349@gitrepo.freebsd.org> <91eca973-ca30-2e0d-d421-aaa729192c25@grosbein.net> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4NpC0K2dPVz3FSb X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:209, ipnet:216.160.36.0/22, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 5 Jan 2023, at 23:04, Eugene Grosbein wrote: > 06.01.2023 7:44, Mike Karels wrote: > >> The branch main has been updated by karels: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D8664e266d6a4573d1875ee8= f4ce0cdb091171780 >> >> commit 8664e266d6a4573d1875ee8f4ce0cdb091171780 >> Author: Mike Karels >> AuthorDate: 2023-01-05 13:15:21 +0000 >> Commit: Mike Karels >> CommitDate: 2023-01-06 00:44:16 +0000 >> >> growfs(7): clarify assumptions and limitations >> >> Document that the growfs(7) script works only if the root file sys= tem >> is in the last partition and free space immediately follows it. >> Don't imply that /usr can be a separate partition, as that would >> likely mean that root is not last. >> >> Reported by: marklmi at yahoo dot com > > Meantime, growfs(8) binary command living in /sbin successfully growfs = root file system > being NOT last, if there is following free space immediately after it. > > I use that feature occasionally dealing with installworld problem for s= ystems installed > long time ago (pre-date introduction of Clang in FreeBSD) > when distinct root and /usr partitions sized 512MB were more than enoug= h. > > For example: > > swap partition (b) 8GB > root partition (a) 512MB > /usr partition (d) 512MB > others including /usr/local, /home etc... > > For major source based upgrade 512MB is not enough to hold new /usr con= tents, > so I temporary destroy swap partition at the beginning and recreate it = 1GB less to make hole > that is used to create alternative 1GB sized partition temporary mounte= d as /mnt/usr. > I dump|restore /usr to /mnt/usr, change /etc/fstab to mount new partiti= on as /usr > and not mount old one at all, and reboot. After that: > > swap partition (b) 7GB > /usr partition (g) 1GB > root partition (a) 512MB > former /usr partition (d) 512MB > others... > > Then I destroy partition (d) making free space immediately following ro= ot partition > that is NOT last one. And growfs(8) works on mounted r/w root just fine= =2E > That worked every time I tried. > > I wonder why growfs(7) should have the limitation described in cited co= mmit. Growfs(7) is not really a general-purpose tool. It is intended to expand= distributed images that are placed onto variable-sized media and booted, = and those images have a single file system and possibly a swap partition (whi= ch comes first, so the root can be expanded). The growfs(7) script does not= take a parameter for which file system to expand, so it would have to int= uit what you want. Meanwhile, what you describe is reasonably straightforwar= d using gpart and growfs(8) (or zpool online -e). The reason for describin= g the limitations of the script is that questions like this one arose, and the = man page for growfs(7) documents usage separate from the /etc/rc.d system. R= ather than trying to document usage of the full range of situations where the s= cript might work, I just documented the intended (and tested) use case. In fac= t, the script may well work in other cases where there is space after the ro= ot. Mike