Where has my /dev/label gone?

John-Mark Gurney jmg at funkthat.com
Wed Feb 19 17:38:28 UTC 2014


lucian at lastdot.org wrote this message on Wed, Feb 19, 2014 at 12:24 +0000:
> Erich Dollansky writes:
> 
> >On Wed, 19 Feb 2014 11:54:40 +0000
> >lucian at lastdot.org wrote:
> >
> >> Erich Dollansky writes:
> >>
> >> > On Wed, 19 Feb 2014 09:10:53 +0000
> >> > Lucian <lucian at lastdot.org> wrote:
> >> >
> >> > > I set up some labels (glabel label blah /dev/partition) and they
> >> > > show up fine in /dev/label, but once I reboot out of single user
> >> > > mode and into nornal mode /dev/label is gone.
> >> > >
> >> > > What am I missing?
> >> >
> >> > Bermuda triangle?
> >> >
> >> > It sounds strange. Ok, you this in the single user mode. Why? What
> >> > devices did you label?
> >> >
> >> > Hopefully not the devices in use. This does not work from my point
> >> > of view. You would have to use another label type then.
> >>
> >> I did this in single user because according to the docs you can't do
> >> it on a "live system".
> >> http://www.freebsd.org/doc/handbook/geom-glabel.html
> >
> >do you have this in your kernel?
> >
> >options GEOM_LABEL
> >
> >You can also load the module at boot time with an entry
> >in /boot/loader.conf.
> >
> >Erich
> 
> I have GEOM_LABEL loaded, but I noticed something strange.
> If I boot in single user, I can create and see the labels under /dev/label, 
> however if I remount the / filesystem RW then /dev/label disappears.
> BUT, if I just replace my / partition in fstab with the seemingly missing  
> label (eg /dev/label/rootfs) then the system boots up fine and /dev/label 
> is  again available to `ls`. Strange stuff, it should be covered in the  
> handbook...
> Problem solved, I guess.

This is correct, but it's not for the reason people are saying...

The label is in the partition, say ada0s1a... When you mount ada0s1a for
writing (which also sets exclusive access, not just reading), all
children geoms will wither away because you won't be able to open
the children for reading as the mounted partition has exclusive access..
If you later were to remount the partition read-only (I'm not sure if
this drops exclusive/write access, but if it does), then the labels
will show up again, assuming the file system didn't overwrite the
label...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the freebsd-net mailing list