Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Sep 2023 12:40:58 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 81f36fbc98dd - main - glabel.8: Warn against using generic labels on a shared device
Message-ID:  <202309271240.38RCewW3001066@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=81f36fbc98dd74ca923938e0329919d426811b0c

commit 81f36fbc98dd74ca923938e0329919d426811b0c
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-05-26 13:48:17 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-09-27 12:39:31 +0000

    glabel.8: Warn against using generic labels on a shared device
    
    Also suggest against creating a generic label on a device which already
    contains a filesystem.
    
    PR:             264166
    Reviewed by:    imp, delphij, Pau Amma <pauamma@gundo.com>
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D35326
---
 lib/geom/label/glabel.8 | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/lib/geom/label/glabel.8 b/lib/geom/label/glabel.8
index 5283a604e45b..a23f425bc5e1 100644
--- a/lib/geom/label/glabel.8
+++ b/lib/geom/label/glabel.8
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd March 12, 2017
+.Dd September 27, 2023
 .Dt GLABEL 8
 .Os
 .Sh NAME
@@ -141,6 +141,26 @@ Generic labels created and managed solely by
 are created in the
 .Pa /dev/label/
 directory.
+Note that generic, automatic labels occupy some space on the device
+and thus should not be added to a device already containing a file system.
+In particular,
+.Nm
+reserves the last sector of the device to store the label information.
+If the device already contains a file system,
+.Nm
+will overwrite the last sector, possibly damaging the file system, and the
+file system may later overwrite the label sector.
+Instead, create a label before initializing the file system, and initialize
+that file system on the device created by
+.Nm
+under the
+.Pa /dev/label/
+directory.
+Then the file system will correctly account for the space occupied by the
+generic label,
+since the
+.Nm
+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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202309271240.38RCewW3001066>