]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - sbin/geom/class/label/glabel.8
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / sbin / geom / class / label / glabel.8
1 .\" Copyright (c) 2004-2005 Pawel Jakub Dawidek <pjd@FreeBSD.org>
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd July 2, 2004
28 .Dt GLABEL 8
29 .Os
30 .Sh NAME
31 .Nm glabel
32 .Nd "disk labelization control utility"
33 .Sh SYNOPSIS
34 .Nm
35 .Cm create
36 .Op Fl v
37 .Ar name
38 .Ar dev
39 .Nm
40 .Cm destroy
41 .Op Fl fv
42 .Ar name ...
43 .Nm
44 .Cm label
45 .Op Fl v
46 .Ar name
47 .Ar dev
48 .Nm
49 .Cm stop
50 .Op Fl fv
51 .Ar name ...
52 .Nm
53 .Cm clear
54 .Op Fl v
55 .Ar dev ...
56 .Nm
57 .Cm dump
58 .Ar dev ...
59 .Nm
60 .Cm list
61 .Nm
62 .Cm status
63 .Nm
64 .Cm load
65 .Nm
66 .Cm unload
67 .Sh DESCRIPTION
68 The
69 .Nm
70 utility is used for GEOM provider labelization.
71 A label can be set up on a GEOM provider in two ways:
72 .Dq manual
73 or
74 .Dq automatic .
75 When using the
76 .Dq manual
77 method, no metadata are stored on the devices, so a label has to be configured
78 by hand every time it is needed.
79 The
80 .Dq automatic
81 method uses on-disk metadata to store the label and detect it automatically in
82 the future.
83 .Pp
84 This class also provides volume label detection for file systems.
85 Those labels cannot be set with
86 .Nm ,
87 but must be set with the appropriate file system utility, e.g.\& for UFS
88 the file system label is set with
89 .Xr tunefs 8 .
90 Currently supported file systems are:
91 .Pp
92 .Bl -bullet -offset indent -compact
93 .It
94 UFS1 volume names (directory
95 .Pa /dev/ufs/ ) .
96 .It
97 UFS2 volume names (directory
98 .Pa /dev/ufs/ ) .
99 .It
100 UFS1 file system IDs (directory
101 .Pa /dev/ufsid/ ) .
102 .It
103 UFS2 file system IDs (directory
104 .Pa /dev/ufsid/ ) .
105 .It
106 MSDOSFS (FAT12, FAT16, FAT32) (directory
107 .Pa /dev/msdosfs/ ) .
108 .It
109 CD ISO9660 (directory
110 .Pa /dev/iso9660/ ) .
111 .It
112 EXT2FS (directory
113 .Pa /dev/ext2fs/ ) .
114 .It
115 REISERFS (directory
116 .Pa /dev/reiserfs/ ) .
117 .It
118 NTFS (directory
119 .Pa /dev/ntfs/ ) .
120 .El
121 .Pp
122 Non file-system labels are created in the directory
123 .Pa /dev/label/ .
124 .Pp
125 The first argument to
126 .Nm
127 indicates an action to be performed:
128 .Bl -tag -width ".Cm destroy"
129 .It Cm create
130 Create temporary label
131 .Ar name
132 for the given provider.
133 This is the
134 .Dq manual
135 method.
136 The kernel module
137 .Pa geom_label.ko
138 will be loaded if it is not loaded already.
139 .It Cm label
140 Set up a label
141 .Ar name
142 for the given provider.
143 This is the
144 .Dq automatic
145 method, where metadata is stored in a provider's last sector.
146 The kernel module
147 .Pa geom_label.ko
148 will be loaded if it is not loaded already.
149 .It Cm stop
150 Turn off the given label by its
151 .Ar name .
152 This command does not touch on-disk metadata!
153 .It Cm destroy
154 Same as
155 .Cm stop .
156 .It Cm clear
157 Clear metadata on the given devices.
158 .It Cm dump
159 Dump metadata stored on the given devices.
160 .It Cm list
161 See
162 .Xr geom 8 .
163 .It Cm status
164 See
165 .Xr geom 8 .
166 .It Cm load
167 See
168 .Xr geom 8 .
169 .It Cm unload
170 See
171 .Xr geom 8 .
172 .El
173 .Pp
174 Additional options:
175 .Bl -tag -width indent
176 .It Fl f
177 Force the removal of the specified labels.
178 .It Fl v
179 Be more verbose.
180 .El
181 .Sh SYSCTL VARIABLES
182 The following
183 .Xr sysctl 8
184 variables can be used to control the behavior of the
185 .Nm LABEL
186 GEOM class.
187 The default value is shown next to each variable.
188 .Bl -tag -width indent
189 .It Va kern.geom.label.debug : No 0
190 Debug level of the
191 .Nm LABEL
192 GEOM class.
193 This can be set to a number between 0 and 2 inclusive.
194 If set to 0 minimal debug information is printed, and if set to 2 the
195 maximum amount of debug information is printed.
196 .El
197 .Sh EXIT STATUS
198 Exit status is 0 on success, and 1 if the command fails.
199 .Sh EXAMPLES
200 The following example shows how to set up a label for disk
201 .Dq Li da2 ,
202 create a file system on it, and mount it:
203 .Bd -literal -offset indent
204 glabel label -v usr /dev/da2
205 newfs /dev/label/usr
206 mount /dev/label/usr /usr
207 [...]
208 umount /usr
209 glabel stop usr
210 glabel unload
211 .Ed
212 .Pp
213 The next example shows how to set up a label for a UFS file system:
214 .Bd -literal -offset indent
215 tunefs -L data /dev/da4s1a
216 mount /dev/ufs/data /mnt/data
217 .Ed
218 .Sh SEE ALSO
219 .Xr geom 4 ,
220 .Xr loader.conf 5 ,
221 .Xr geom 8 ,
222 .Xr mount 8 ,
223 .Xr newfs 8 ,
224 .Xr sysctl 8 ,
225 .Xr tunefs 8 ,
226 .Xr umount 8
227 .Sh HISTORY
228 The
229 .Nm
230 utility appeared in
231 .Fx 5.3 .
232 .Sh AUTHORS
233 .An Pawel Jakub Dawidek Aq pjd@FreeBSD.org