How to see all labels?
Carl Johnson
carlj at peak.org
Fri Jan 25 04:51:41 UTC 2013
Carl Johnson <carlj at peak.org> writes:
> I recently installed 9.1 on a system and labels don't seem to work as
> I would expect. I can get them to work in /etc/fstab, but only the
> ones referenced there show up in /dev/ufs and /dev/gpt. I have seen
> this in previous versions, and in those cases they sometimes work. In
> at least one previous case one ufs label (of several) would never work
> even in fstab. The following shows my current configuration:
>
> $ uname -a
> FreeBSD bonsai.localnet 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825:
> Tue Dec 4 09:23:10 UTC 2012
> root at farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
> $ gpart backup ada0
> GPT 128
> 1 freebsd-boot 64 128
> 2 freebsd-ufs 192 35651584 Bonsai
> 3 freebsd-swap 35651776 4224671 BonsaiSwap
> $ glabel status
> Name Status Components
> gptid/150b03ac-5767-11e2-a154-001485411fc8 N/A ada0p1
> ufs/Bonsai N/A ada0p2
> gpt/BonsaiSwap N/A ada0p3
> $ ls -l /dev/ufs
> total 0
> crw-r----- 1 root operator 0, 109 2013-01-08 09:42 Bonsai
> $ ls -l /dev/gpt
> total 0
> crw-r----- 1 root operator 0, 112 2013-01-08 09:42 BonsaiSwap
> $ cat /etc/fstab
> # Device Mountpoint FStype Options Dump Pass#
> #/dev/ada0p2 / ufs rw 1 1
> #/dev/ada0p3 none swap sw 0 0
> /dev/ufs/Bonsai / ufs rw 1 1
> /dev/gpt/BonsaiSwap none swap sw 0 0
>
> In this case I have two GPT labels defined, but only the one used in
> fstab (BonsaiSwap) is shown in /dev/gpt and by glabel. When I used
> the original fstab without labels, there were no /dev/gpt or /dev/ufs
> directories, and glabel didn't show any of them.
>
> Does anybody have any ideas about how to get the system to recognize
> all labels? A command after boot would be acceptable since I could
> just put it in /etc/rc.local.
I just discoved the sysctl 'kern.geom.label.debug=2' and did some
further testing. It appears that the system removes what it considers
redundant labels. For the Bonsai label it has labels for ufs, ufsid,
gpt, and gptid; so it removes the ufsid, gpt, and gptid labels after I
use the ufs label. The swap partition has gpt and gptid labels, and it
removes the gptid label after I use the gpt label. I don't really agree
with it, but I feel better about it now that I think I understand what
it is doing.
--
Carl Johnson carlj at peak.org
More information about the freebsd-questions
mailing list