From nobody Tue May 21 18:50:37 2024 X-Original-To: dev-commits-src-all@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 4VkNmZ1Sdyz5M1YF; Tue, 21 May 2024 18:50:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkNmY5p12z41Rx; Tue, 21 May 2024 18:50:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716317437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7fPLSckUu2ipheFU0IhhtJzLOt2bcDcZz0fMcpT1nVU=; b=X9nUiISiscOR1vul0nkOmz0JCylQQiToCnaEwEfeKlfbmnomQ6KU62sDNxroZPVxgYKHsQ SUc4as+v42qbGUtoHhMAfU/mfK/ag9XLEPwM/OwfNSwwwN/ou7wj/J4EdDTYA8cYS1TXZB YzZz0wxBVsBTMbyl6Rp2oqr4WeRRTbubP2MlfAfcz17NpIqIdYpcA/5QeDHzbX88YfnoDM ZaJvzHHt7ENDMhv5AGD72jiV4XOUZ34HcxnNQNKNAI1WeLKdyjq1PqDH4d8XP9uC98xpiP KnuB4/qfg9Ik4y379mjt2gUpo4tKcsRywFZWHgj2bP4Z1wJWxxCrHHRZbUsTIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716317437; a=rsa-sha256; cv=none; b=jiFRtxFsrD/sqHYdYoLA3DPiZ8kQjtYQ1xGsiN8WmDZipJwh7GFzBbMrolSnC09WpYzrFc 81Tx8dimBEN433HxLrRIJZkzzbzrDurmqjod7Ts4ebobQF/BlT+5Yz+USE75u9x12BaKU+ yuW5d4HmNCCTgE87rBy2izoT0T/eBaN7/F3bbwe3C8G7mRoape8noj6uoXRZZHkHUEzJ5Z B7gxfBY1f7fWbca3zJFpmwMsdpdxOy00afNzpjj6bHJcQUc34HHDbF0vu+Xpj8NwucS5hw LQBBdn+AXFD9Z5bPZn5n0I7WUIGY9yHAPt9szcbiFgXKqjGSRc60gbuuFpuOmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716317437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7fPLSckUu2ipheFU0IhhtJzLOt2bcDcZz0fMcpT1nVU=; b=gKkfnVQb/6Dm+f8ijcOqCFEC7oZrmYovrMVyxkV7Rfn3fKRPOFZJvgC8WoagEJmwyng9lS UZNT4ceI5ORU3WZ7MLOM9uu3iLA3F+UO5KqIwL3Z8vahol1C1XkXHzyjadb4YlbxUlTajP vMleT+cTcFFm11arrh9m+zq+W2Hm2GAWPQStzmJvFVGDYT24xwYzAXnjl4358UNDvSU+We AJUen4O3BfWNv12Bu8+5Jsg0CNjAHx2Wu4dJQQL2uxNfF7BP1dT/JH2O91I0V9aBRVGQ8v bbRG83iFI4jtfZYLk2FKTzUIPvDvqQG81ycCHORVbSxbY+xrlyxjc9Y68kaI1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkNmY3Fc7zZ6N; Tue, 21 May 2024 18:50:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LIobed015549; Tue, 21 May 2024 18:50:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LIobfk015546; Tue, 21 May 2024 18:50:37 GMT (envelope-from git) Date: Tue, 21 May 2024 18:50:37 GMT Message-Id: <202405211850.44LIobfk015546@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Mingrone Subject: git: c80c104cbd52 - main - glabel.8: Describe cases related to permissions / existing mounts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c80c104cbd52db994c0f2757bd1c6d014744022c Auto-Submitted: auto-generated The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=c80c104cbd52db994c0f2757bd1c6d014744022c commit c80c104cbd52db994c0f2757bd1c6d014744022c Author: Chris Moerz AuthorDate: 2024-05-21 18:10:11 +0000 Commit: Joseph Mingrone CommitDate: 2024-05-21 18:49:17 +0000 glabel.8: Describe cases related to permissions / existing mounts Specially, note some requirements for label changes: - glabel requires write permission on device - filesystems first need to be unmounted for new labels to persist across reboots - if the affected device node holds the filesystem root, single-user mode with r/o mount will be required. Also, while here, apply some formatting tweaks. PR: 276724 Reported by: Alex Matei Reviewed by: gbe, jrm, Alexander Ziaee Differential Revision: https://reviews.freebsd.org/D44394 --- lib/geom/label/glabel.8 | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/lib/geom/label/glabel.8 b/lib/geom/label/glabel.8 index d6f253342905..da958b52befd 100644 --- a/lib/geom/label/glabel.8 +++ b/lib/geom/label/glabel.8 @@ -137,7 +137,7 @@ e.g. .Pa /dev/diskid/DISK-6QG3Z026 . .Pp Generic labels created and managed solely by -.Xr glabel 8 +.Nm are created in the .Pa /dev/label/ directory. @@ -164,7 +164,8 @@ device will be one sector smaller than the device from which it was created. .Pp Note that for all label types, nested GEOM classes will cause additional device nodes to be created, with context-specific data appended to their -names. E.g. for every node like +names. +E.g. for every node like .Pa /dev/label/bigdisk there will be additional entries for any partitions which the device contains, like @@ -172,6 +173,17 @@ contains, like and .Pa /dev/label/bigdiskp1a . .Pp +.Nm +requires write access to a device to create, modify, and destroy +"automatic" labels. +It will fail to persist changes if they are applied while a file +system on the device is currently mounted. +To ensure that modifications are stored across a reboot, the file system +needs to be unmounted first. +If the device holds the system's root file system, entering into +single user mode and mounting in read-only mode is required to persist +the change. +.Pp The first argument to .Nm indicates an action to be performed: @@ -252,12 +264,13 @@ Most .Nm LABEL providers implement a .Xr sysctl 8 -flag and a tunable variable named in the above format. This flag -controls if the label provider will be active, tasting devices +flag and a tunable variable named in the above format. +This flag controls if the label provider will be active, tasting devices and creating label nodes in the .Xr devfs 4 -tree. It is sometimes desirable to disable certain label types if -they conflict with other classes in complex GEOM topologies. +tree. +It is sometimes desirable to disable certain label types if they +conflict with other classes in complex GEOM topologies. .El .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails.