From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 12 15:17:06 2024 Received: (at submit) by debbugs.gnu.org; 12 Dec 2024 20:17:06 +0000 Received: from localhost ([127.0.0.1]:40470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLpcP-0006jv-Su for submit@debbugs.gnu.org; Thu, 12 Dec 2024 15:17:06 -0500 Received: from lists.gnu.org ([209.51.188.17]:57990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLpcO-0006jn-2I for submit@debbugs.gnu.org; Thu, 12 Dec 2024 15:17:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tLpcG-0002Jk-FI for guix-patches@gnu.org; Thu, 12 Dec 2024 15:16:56 -0500 Received: from mail-108-mta131.mxroute.com ([136.175.108.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLpcE-0002MD-Su for guix-patches@gnu.org; Thu, 12 Dec 2024 15:16:56 -0500 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta131.mxroute.com (ZoneMTA) with ESMTPSA id 193bc8452540003e01.002 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 12 Dec 2024 20:16:48 +0000 X-Zone-Loop: f509b21539ecdde32c33bd76b496f13255c128857f38 X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=PVYGNjWNfTR2LoSfrF+mtuqe+Sh0vrxWVeZfS/I3KoY=; b=BVgDNDAyGFRnktuJKnjHZIJ4tP iEo8XSac9uJL8rsWH2e0QJRxxo92fOgNYENOy7kE85UHXL8RQpbQNWnRaggvzKoOY80kg/s5/fkUr H989VnDQ3lOeYLCnfNMIJp+S9nn9p2ke8p2DTgeYZHdK6NFuCY534R9d5nBHmLl2tLBKDU7Ql3z+W Zb6ZUczijssoD2Dwzpr23E/1bo0v73/9ulf18WuhEPVf48NFG7ZrK6eINxa8CzEMVj7SoOFej5lW9 87VMJjSPXcMF0eyNSw/B53pgi5RWafWXvJ7/X7g7g1FHV95Db8UXKu+AnopdcwYU+GtAbiJdvvaMr W7Trs/QA==; From: Richard Sent To: guix-patches@gnu.org Subject: [PATCH 0/2] Add resize-fs service Date: Thu, 12 Dec 2024 15:16:33 -0500 Message-ID: MIME-Version: 1.0 X-Debbugs-Cc: Sharlatan Hellseher Content-Transfer-Encoding: 8bit X-Authenticated-Id: richard@freakingpenguin.com Received-SPF: pass client-ip=136.175.108.131; envelope-from=richard@freakingpenguin.com; helo=mail-108-mta131.mxroute.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit Cc: Richard Sent , Gabriel Wicki X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Hi all, This patch series adds a resize-fs service, a service designed to resize a file system. It does this by utilizing cloud-utils growpart and an appropriate file system utility. This is loosely based on code from Gabriel Wicki in #69090. While it has been substantially changed, I figured I'd preserve the copyright notice. I opted to use a file-system object directly and resolve the device path when the service runs instead of having the user hardcode the parent device path and partition number ahead of time. This hopefully makes it a bit easier to use, although the user still needs to ensure the desired partition is at the end of any image. I tested this with a removable flash drive and an ext4 file system. I'd greatly appreciate additional help; it's quite a pain! I have not tried it using a system image on a VPS. One possible limitation is that this service only supports resizing one file system and cannot be extended. On the other hand I'm struggling to come up with use cases where someone would need to extend multiple file systems simultaneously. I expect this patch will need some feedback. :) Richard Sent (2): gnu: services: Add resize-fs-service. packages: cloud-utils: Add missing growpart programs to path. doc/guix.texi | 50 +++++++++++++++ gnu/packages/admin.scm | 15 ++++- gnu/services/admin.scm | 135 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 196 insertions(+), 4 deletions(-) base-commit: a9003b8e6b40b59c9545ae87bb441d3549630db7 -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 12 15:19:36 2024 Received: (at 74837) by debbugs.gnu.org; 12 Dec 2024 20:19:36 +0000 Received: from localhost ([127.0.0.1]:40477 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLpem-0006ob-Eq for submit@debbugs.gnu.org; Thu, 12 Dec 2024 15:19:36 -0500 Received: from [136.175.108.23] (port=34007 helo=mail-108-mta23.mxroute.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLpek-0006o8-8d for 74837@debbugs.gnu.org; Thu, 12 Dec 2024 15:19:31 -0500 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta23.mxroute.com (ZoneMTA) with ESMTPSA id 193bc868e180003e01.001 for <74837@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 12 Dec 2024 20:19:15 +0000 X-Zone-Loop: 8f30f8bde1996122a73d368f8e2cc0ca8ea1be266582 X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=BFpYm3eZQN0J9KYOQWgCzt+LY6PpUiKfliUx8ty0Gok=; b=m2F4+Eg1ZNKLVpoFMKUKHVquNw 1WMgpteYJdsqtsIu7FhfysN4ye0sRK4+GILxtQ4x2bW7jZK/+Kjrb1BBZRtP8BDAMaSy586UXkxna jGpo2a6h2nN6zeITqvUb4KQF6lIEyFqNhHn84yPDAyz9KnnWHmyL3myc4f0Td6CJHVVr6c57m4mkQ F82HMYGenLhiHnwv4zH+l9DBGgqD3a//fQzuNUj4OpD41VWy6WPEExsWLoLzIrJyrUQEEiq8WHDBO C+RBScflICiTKZGP1CBxhYzThVo9kPvhfKB6t0aStRUpyhbF9LK1HXUg43X0q9jeK21dJiIE2Axm9 UB0C2efw==; From: Richard Sent To: 74837@debbugs.gnu.org Subject: [PATCH 1/2] gnu: services: Add resize-fs-service. Date: Thu, 12 Dec 2024 15:18:59 -0500 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Authenticated-Id: richard@freakingpenguin.com X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/services/admin.scm (resize-fs-configuration): New configuration type. (resize-fs-shepherd-service): New procedure. (resize-fs-service-type): New variable. * doc/guix.texi (Miscallaneous Services [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [136.175.108.23 listed in sa-trusted.bondedsender.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [136.175.108.23 listed in bl.score.senderscore.com] 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Debbugs-Envelope-To: 74837 Cc: Richard Sent , Gabriel Wicki X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) * gnu/services/admin.scm (resize-fs-configuration): New configuration type. (resize-fs-shepherd-service): New procedure. (resize-fs-service-type): New variable. * doc/guix.texi (Miscallaneous Services): Document it. Change-Id: Icae2fefc9a8d936d4c3add47520258b341f689a4 --- doc/guix.texi | 50 +++++++++++++++ gnu/services/admin.scm | 135 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 184 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index a2915de954..5636eb23fb 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -41891,6 +41891,56 @@ Miscellaneous Services @c End of auto-generated fail2ban documentation. +@cindex resize-fs +@subsubheading Resize File System service + +This service type lets you resize a live file system during boot, which +can be convenient if a Guix image is flashed on an SD Card (e.g. for an +embedded device) or uploaded to a VPS. In both cases the medium the +image will reside upon may be larger than the image you want to produce. + +For an embedded device booting from an SD card you may use something like: +@lisp +(service resize-fs-service-type + (resize-fs-configuration + (file-system + (device (file-system-label "root")) + (type "ext4")))) +@end lisp + +Be extra cautious to use the correct device and type. The service has +little error handling of its own and relies on the underlying tools. +Wrong use could end in loss of data or the corruption of the operating +system. + +Partitions and file systems are grown to the maximum size available. +File systems can only grow when they are on the last partition on a +device and have empty space available. + +This service supports the ext2, ext3, ext4, btrfs, and bcachefs file +systems. + +@table @asis + +@item @code{file-system} (default: @code{#f}) (type: file-system) +The file-system object to resize. This object must have the device and +type fields set. The others are ignored. + +@item @code{cloud-utils} (default: @code{cloud-utils}) (type: file-like) +The cloud-utils package to use. + +@item @code{e2fsprogs} (default: @code{e2fsprogs}) (type: file-like) +The e2fsprogs package to use, used for resizing ext2, ext3, and ext4 +file systems. + +@item @code{btrfs-progs} (default: @code{btrfs-progs}) (type: file-like) +The btrfs-progs package to use, used for resizing the btrfs file system. + +@item @code{bcachefs-tools} (default: @code{bcachefs-tools}) (type: file-like) +The bcachefs-tools package to use, used for resizing the bcachefs file system. + +@end table + @cindex Backup @subsubheading Backup Services diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 24ff659a01..f754012e1e 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -3,6 +3,8 @@ ;;; Copyright © 2016-2023 Ludovic Courtès ;;; Copyright © 2020 Brice Waegeneire ;;; Copyright © 2023 Giacomo Leidi +;;; Copyright © 2024 Gabriel Wicki +;;; Copyright © 2024 Richard Sent ;;; ;;; This file is part of GNU Guix. ;;; @@ -20,11 +22,15 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu services admin) + #:use-module (gnu system file-systems) #:use-module (gnu packages admin) #:use-module ((gnu packages base) #:select (canonical-package findutils coreutils sed)) + #:use-module (gnu packages file-systems) #:use-module (gnu packages certs) + #:use-module (gnu packages disk) #:use-module (gnu packages package-management) + #:use-module (gnu packages linux) #:use-module (gnu services) #:use-module (gnu services configuration) #:use-module (gnu services mcron) @@ -93,7 +99,18 @@ (define-module (gnu services admin) unattended-upgrade-configuration-services-to-restart unattended-upgrade-configuration-system-expiration unattended-upgrade-configuration-maximum-duration - unattended-upgrade-configuration-log-file)) + unattended-upgrade-configuration-log-file + + unattended-upgrade-configuration-log-file + + resize-fs-configuration + resize-fs-configuration? + resize-fs-configuration-parted + resize-fs-configuration-e2fsprogs + resize-fs-configuration-device + resize-fs-configuration-partition + resize-fs-configuration-end + resize-fs-service-type)) ;;; Commentary: ;;; @@ -550,4 +567,120 @@ (define unattended-upgrade-service-type "Periodically upgrade the system from the current configuration.") (default-value (unattended-upgrade-configuration)))) +;;; +;;; Resize file system. +;;; + +(define-record-type* + resize-fs-configuration make-resize-fs-configuration + resize-fs-configuration? + (file-system resize-fs-file-system + (default #f)) + (cloud-utils resize-fs-cloud-utils + (default cloud-utils)) + (e2fsprogs resize-fs-e2fsprogs + (default e2fsprogs)) + (btrfs-progs resize-fs-btrfs-progs + (default btrfs-progs)) + (bcachefs-tools resize-fs-bcachefs-tools + (default bcachefs-tools))) + +(define (resize-fs-shepherd-service config) + "Returns a for resize-fs-service for CONFIG." + (match-record config + (file-system cloud-utils e2fsprogs btrfs-progs + bcachefs-tools) + (let ((fs-spec (file-system->spec file-system))) + (shepherd-service + (documentation "Resize a file system. Intended for Guix Systems that +are booted from a system image flashed onto a larger medium.") + ;; XXX: This could be extended with file-system info. + (provision '(resize-fs)) + (requirement '(user-processes)) + (one-shot? #t) + (respawn? #f) + (modules '((guix build utils) + (gnu build file-systems) + (gnu system file-systems) + (ice-9 control) + (ice-9 match) + (ice-9 ftw) + (ice-9 rdelim) + (srfi srfi-34))) + (start (with-imported-modules (source-module-closure + '((guix build utils) + (gnu build file-systems) + (gnu system file-systems))) + #~(lambda _ + (use-modules (guix build utils) + (gnu build file-systems) + (gnu system file-systems) + (ice-9 control) + (ice-9 match) + (ice-9 ftw) + (ice-9 rdelim) + (srfi srfi-34)) + + (define file-system + (spec->file-system '#$fs-spec)) + + ;; Shepherd recommends the start constructor takes <1 + ;; minute, canonicalize-device-spec will hang for up to + ;; max-trials seconds (20 seconds) if an invalid device is + ;; connected. Revisit this if max-trials increases. + (define device (canonicalize-device-spec + (file-system-device file-system))) + + (define grow-partition-command + (let* ((sysfs-device + (string-append "/sys/class/block/" + (basename device))) + (partition-number + (with-input-from-file + (string-append sysfs-device + "/partition") + read-line)) + (parent (string-append + "/dev/" + (basename (dirname (readlink sysfs-device)))))) + (list #$(file-append cloud-utils "/bin/growpart") + parent partition-number))) + + (define grow-filesystem-command + (match (file-system-type file-system) + ((or "ext2" "ext3" "ext4") + (list #$(file-append e2fsprogs "/sbin/resize2fs") device)) + ("btrfs" + (list #$(file-append btrfs-progs "/bin/btrfs") + "filesystem" "resize" device)) + ("bcachefs" + (list #$(file-append bcachefs-tools "/sbin/bcachefs") + "device" "resize" device)) + (e (error "Unsupported filesystem type" e)))) + + (let/ec return + (guard (c ((and (invoke-error? c) + ;; growpart NOCHANGE exits with 1. It is + ;; unlikely the partition was resized + ;; while the file system was not. Just + ;; exit. + (equal? (invoke-error-exit-status c) 1)) + (format (current-error-port) + "The device ~a is already resized.~%" device) + ;; Must return something or Shepherd considers + ;; the service perpetually starting. + (return 0))) + (apply invoke grow-partition-command)) + (apply invoke grow-filesystem-command))))))))) + +(define resize-fs-service-type + (service-type + (name 'resize-fs) + (description "Resize a partition during boot.") + (extensions + (list + (service-extension shepherd-root-service-type + (compose list resize-fs-shepherd-service)))) + (default-value (resize-fs-configuration)))) + ;;; admin.scm ends here -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 12 15:19:38 2024 Received: (at 74837) by debbugs.gnu.org; 12 Dec 2024 20:19:38 +0000 Received: from localhost ([127.0.0.1]:40479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLpeq-0006ol-Ou for submit@debbugs.gnu.org; Thu, 12 Dec 2024 15:19:37 -0500 Received: from mail-108-mta213.mxroute.com ([136.175.108.213]:37053) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLpel-0006oO-Hs for 74837@debbugs.gnu.org; Thu, 12 Dec 2024 15:19:32 -0500 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta213.mxroute.com (ZoneMTA) with ESMTPSA id 193bc86caca0003e01.001 for <74837@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 12 Dec 2024 20:19:30 +0000 X-Zone-Loop: d0e2ce9a4cc0c6c48005450484219a85f991ebaf9375 X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=y4im5OULdk8tPQVJLzXeBnE8NZHSprmVT4khLs0QzkE=; b=W7oefa2MUppWPCMCxDKYQRsxHo AxLg1PizWdXFr4YnTaU3l6rJpaTalaMt/LKlGrQYqf0L80IRQJy34+mR1AVY3VHnzjeYyI2tYzgtU MWHM30ufG0USFnnxOkwDGCJYPY8E0ObHmpqhfIuXKsHVbb/OKgG89XrQyYR7hskH3Gb6uhOYw0d6C lklJ8Z2QC5+XA91z58J9URqJk+ngjJsXZwfCQlLztHv3/YfdvJhNbbo+lvgebYW0h4OOA8tg3zFHM zH5JDgoguK94R/dcl2yhiuPL4LSQ2e50oYC2TuPp0eWWS0rJs6TfZtT4cuPBuJHuWTeeh04kuXZdK SbbcBoJw==; From: Richard Sent To: 74837@debbugs.gnu.org Subject: [PATCH 2/2] packages: cloud-utils: Add missing growpart programs to path. Date: Thu, 12 Dec 2024 15:19:00 -0500 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Sharlatan Hellseher Content-Transfer-Encoding: 8bit X-Authenticated-Id: richard@freakingpenguin.com X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74837 Cc: Richard Sent , Gabriel Wicki X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This fixes a bug in resize-fs-service. * gnu/packages/admin.scm (cloud-utils): Augment growpart PATH with necessary programs. Change-Id: Idf0ca9e14e4c9d82208fbf715dd0b235cd5a371b --- gnu/packages/admin.scm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index b1889ceea0..d39bc5adc5 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -581,12 +581,21 @@ (define-public cloud-utils ,(map dirname (map (cut search-input-file inputs <>) (list "bin/readlink" - "sbin/sfdisk"))))))))))) + "sbin/sfdisk" + "bin/sed" + "bin/grep" + "bin/awk" + "bin/udevadm" + "bin/flock"))))))))))) (inputs (list bash-minimal ;for wrap-program - coreutils ;for readlink + coreutils ;for readlink and cat + sed ;growpart + grep ;growpart + gawk ;awk for growpart + eudev ;udevadm for growpart python - util-linux)) ;sfdisk for growpart + util-linux)) ;sfdisk, flock, partx, blkid for growpart (home-page "https://launchpad.net/cloud-utils") (synopsis "Set of utilities for cloud computing environments") (description -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 12 16:16:18 2024 Received: (at 74837) by debbugs.gnu.org; 12 Dec 2024 21:16:18 +0000 Received: from localhost ([127.0.0.1]:40632 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLqXh-0001Mg-0A for submit@debbugs.gnu.org; Thu, 12 Dec 2024 16:16:17 -0500 Received: from mail-108-mta37.mxroute.com ([136.175.108.37]:42887) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLqXe-0001MT-7I for 74837@debbugs.gnu.org; Thu, 12 Dec 2024 16:16:15 -0500 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta37.mxroute.com (ZoneMTA) with ESMTPSA id 193bcbaa7ca0003e01.001 for <74837@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 12 Dec 2024 21:16:09 +0000 X-Zone-Loop: 3ff90068f8033d37c106d1cf9ec02cceb6f500cdd996 X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Qdj4HAps9/bic2JSPfZc/7SNVFD/KHThdn5f6oI0eeQ=; b=evRgTh/cpa9f3GElbvt6VXeauO SaZe/g9R4LRgd0h4FJVKMuQCPGlS9nPuAW1rGq35nYZ1MjDaiiospcKzm/IrNj2MDBDV8wC4HlS71 8N3LVWJNXTimE0zTTnbBO/fNwG+Ul/KyIgZ/wQuboEs5Y/eSG4XyVdwvIoiZaWuYc1FxLP6jPbvns NHBYF+ABFrWKc2TkxLx4Tg2Iw9oy7eR3+WMQaby8e2aKAJfXCMI3IJVfqj/6FBjiuX2Fisx+CqOxM HSvmu5r1DdFy1rcwRLKCMC/Xl+WiHozXufVO23F+BKTDp/IG1QosCfI34i5V5r7Oq7Fzmy9tC91xW gO/3wxKQ==; From: Richard Sent To: 74837@debbugs.gnu.org Subject: [PATCH v2 1/2] gnu: services: Add resize-fs-service. Date: Thu, 12 Dec 2024 16:15:29 -0500 Message-ID: <472c97dc7cb15bc73e93576868d4da8517d2ddb5.1734038130.git.richard@freakingpenguin.com> MIME-Version: 1.0 X-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Authenticated-Id: richard@freakingpenguin.com X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74837 Cc: Richard Sent X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/services/admin.scm (resize-fs-configuration): New configuration type. (resize-fs-shepherd-service): New procedure. (resize-fs-service-type): New variable. * doc/guix.texi (Miscallaneous Services): Document it. Change-Id: Icae2fefc9a8d936d4c3add47520258b341f689a4 --- Fixing up the export list. doc/guix.texi | 50 ++++++++++++++++ gnu/services/admin.scm | 133 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 182 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index a2915de954..5636eb23fb 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -41891,6 +41891,56 @@ Miscellaneous Services @c End of auto-generated fail2ban documentation. +@cindex resize-fs +@subsubheading Resize File System service + +This service type lets you resize a live file system during boot, which +can be convenient if a Guix image is flashed on an SD Card (e.g. for an +embedded device) or uploaded to a VPS. In both cases the medium the +image will reside upon may be larger than the image you want to produce. + +For an embedded device booting from an SD card you may use something like: +@lisp +(service resize-fs-service-type + (resize-fs-configuration + (file-system + (device (file-system-label "root")) + (type "ext4")))) +@end lisp + +Be extra cautious to use the correct device and type. The service has +little error handling of its own and relies on the underlying tools. +Wrong use could end in loss of data or the corruption of the operating +system. + +Partitions and file systems are grown to the maximum size available. +File systems can only grow when they are on the last partition on a +device and have empty space available. + +This service supports the ext2, ext3, ext4, btrfs, and bcachefs file +systems. + +@table @asis + +@item @code{file-system} (default: @code{#f}) (type: file-system) +The file-system object to resize. This object must have the device and +type fields set. The others are ignored. + +@item @code{cloud-utils} (default: @code{cloud-utils}) (type: file-like) +The cloud-utils package to use. + +@item @code{e2fsprogs} (default: @code{e2fsprogs}) (type: file-like) +The e2fsprogs package to use, used for resizing ext2, ext3, and ext4 +file systems. + +@item @code{btrfs-progs} (default: @code{btrfs-progs}) (type: file-like) +The btrfs-progs package to use, used for resizing the btrfs file system. + +@item @code{bcachefs-tools} (default: @code{bcachefs-tools}) (type: file-like) +The bcachefs-tools package to use, used for resizing the bcachefs file system. + +@end table + @cindex Backup @subsubheading Backup Services diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 24ff659a01..a92b3b0ecc 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -3,6 +3,8 @@ ;;; Copyright © 2016-2023 Ludovic Courtès ;;; Copyright © 2020 Brice Waegeneire ;;; Copyright © 2023 Giacomo Leidi +;;; Copyright © 2024 Gabriel Wicki +;;; Copyright © 2024 Richard Sent ;;; ;;; This file is part of GNU Guix. ;;; @@ -20,11 +22,15 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu services admin) + #:use-module (gnu system file-systems) #:use-module (gnu packages admin) #:use-module ((gnu packages base) #:select (canonical-package findutils coreutils sed)) + #:use-module (gnu packages file-systems) #:use-module (gnu packages certs) + #:use-module (gnu packages disk) #:use-module (gnu packages package-management) + #:use-module (gnu packages linux) #:use-module (gnu services) #:use-module (gnu services configuration) #:use-module (gnu services mcron) @@ -93,7 +99,16 @@ (define-module (gnu services admin) unattended-upgrade-configuration-services-to-restart unattended-upgrade-configuration-system-expiration unattended-upgrade-configuration-maximum-duration - unattended-upgrade-configuration-log-file)) + unattended-upgrade-configuration-log-file + + resize-fs-service-type + resize-fs-configuration + resize-fs-configuration? + resize-fs-configuration-file-system + resize-fs-configuration-cloud-utils + resize-fs-configuration-e2fsprogs + resize-fs-configuration-btrfs-progs + resize-fs-configuration-bcachefs-tools)) ;;; Commentary: ;;; @@ -550,4 +565,120 @@ (define unattended-upgrade-service-type "Periodically upgrade the system from the current configuration.") (default-value (unattended-upgrade-configuration)))) +;;; +;;; Resize file system. +;;; + +(define-record-type* + resize-fs-configuration make-resize-fs-configuration + resize-fs-configuration? + (file-system resize-fs-file-system + (default #f)) + (cloud-utils resize-fs-cloud-utils + (default cloud-utils)) + (e2fsprogs resize-fs-e2fsprogs + (default e2fsprogs)) + (btrfs-progs resize-fs-btrfs-progs + (default btrfs-progs)) + (bcachefs-tools resize-fs-bcachefs-tools + (default bcachefs-tools))) + +(define (resize-fs-shepherd-service config) + "Returns a for resize-fs-service for CONFIG." + (match-record config + (file-system cloud-utils e2fsprogs btrfs-progs + bcachefs-tools) + (let ((fs-spec (file-system->spec file-system))) + (shepherd-service + (documentation "Resize a file system. Intended for Guix Systems that +are booted from a system image flashed onto a larger medium.") + ;; XXX: This could be extended with file-system info. + (provision '(resize-fs)) + (requirement '(user-processes)) + (one-shot? #t) + (respawn? #f) + (modules '((guix build utils) + (gnu build file-systems) + (gnu system file-systems) + (ice-9 control) + (ice-9 match) + (ice-9 ftw) + (ice-9 rdelim) + (srfi srfi-34))) + (start (with-imported-modules (source-module-closure + '((guix build utils) + (gnu build file-systems) + (gnu system file-systems))) + #~(lambda _ + (use-modules (guix build utils) + (gnu build file-systems) + (gnu system file-systems) + (ice-9 control) + (ice-9 match) + (ice-9 ftw) + (ice-9 rdelim) + (srfi srfi-34)) + + (define file-system + (spec->file-system '#$fs-spec)) + + ;; Shepherd recommends the start constructor takes <1 + ;; minute, canonicalize-device-spec will hang for up to + ;; max-trials seconds (20 seconds) if an invalid device is + ;; connected. Revisit this if max-trials increases. + (define device (canonicalize-device-spec + (file-system-device file-system))) + + (define grow-partition-command + (let* ((sysfs-device + (string-append "/sys/class/block/" + (basename device))) + (partition-number + (with-input-from-file + (string-append sysfs-device + "/partition") + read-line)) + (parent (string-append + "/dev/" + (basename (dirname (readlink sysfs-device)))))) + (list #$(file-append cloud-utils "/bin/growpart") + parent partition-number))) + + (define grow-filesystem-command + (match (file-system-type file-system) + ((or "ext2" "ext3" "ext4") + (list #$(file-append e2fsprogs "/sbin/resize2fs") device)) + ("btrfs" + (list #$(file-append btrfs-progs "/bin/btrfs") + "filesystem" "resize" device)) + ("bcachefs" + (list #$(file-append bcachefs-tools "/sbin/bcachefs") + "device" "resize" device)) + (e (error "Unsupported filesystem type" e)))) + + (let/ec return + (guard (c ((and (invoke-error? c) + ;; growpart NOCHANGE exits with 1. It is + ;; unlikely the partition was resized + ;; while the file system was not. Just + ;; exit. + (equal? (invoke-error-exit-status c) 1)) + (format (current-error-port) + "The device ~a is already resized.~%" device) + ;; Must return something or Shepherd considers + ;; the service perpetually starting. + (return 0))) + (apply invoke grow-partition-command)) + (apply invoke grow-filesystem-command))))))))) + +(define resize-fs-service-type + (service-type + (name 'resize-fs) + (description "Resize a partition during boot.") + (extensions + (list + (service-extension shepherd-root-service-type + (compose list resize-fs-shepherd-service)))) + (default-value (resize-fs-configuration)))) + ;;; admin.scm ends here base-commit: a9003b8e6b40b59c9545ae87bb441d3549630db7 -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 12 16:16:43 2024 Received: (at 74837) by debbugs.gnu.org; 12 Dec 2024 21:16:43 +0000 Received: from [127.0.0.1] (port=40634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLqXr-0001Mx-J7 for submit@debbugs.gnu.org; Thu, 12 Dec 2024 16:16:42 -0500 Received: from mail-108-mta2.mxroute.com ([136.175.108.2]:39935) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLqXe-0001MS-J0 for 74837@debbugs.gnu.org; Thu, 12 Dec 2024 16:16:20 -0500 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta2.mxroute.com (ZoneMTA) with ESMTPSA id 193bcbaa7410003e01.001 for <74837@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 12 Dec 2024 21:16:09 +0000 X-Zone-Loop: bc36a82e27c9dce815e476a0aaf567337c48faa50af0 X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=y4im5OULdk8tPQVJLzXeBnE8NZHSprmVT4khLs0QzkE=; b=XkfIwMWBxXBa8WnIx5xS6QjdWF RLC8WapEHjOm7ZmSYbuaePup/EtCwOHrOW3kSvHI9IC+k4i0/O9ZWa9lwj6hgoLxLmv4Y9m0agw94 i/htFj9IFvk0i22kBHHtF6Q0i+XjCUmX5hnpIxZnKyk0ZhX1muvu6syIC1G6OvV2PdoT0LS2K6kWs +2HzJ+OvZVVuFPCwV40cbNAlL4CZcFX5ip8Zoq1oJDhmIzYj0Nn8y+to/0qvBj7pjgd6rYVarmLdl u15HSQFZ6xj57KGCYxrQ+ygMLn7IOinIdxlr/TN9hfM47XATUe/IaYG0NLvWu4NDtHvefA6NKKJDu 7bapgkrA==; From: Richard Sent To: 74837@debbugs.gnu.org Subject: [PATCH v2 2/2] packages: cloud-utils: Add missing growpart programs to path. Date: Thu, 12 Dec 2024 16:15:30 -0500 Message-ID: <008d0d97f9e1546cf84d1e859e5cf68e02331837.1734038130.git.richard@freakingpenguin.com> In-Reply-To: <472c97dc7cb15bc73e93576868d4da8517d2ddb5.1734038130.git.richard@freakingpenguin.com> References: <472c97dc7cb15bc73e93576868d4da8517d2ddb5.1734038130.git.richard@freakingpenguin.com> MIME-Version: 1.0 X-Debbugs-Cc: Sharlatan Hellseher Content-Transfer-Encoding: 8bit X-Authenticated-Id: richard@freakingpenguin.com X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74837 Cc: Richard Sent X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This fixes a bug in resize-fs-service. * gnu/packages/admin.scm (cloud-utils): Augment growpart PATH with necessary programs. Change-Id: Idf0ca9e14e4c9d82208fbf715dd0b235cd5a371b --- gnu/packages/admin.scm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index b1889ceea0..d39bc5adc5 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -581,12 +581,21 @@ (define-public cloud-utils ,(map dirname (map (cut search-input-file inputs <>) (list "bin/readlink" - "sbin/sfdisk"))))))))))) + "sbin/sfdisk" + "bin/sed" + "bin/grep" + "bin/awk" + "bin/udevadm" + "bin/flock"))))))))))) (inputs (list bash-minimal ;for wrap-program - coreutils ;for readlink + coreutils ;for readlink and cat + sed ;growpart + grep ;growpart + gawk ;awk for growpart + eudev ;udevadm for growpart python - util-linux)) ;sfdisk for growpart + util-linux)) ;sfdisk, flock, partx, blkid for growpart (home-page "https://launchpad.net/cloud-utils") (synopsis "Set of utilities for cloud computing environments") (description -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 14 10:23:51 2024 Received: (at 74837) by debbugs.gnu.org; 14 Dec 2024 15:23:51 +0000 Received: from localhost ([127.0.0.1]:48008 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMTzc-0007SD-Ql for submit@debbugs.gnu.org; Sat, 14 Dec 2024 10:23:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56804) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMTzZ-0007Ru-Ja for 74837@debbugs.gnu.org; Sat, 14 Dec 2024 10:23:42 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMTzU-0006JJ-6c; Sat, 14 Dec 2024 10:23:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=Vcitba0pcFgHwuJUe+wEoXF6ux3Jt53ZKRCcPPleQhY=; b=cB8cJN973fc0uyeE2AM/ N99DYPXRxIEjQwRM8uzmkg9E9Ns/3wywIurITTzycqqNCt18fy4JKmr5pINL8Ga3UCX+T3pATukgm UEbJysIMktdZ2mSL/hXwZwNwiTlhH5C/yRluJqNQEjv798fi8F6pn30hHgtb/AJo3jIHchlaGZkFs mWCtsmyD/nTzEJsdZsP8uAD5MMKigVYv2j9nbXyVuzqfhV4QVeyL/c3jc20ij8ptPljR99YwfjkNG ms8f2xviS21eh0OQ4129EwGgEj1M96dlR0ZkRnvq3apfdLOB86x07LCyjzn8cel7gDnZ3ZBbWcyDn MPVaCE2NSWdZ1Q==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Richard Sent Subject: Re: [bug#74837] [PATCH v2 1/2] gnu: services: Add resize-fs-service. In-Reply-To: <472c97dc7cb15bc73e93576868d4da8517d2ddb5.1734038130.git.richard@freakingpenguin.com> (Richard Sent's message of "Thu, 12 Dec 2024 16:15:29 -0500") References: <472c97dc7cb15bc73e93576868d4da8517d2ddb5.1734038130.git.richard@freakingpenguin.com> Date: Sat, 14 Dec 2024 16:23:27 +0100 Message-ID: <874j36mgpc.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74837 Cc: Maxim Cournoyer , 74837@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello, Richard Sent skribis: > * gnu/services/admin.scm (resize-fs-configuration): New configuration > type. > (resize-fs-shepherd-service): New procedure. > (resize-fs-service-type): New variable. > * doc/guix.texi (Miscallaneous Services): Document it. > > Change-Id: Icae2fefc9a8d936d4c3add47520258b341f689a4 Nice! Overall LGTM. Minor comments below. > +@subsubheading Resize File System service > + > +This service type lets you resize a live file system during boot, which > +can be convenient if a Guix image is flashed on an SD Card (e.g. for an > +embedded device) or uploaded to a VPS. In both cases the medium the > +image will reside upon may be larger than the image you want to produce. > + > +For an embedded device booting from an SD card you may use something lik= e: > +@lisp > +(service resize-fs-service-type > + (resize-fs-configuration > + (file-system > + (device (file-system-label "root")) > + (type "ext4")))) > +@end lisp I would avoid abbreviations as usual and go for =E2=80=98file-system-resizing-service-type=E2=80=99. WDYT? > +Be extra cautious to use the correct device and type. The service has > +little error handling of its own and relies on the underlying tools. > +Wrong use could end in loss of data or the corruption of the operating > +system. Maybe wrap this paragraph in =E2=80=9C@quotation Warning=E2=80=9D. > +@item @code{file-system} (default: @code{#f}) (type: file-system) > +The file-system object to resize. This object must have the device and ^ Maybe add =E2=80=9C(@pxref{File Systems})=E2=80=9D. > +type fields set. The others are ignored. =E2=80=9Cthe @code{device} and @code{type} fields set. Other fields are ignored.=E2=80=9D > +@item @code{cloud-utils} (default: @code{cloud-utils}) (type: file-like) > +The cloud-utils package to use. Maybe add a sentence explaining that =E2=80=98cloud-utils=E2=80=99 is used = for its =E2=80=98growpart=E2=80=99 command. I wonder if Guile-Parted could be used instead of =E2=80=98growpart=E2=80= =99 (shouldn=E2=80=99t be a blocker though). > + (let/ec return > + (guard (c ((and (invoke-error? c) > + ;; growpart NOCHANGE exits with 1.= It is > + ;; unlikely the partition was resi= zed > + ;; while the file system was not. = Just > + ;; exit. > + (equal? (invoke-error-exit-status = c) 1)) > + (format (current-error-port) > + "The device ~a is already resiz= ed.~%" device) > + ;; Must return something or Shepherd co= nsiders > + ;; the service perpetually starting. > + (return 0))) > + (apply invoke grow-partition-command)) > + (apply invoke grow-filesystem-command))))))))) No need for =E2=80=98let/ec=E2=80=99 here, you can just return from the =E2= =80=98guard=E2=80=99 handler. The second patch LGTM, though perhaps it should come before this patch since it fixes something that the resize service needs. Could you send updated patches? Thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 14 16:35:51 2024 Received: (at 74837) by debbugs.gnu.org; 14 Dec 2024 21:35:51 +0000 Received: from localhost ([127.0.0.1]:48607 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMZnj-00010y-A3 for submit@debbugs.gnu.org; Sat, 14 Dec 2024 16:35:51 -0500 Received: from mail-108-mta68.mxroute.com ([136.175.108.68]:43317) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMZng-00010o-I5 for 74837@debbugs.gnu.org; Sat, 14 Dec 2024 16:35:49 -0500 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta68.mxroute.com (ZoneMTA) with ESMTPSA id 193c71955d20003e01.001 for <74837@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sat, 14 Dec 2024 21:35:46 +0000 X-Zone-Loop: 53f995a4adf7e929b8417eaa86582b4a0bd4d50ba2d5 X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=5ji+rAeJDqUJSqdYMHAwSkxR6sRU4ZPTBsb6hVImEf0=; b=EP9UqrqnWu+PeSsEVRMXZoxcGv Q6dnq0kiqLkzlMFLUvQ+mO//ak+Uz2MH82bRBOxg9Wvm6TkkxqZ9q5jVifEU5NbCyia0FmYqZ0tdK f+Ab+ZLe64cfSXjA46fsiAIfPLltCcDtVMl+mVZaYY2rtTOJ7ZJZ+QGsdg8lovaKNGWDMWCMOI63H K4/BeFIXuY3Br4RzkDGxjGS9I0+Sv6pWuJ3f6YmWzzbjWleAFD2TL1+PdKIdFsfbCnya6ehbQDkfE iMxBvD9dsQKl/Ezo6QPdDMH30VZc0rJ5THAjKYHCnxIMv8KxgV8iUzo7PO/hGHnJZktf0n8wyxDSi GmfUnHxQ==; From: Richard Sent To: 74837@debbugs.gnu.org Subject: [PATCH v3 0/2] resize-file-system-service Date: Sat, 14 Dec 2024 16:18:21 -0500 Message-ID: MIME-Version: 1.0 X-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Authenticated-Id: richard@freakingpenguin.com X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74837 Cc: Richard Sent X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > I would avoid abbreviations as usual and go for > ‘file-system-resizing-service-type’. WDYT? Sounds good to me. > I wonder if Guile-Parted could be used instead of ‘growpart’ (shouldn’t > be a blocker though). This is an interesting idea. parted can tell us the file system type at runtime, reducing the amount of information the user needs to provide (at the cost of not catching invalid file-system-type values at build-time.) > No need for ‘let/ec’ here, you can just return from the ‘guard’ handler. What would that look like? We don't want to capture an error in grow-filesystem-command with an exit-status of 1, so it lives outside the guard, and we don't want to raise an exception if the partition was already resized. (Side note, should Shepherd consider a service perpetually starting if the start constructor exits without returning a value?) V3 should have all other feedback implemented. Richard Sent (2): packages: cloud-utils: Add missing growpart programs to path. gnu: services: Add resize-file-system-service. doc/guix.texi | 54 +++++++++++++++++ gnu/packages/admin.scm | 15 ++++- gnu/services/admin.scm | 133 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 198 insertions(+), 4 deletions(-) base-commit: 0787a180b3ca64d3958438920ca1b58a2a27fba4 -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 14 16:35:55 2024 Received: (at 74837) by debbugs.gnu.org; 14 Dec 2024 21:35:55 +0000 Received: from localhost ([127.0.0.1]:48610 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMZnm-00011E-Nz for submit@debbugs.gnu.org; Sat, 14 Dec 2024 16:35:55 -0500 Received: from mail-108-mta145.mxroute.com ([136.175.108.145]:34843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMZni-00010p-Sv for 74837@debbugs.gnu.org; Sat, 14 Dec 2024 16:35:51 -0500 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta145.mxroute.com (ZoneMTA) with ESMTPSA id 193c719593f0003e01.001 for <74837@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sat, 14 Dec 2024 21:35:47 +0000 X-Zone-Loop: 1a43edf5a32d7479dc4012180b002b34ead9272b1f39 X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=jgFpGQSvzQfbU1GOyo7XHeiORmcFd82Cb9Ue1E7DAzU=; b=WIaE0CWoqh+SCOXOJuFKs13xxP VVwxIL4jwEA6BvFmNhPsB+yGWo3EzAnDv3OOIi2+7iAwDNC9ZrZkoAbIGTKpDVQOJz2WdlKaCB7VG SPjDDYJLr5oiCcxF9TtcN50U+Hp9V7BrhP9A+7pagvsmcWuMjSbFVgoFeWwjkOL+H6SRLnfEXttYf IbyGD2qciWpSVVlHxXC8eCqpQE3gY8PDPgZOs75EcKkfzQELspCT0On/IIaX/OM6GbKhdda/tsrpd JapNov7AApwuMvL503wR8Es9oP+4F+7sBE6X/AsCF2pxKPH5E82TheZsLy+Lkz235Kct6YZmE3RJ7 TFLd+C7A==; From: Richard Sent To: 74837@debbugs.gnu.org Subject: [PATCH v3 1/2] packages: cloud-utils: Add missing growpart programs to path. Date: Sat, 14 Dec 2024 16:18:22 -0500 Message-ID: <449186592c56a84bd3bb02e26464fbcf8adea3d6.1734211103.git.richard@freakingpenguin.com> In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Sharlatan Hellseher Content-Transfer-Encoding: 8bit X-Authenticated-Id: richard@freakingpenguin.com X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74837 Cc: Richard Sent X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This ensures growpart can run in environments that may not have a PATH variable set. * gnu/packages/admin.scm (cloud-utils): Augment growpart PATH with necessary programs. Change-Id: Idf0ca9e14e4c9d82208fbf715dd0b235cd5a371b --- gnu/packages/admin.scm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index b1889ceea0..d39bc5adc5 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -581,12 +581,21 @@ (define-public cloud-utils ,(map dirname (map (cut search-input-file inputs <>) (list "bin/readlink" - "sbin/sfdisk"))))))))))) + "sbin/sfdisk" + "bin/sed" + "bin/grep" + "bin/awk" + "bin/udevadm" + "bin/flock"))))))))))) (inputs (list bash-minimal ;for wrap-program - coreutils ;for readlink + coreutils ;for readlink and cat + sed ;growpart + grep ;growpart + gawk ;awk for growpart + eudev ;udevadm for growpart python - util-linux)) ;sfdisk for growpart + util-linux)) ;sfdisk, flock, partx, blkid for growpart (home-page "https://launchpad.net/cloud-utils") (synopsis "Set of utilities for cloud computing environments") (description -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 14 16:35:58 2024 Received: (at 74837) by debbugs.gnu.org; 14 Dec 2024 21:35:58 +0000 Received: from localhost ([127.0.0.1]:48612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMZnp-00011V-Cd for submit@debbugs.gnu.org; Sat, 14 Dec 2024 16:35:58 -0500 Received: from mail-108-mta135.mxroute.com ([136.175.108.135]:41651) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMZnm-00011B-4p for 74837@debbugs.gnu.org; Sat, 14 Dec 2024 16:35:55 -0500 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta135.mxroute.com (ZoneMTA) with ESMTPSA id 193c719623c0003e01.001 for <74837@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sat, 14 Dec 2024 21:35:49 +0000 X-Zone-Loop: 26fec4fc7565e8e4b28944f7f2f85eb805af36fb5ba7 X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=l3uvQNvWFqWfshxw9qgbCR8vwJS5olGAtbEhgceSMD8=; b=NRJedDfce3pVDNjXYSJP64h0Gx iRpO6vzSQ9PnDQX9YCnbgS/EgXpZZsHskAZ0xVezsmGyVN9gKELxO/2CfUw4yJbpHyeuTXZ8qQtrs yoSAQDqSUEgZ1MYvvJsejMCkl0ISpOWMuXSGSZ7tpPUm+1engMyuzCi4CkrNyDit7nVoepe54ou2A d3keG+17LXrraT47KSyvkEKy42S4Co+CpLxrJuff3CJCgiVmaruBnJXate3NvjsCaBEC6jhw8ejNN 2USFwtDtZuU/ZPfe7jgPdRmBxEJWa4Hxaoc6kOA1bQ/KU+QF3BZEejzSU/BQti04MRZElwh2RnaeA S5xpf56Q==; From: Richard Sent To: 74837@debbugs.gnu.org Subject: [PATCH v3 2/2] gnu: services: Add resize-file-system-service. Date: Sat, 14 Dec 2024 16:18:23 -0500 Message-ID: <7dfc8384a8e73be14ae385b0761bd3f4280f405a.1734211103.git.richard@freakingpenguin.com> In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Authenticated-Id: richard@freakingpenguin.com X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74837 Cc: Richard Sent X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/services/admin.scm (resize-file-system-configuration): New configuration type. (resize-file-system-shepherd-service): New procedure. (resize-file-system-service-type): New variable. * doc/guix.texi (Miscallaneous Services): Document it. Change-Id: Icae2fefc9a8d936d4c3add47520258b341f689a4 --- doc/guix.texi | 54 +++++++++++++++++ gnu/services/admin.scm | 133 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 186 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index a2915de954..cc19fb6cff 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -41891,6 +41891,60 @@ Miscellaneous Services @c End of auto-generated fail2ban documentation. +@cindex resize-file-system +@subsubheading Resize File System Service + +This service type lets you resize a live file system during boot, which +can be convenient if a Guix image is flashed on an SD Card (e.g. for an +embedded device) or uploaded to a VPS. In both cases the medium the +image will reside upon may be larger than the image you want to produce. + +For an embedded device booting from an SD card you may use something like: +@lisp +(service resize-file-system-service-type + (resize-file-system-configuration + (file-system + (file-system (device (file-system-label "root")) + (type "ext4"))))) +@end lisp + +@quotation Warning +Be extra cautious to use the correct device and type. The service has +little error handling of its own and relies on the underlying tools. +Wrong use could end in loss of data or the corruption of the operating +system. +@end quotation + +Partitions and file systems are grown to the maximum size available. +File systems can only grow when they are on the last partition on a +device and have empty space available. + +This service supports the ext2, ext3, ext4, btrfs, and bcachefs file +systems. + +@table @asis + +@item @code{file-system} (default: @code{#f}) (type: file-system) +The file-system object to resize (@pxref{File Systems}). This object +must have the @code{device} and @code{type} fields set. Other fields +are ignored. + +@item @code{cloud-utils} (default: @code{cloud-utils}) (type: file-like) +The cloud-utils package to use. This package is used for the +@code{growpart} command. + +@item @code{e2fsprogs} (default: @code{e2fsprogs}) (type: file-like) +The e2fsprogs package to use, used for resizing ext2, ext3, and ext4 +file systems. + +@item @code{btrfs-progs} (default: @code{btrfs-progs}) (type: file-like) +The btrfs-progs package to use, used for resizing the btrfs file system. + +@item @code{bcachefs-tools} (default: @code{bcachefs-tools}) (type: file-like) +The bcachefs-tools package to use, used for resizing the bcachefs file system. + +@end table + @cindex Backup @subsubheading Backup Services diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 24ff659a01..4a2f5cb12d 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -3,6 +3,8 @@ ;;; Copyright © 2016-2023 Ludovic Courtès ;;; Copyright © 2020 Brice Waegeneire ;;; Copyright © 2023 Giacomo Leidi +;;; Copyright © 2024 Gabriel Wicki +;;; Copyright © 2024 Richard Sent ;;; ;;; This file is part of GNU Guix. ;;; @@ -20,11 +22,15 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu services admin) + #:use-module (gnu system file-systems) #:use-module (gnu packages admin) #:use-module ((gnu packages base) #:select (canonical-package findutils coreutils sed)) + #:use-module (gnu packages file-systems) #:use-module (gnu packages certs) + #:use-module (gnu packages disk) #:use-module (gnu packages package-management) + #:use-module (gnu packages linux) #:use-module (gnu services) #:use-module (gnu services configuration) #:use-module (gnu services mcron) @@ -93,7 +99,16 @@ (define-module (gnu services admin) unattended-upgrade-configuration-services-to-restart unattended-upgrade-configuration-system-expiration unattended-upgrade-configuration-maximum-duration - unattended-upgrade-configuration-log-file)) + unattended-upgrade-configuration-log-file + + resize-file-system-service-type + resize-file-system-configuration + resize-file-system-configuration? + resize-file-system-configuration-file-system + resize-file-system-configuration-cloud-utils + resize-file-system-configuration-e2fsprogs + resize-file-system-configuration-btrfs-progs + resize-file-system-configuration-bcachefs-tools)) ;;; Commentary: ;;; @@ -550,4 +565,120 @@ (define unattended-upgrade-service-type "Periodically upgrade the system from the current configuration.") (default-value (unattended-upgrade-configuration)))) +;;; +;;; Resize file system. +;;; + +(define-record-type* + resize-file-system-configuration make-resize-file-system-configuration + resize-file-system-configuration? + (file-system resize-file-system-file-system + (default #f)) + (cloud-utils resize-file-system-cloud-utils + (default cloud-utils)) + (e2fsprogs resize-file-system-e2fsprogs + (default e2fsprogs)) + (btrfs-progs resize-file-system-btrfs-progs + (default btrfs-progs)) + (bcachefs-tools resize-file-system-bcachefs-tools + (default bcachefs-tools))) + +(define (resize-file-system-shepherd-service config) + "Returns a for resize-file-system-service for CONFIG." + (match-record config + (file-system cloud-utils e2fsprogs btrfs-progs + bcachefs-tools) + (let ((fs-spec (file-system->spec file-system))) + (shepherd-service + (documentation "Resize a file system. Intended for Guix Systems that +are booted from a system image flashed onto a larger medium.") + ;; XXX: This could be extended with file-system info. + (provision '(resize-file-system)) + (requirement '(user-processes)) + (one-shot? #t) + (respawn? #f) + (modules '((guix build utils) + (gnu build file-systems) + (gnu system file-systems) + (ice-9 control) + (ice-9 match) + (ice-9 ftw) + (ice-9 rdelim) + (srfi srfi-34))) + (start (with-imported-modules (source-module-closure + '((guix build utils) + (gnu build file-systems) + (gnu system file-systems))) + #~(lambda _ + (use-modules (guix build utils) + (gnu build file-systems) + (gnu system file-systems) + (ice-9 control) + (ice-9 match) + (ice-9 ftw) + (ice-9 rdelim) + (srfi srfi-34)) + + (define file-system + (spec->file-system '#$fs-spec)) + + ;; Shepherd recommends the start constructor takes <1 + ;; minute, canonicalize-device-spec will hang for up to + ;; max-trials seconds (20 seconds) if an invalid device is + ;; connected. Revisit this if max-trials increases. + (define device (canonicalize-device-spec + (file-system-device file-system))) + + (define grow-partition-command + (let* ((sysfs-device + (string-append "/sys/class/block/" + (basename device))) + (partition-number + (with-input-from-file + (string-append sysfs-device + "/partition") + read-line)) + (parent (string-append + "/dev/" + (basename (dirname (readlink sysfs-device)))))) + (list #$(file-append cloud-utils "/bin/growpart") + parent partition-number))) + + (define grow-filesystem-command + (match (file-system-type file-system) + ((or "ext2" "ext3" "ext4") + (list #$(file-append e2fsprogs "/sbin/resize2fs") device)) + ("btrfs" + (list #$(file-append btrfs-progs "/bin/btrfs") + "filesystem" "resize" device)) + ("bcachefs" + (list #$(file-append bcachefs-tools "/sbin/bcachefs") + "device" "resize" device)) + (e (error "Unsupported filesystem type" e)))) + + (let/ec return + (guard (c ((and (invoke-error? c) + ;; growpart NOCHANGE exits with 1. It is + ;; unlikely the partition was resized + ;; while the file system was not. Just + ;; exit. + (equal? (invoke-error-exit-status c) 1)) + (format (current-error-port) + "The device ~a is already resized.~%" device) + ;; Must return something or Shepherd considers + ;; the service perpetually starting. + (return 0))) + (apply invoke grow-partition-command)) + (apply invoke grow-filesystem-command))))))))) + +(define resize-file-system-service-type + (service-type + (name 'resize-file-system) + (description "Resize a partition and the underlying file system during boot.") + (extensions + (list + (service-extension shepherd-root-service-type + (compose list resize-file-system-shepherd-service)))) + (default-value (resize-file-system-configuration)))) + ;;; admin.scm ends here -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 15 18:02:53 2024 Received: (at 74837-done) by debbugs.gnu.org; 15 Dec 2024 23:02:53 +0000 Received: from localhost ([127.0.0.1]:52558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMxdU-0000TI-N1 for submit@debbugs.gnu.org; Sun, 15 Dec 2024 18:02:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMxdO-0000Sx-BK for 74837-done@debbugs.gnu.org; Sun, 15 Dec 2024 18:02:51 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMxdH-00027n-R7; Sun, 15 Dec 2024 18:02:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=btVdAiDMQBTy4kUNW4pcNTdBAPx7d0gTLns/mupOO3Q=; b=iSjkxkV55RepYUlB7iZN zES/qJ/aVSSypxphX9kYNGOO2ferULsRlMo7udaT6ok+Vo6VujOsYQxD3/vPIeYO5095JOoinNPYe +A2XxIjF+sRSTElV0fT/A7ayymPyNvhBl4yrTL56HITSYxBfKA3IJ9afAE9q+togRDtBkY1tCFKVN mz8Z8ZMv1p/iIeX6F2otDg1bk03/NYrlDi+RusPoAvKk8KEWgJ9BfRW0W9Z7HfPkOu/Hg7koGGho0 QjPIdRsKSfWyrIKRptG5SqDlasT8E0BGObEIoMjDVujn6BA6tAu9DEFLIdd3nZRlT4oO6eTO40mur HdPed5QT2IM5mA==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Richard Sent Subject: Re: [bug#74837] [PATCH v3 0/2] resize-file-system-service In-Reply-To: (Richard Sent's message of "Sat, 14 Dec 2024 16:18:21 -0500") References: Date: Mon, 16 Dec 2024 00:02:33 +0100 Message-ID: <875xnkh7na.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74837-done Cc: Maxim Cournoyer , 74837-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Richard Sent skribis: > What would that look like? We don't want to capture an error in > grow-filesystem-command with an exit-status of 1, so it lives outside > the guard, and we don't want to raise an exception if the partition > was already resized. Ah yes, that makes sense, sorry for misunderstanding. > (Side note, should Shepherd consider a service perpetually starting if > the start constructor exits without returning a value?) A constructor must return exactly one value. (Or it can throw an exception, which is interpreted as failure to start.) > V3 should have all other feedback implemented. > > Richard Sent (2): > packages: cloud-utils: Add missing growpart programs to path. > gnu: services: Add resize-file-system-service. Perfect. Applied, thanks! Ludo=E2=80=99. From unknown Tue Jun 17 22:11:27 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 13 Jan 2025 12:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator