Date: Thu, 05 Jan 2023 23:42:22 -0600 From: Mike Karels <mike@karels.net> To: Eugene Grosbein <eugen@grosbein.net> Cc: Mike Karels <karels@FreeBSD.org>, 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 Message-ID: <F93B801A-DC07-4F73-ABD3-E65E327C0095@karels.net> In-Reply-To: <91eca973-ca30-2e0d-d421-aaa729192c25@grosbein.net> References: <202301060044.3060iOli020349@gitrepo.freebsd.org> <91eca973-ca30-2e0d-d421-aaa729192c25@grosbein.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <karels@FreeBSD.org> >> AuthorDate: 2023-01-05 13:15:21 +0000 >> Commit: Mike Karels <karels@FreeBSD.org> >> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F93B801A-DC07-4F73-ABD3-E65E327C0095>