tunefs
operates on partitions of ufs, glabel
operates on partitions (e.g. /dev/da0p1
) and/or entire disk (e.g. /dev/da0
) glabel label <label_name> <provider>
. where <provider>
is the disk partition entry in /dev
you want to label, e.g. /dev/ada0p1
/dev/label/<label_name>
, to which you can then refer in your fstab
# glabel label test /dev/md0
# diskinfo /dev/label/test
/dev/label/test 512 10485248 20479 0 0
#
# diskinfo /dev/md0
/dev/md0 512 10485760 20480 0 0
#
# dd if=/dev/md0 bs=512 skip=20479 | hd
1+0 records in
1+0 records out
512 bytes transferred in 0.000071 secs (7243814 bytes/sec)
00000000 47 45 4f 4d 3a 3a 4c 41 42 45 4c 00 08 00 00 00 |GEOM::LABEL.....|
00000010 02 00 00 00 74 65 73 74 00 fe fe fe fe fe fe fe |....test........|
...
zpool status
output), disable the other labeling methods in /boot/loader.conf:kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
% sysctl kern.geom.label
kern.geom.label.disk_ident.enable: 0
kern.geom.label.gptid.enable: 0
kern.geom.label.gpt.enable: 1
[...]
tunefs
operates on partitions of ufs,glabel
operates on partitions (e.g./dev/da0p1
) and/or entire disk (e.g./dev/da0
)
Below is the steps of labeling a partition using glabel.
1. umount the partition you want to label
2. label the partition usingglabel label <label_name> <provider>
. where<provider>
is the disk partition entry in/dev
you want to label, e.g./dev/ada0p1
After step 1 and step 2, you can see an entry in/dev/label/<label_name>
, to which you can then refer in yourfstab
gpart show
it shows The sX is a slice, not a partition.I want to to put a label of S01 on ada1s3 which is a FreeBSD partition,
tryI'm trying following these instructions and am missing something...
I have a laptop with two hard disks ada0 and ada1. I want to to put a label of S01 on ada1s3 which is a FreeBSD partition, and I'm booting from ada0 so as not to mount the parttion I want to label. When runninggpart show
it shows
label/S01
against the correct partition but the directory (ada1s3a)/dev is blank...
Strangely, when I boot from ada1 there is a /dev/label but it contains
S07p3
S07p3a
S07p3b
which must be a throwover from when I last tried to get labels to work.
Is there any way to unlabel partitions?
glabel destroy <label_name>
(e.g. glabel destroy S07p3
). glabel()