glabel on 9-BETA1
nonesuch at longcount.org
Tue Aug 16 21:15:22 UTC 2011
On Tue, Aug 16, 2011 at 5:01 PM, Test Rat <ttsestt at gmail.com> wrote:
> Mark Saad <nonesuch at longcount.org> writes:
>> I was testing out an old bug and I am not sure if there is any known
>> work-around on 9-BETA/HEAD
>> Here is the issue. Install a new server , have it boot into
>> multi-user mode. Then attempt to use glabel to label the root slice
>> root at blindness:~# glabel label rootfs ada0p4
>> glabel: Can't store metadata on ada0p4: Operation not permitted.
>> In 7.2 and prior there was a sysctl that could be tweaked to allow for
>> this to work , kern.geom.debugflag set to 16 would allow this to work.
>> So my question is this. Should there be any reason why "glabel label
>> name device" on the root slice cause an issue
>> when the slice is mounted rw ?
>> Is this a bug ?
> It's a known feature, see geom(4) or try below diff.
>  http://lists.freebsd.org/pipermail/freebsd-fs/2010-April/008290.html
> Index: sys/geom/geom_subr.c
> --- sys/geom/geom_subr.c (revision 224657)
> +++ sys/geom/geom_subr.c (working copy)
> @@ -807,7 +819,7 @@ g_access(struct g_consumer *cp, int dcr, int dcw,
> pp, pp->name);
> /* If foot-shooting is enabled, any open on rank#1 is OK */
> - if ((g_debugflags & 16) && pp->geom->rank == 1)
> + if ((g_debugflags & 16))
> /* If we try exclusive but already write: fail */
> else if (dce > 0 && pw > 0)
Ok so I am not using glabel as it was originally designed or intended
but I was / am using in it in production to label slices.
IMHO it works very well for doing this. Here is an example from a
7.3-RELEASE servers of how I am using it.
[root at wfmu2~]# glabel list
Geom name: da1s1
1. Name: label/mysql/data
Mediasize: 146778668544 (137G)
1. Name: da1s1
Mediasize: 146778669056 (137G)
Geom name: da0s1a
1. Name: label/rootfs
Mediasize: 140336217600 (131G)
1. Name: da0s1a
Mediasize: 140336218112 (131G)
Geom name: da0s1b
1. Name: label/SWAP
Mediasize: 2147483136 (2.0G)
1. Name: da0s1b
Mediasize: 2147483648 (2.0G)
Geom name: da0s1d
1. Name: label/var
Mediasize: 4294966784 (4.0G)
1. Name: da0s1d
Mediasize: 4294967296 (4.0G)
So what I am getting at is in 9 I can not label the system in the same
way. So this may be a limitation of GPT but I am not sure .
The reason why I was doing this is to use a standard format for fstab
. Every server gets the same starting point
Here is the fstab from the same server
# Device Mountpoint FStype Options Dump Pass#
/dev/label/rootfs / ufs rw 1 1
/dev/label/var /var ufs rw 2 2
/dev/label/SWAP none swap sw 0 0
/dev/label/mysql/data /usr/local/mysql ufs rw 1 1
Is there any reason I can not do this in 9, is it just GPT thats
preventing this ?
mark saad | nonesuch at longcount.org
More information about the freebsd-hackers