Bug 276547 - 'glabel label' command fails to set up label on a GEOM provider
Summary: 'glabel label' command fails to set up label on a GEOM provider
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.2-RELEASE
Hardware: amd64 Any
: --- Affects Many People
Assignee: freebsd-geom (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-23 07:54 UTC by Alex Matei
Modified: 2024-01-29 14:24 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Matei 2024-01-23 07:54:02 UTC
$ uname -a
FreeBSD eagle 13.2-RELEASE FreeBSD 13.2-RELEASE GENERIC amd64
$

GEOM provider labelization, 'automatic' method:
$ sudo glabel label -v test35 ada0p1
glabel: Can't store metadata on ada0p1: Operation not permitted.
$

GEOM provider labelization, 'manual' method works fine:
$ sudo glabel create -v test35 ada0p1
$ glabel list
...
Geom name: ada0p1
Providers:
1. Name: label/test35  // 'test35' disappears at system reboot
...
$
$ glabel stop test35
$ glabel list
...test35 is gone...
$
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2024-01-26 19:38:29 UTC
I suspect that this is because something is holding /dev/ada0p1 open.  (For instance, is it providing a mounted filesystem?)  "glabel label" needs to write data to the last sector of the provider and so must open the device for writing, while "glabel create" creates a temporary label and so does not need to do this.

This might be "functions as designed," though the error message leaves something to be desired..
Comment 2 Alex Matei 2024-01-29 11:26:57 UTC
(In reply to Mark Johnston from comment #1)
Yes, /dev/ada0p1 is mounted.
Thanks for the update!
Comment 3 Mark Johnston freebsd_committer freebsd_triage 2024-01-29 14:24:43 UTC
Thanks for the update.  In that case I believe this is expected behaviour.  Please re-open the bug if you disagree, or can point to some documentation which suggests otherwise.