Commit | Line | Data |
---|---|---|
57a981eb | 1 | .\" Copyright (c) 1987, 1988 Regents of the University of California. |
2ab70f66 | 2 | .\" All rights reserved. |
37adbef5 | 3 | .\" |
57a981eb KB |
4 | .\" This code is derived from software contributed to Berkeley by |
5 | .\" Symmetric Computer Systems. | |
6 | .\" | |
2ab70f66 | 7 | .\" Redistribution and use in source and binary forms are permitted |
57a981eb KB |
8 | .\" provided that the above copyright notice and this paragraph are |
9 | .\" duplicated in all such forms and that any documentation, | |
10 | .\" advertising materials, and other materials related to such | |
11 | .\" distribution and use acknowledge that the software was developed | |
12 | .\" by the University of California, Berkeley. The name of the | |
13 | .\" University may not be used to endorse or promote products derived | |
14 | .\" from this software without specific prior written permission. | |
15 | .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
16 | .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
17 | .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
2ab70f66 | 18 | .\" |
57a981eb | 19 | .\" @(#)disklabel.8 6.7 (Berkeley) %G% |
37adbef5 MK |
20 | .\" |
21 | .TH DISKLABEL 8 "" | |
22 | .UC 5 | |
23 | .SH NAME | |
24 | disklabel \- read and write disk pack label | |
25 | .SH SYNOPSIS | |
26 | .B disklabel | |
27 | [ | |
28 | .B \-r | |
29 | ] | |
30 | .I disk | |
31 | .br | |
32 | .B disklabel \-w | |
33 | [ | |
34 | .B \-r | |
35 | ] | |
36 | .I disk | |
37 | .I disktype | |
38 | [ | |
39 | .I packid | |
40 | [ | |
41 | .I priboot secboot | |
42 | ] ] | |
43 | .br | |
44 | .B disklabel \-e | |
45 | [ | |
46 | .B \-r | |
47 | ] | |
48 | .I disk | |
49 | .br | |
50 | .B disklabel \-R | |
51 | [ | |
52 | .B \-r | |
53 | ] | |
4ec0116d | 54 | .I disk protofile |
37adbef5 MK |
55 | [ |
56 | .I priboot secboot | |
57 | ] | |
2ab70f66 KB |
58 | .br |
59 | .B disklabel | |
60 | [ | |
61 | .B \-NW | |
62 | ] | |
63 | .I disk | |
37adbef5 MK |
64 | .SH DESCRIPTION |
65 | .I Disklabel | |
66 | can be used to install, examine or modify the label on a disk drive or pack. | |
67 | When writing the label, it can be used | |
68 | to change the drive identification, | |
69 | the disk partitions on the drive, | |
70 | or to replace a damaged label or bootstrap. | |
bdb6580b MK |
71 | The disk label is located on one of the first sectors |
72 | of each disk (usually block 0). | |
73 | On machines that require a block-0 bootstrap (VAX 11/750), | |
74 | the label is inserted into the bootstrap program. | |
37adbef5 MK |
75 | This information is used by the system disk driver and by the bootstrap |
76 | program to determine how to program the drive. | |
bdb6580b MK |
77 | There are several forms of the command that display, install or modify |
78 | the label on a disk. | |
79 | Each form has an additional option, | |
80 | .BR \-r , | |
81 | which causes the label to be read from or written to the disk directly, | |
82 | rather than going through the system's in-core copy of the label. | |
83 | When writing, the in-core copy is also updated if possible. | |
85fd189d MK |
84 | This option may allow a label to be installed on a disk |
85 | without kernel support for a label, such as when labels are first installed | |
250c0be5 | 86 | on a system; it must be used when first installing a label on a disk. |
37adbef5 MK |
87 | .PP |
88 | The first form of the command is used to examine the label on the named | |
89 | disk drive (e.g. hp0 or /dev/rhp0c). | |
90 | It will display all of the parameters associated with the drive | |
91 | and its partition layout. | |
250c0be5 MK |
92 | Unless the |
93 | .B \-r | |
94 | flag is given, | |
95 | the kernel's in-core copy of the label is displayed; | |
37adbef5 | 96 | if the disk has no label, or the partition types on the disk are incorrect, |
85fd189d | 97 | the kernel may have constructed or modified the label. |
37adbef5 MK |
98 | If the |
99 | .B \-r | |
100 | flag is given, the label from the raw disk will be displayed rather | |
101 | than the in-core label. | |
102 | .PP | |
103 | The second form of the command, with the | |
104 | .B \-w | |
105 | flag, is used to write a standard label on the designated drive. | |
106 | The required arguments to | |
107 | .I disklabel | |
108 | are the drive to be labelled (e.g. hp0), and | |
109 | the drive type as described in the | |
110 | .IR disktab (5) | |
111 | file. | |
112 | The drive parameters and partitions are taken from that file. | |
113 | If different disks of the same physical type are to have different | |
114 | partitions, it will be necessary to have separate disktab entries | |
250c0be5 MK |
115 | describing each, or to edit the label after installation as described below. |
116 | The first optional argument is a pack identification string, | |
117 | up to 16 characters long. | |
37adbef5 MK |
118 | The pack id must be quoted if it contains blanks. |
119 | If the | |
120 | .B \-r | |
121 | flag is given, the disk sectors containing the label and bootstrap | |
122 | will be written directly, | |
250c0be5 | 123 | otherwise the existing label will be updated in place without modifying |
85fd189d MK |
124 | the bootstrap. |
125 | If the disk does not already have a label, the | |
37adbef5 | 126 | .B \-r |
85fd189d MK |
127 | flag must be used. |
128 | In either case, the kernel's in-core label is replaced. | |
129 | .PP | |
130 | Alternate versions of the bootstrap files may be specified | |
37adbef5 MK |
131 | after the pack identifier. |
132 | If an alternate bootstrap is not specified, the standard bootstrap will be used. | |
133 | The bootstrap programs are located in | |
85fd189d MK |
134 | .IR /usr/mdec . |
135 | The names of the bootstrap programs may be specified in | |
136 | .IR disktab (5); | |
250c0be5 MK |
137 | if not specified, |
138 | the default names are of the form | |
139 | .IR basename boot | |
37adbef5 | 140 | for the primary (block 0) bootstrap, and |
250c0be5 | 141 | .RI boot basename |
37adbef5 | 142 | for the secondary (block 1-15) bootstrap; |
250c0be5 MK |
143 | for example, /usr/mdec/hpboot and /usr/mdec/boothp |
144 | if the disk device is | |
145 | .BR hp0 . | |
37adbef5 MK |
146 | .PP |
147 | An existing disk label may be edited by using the | |
148 | .B \-e | |
149 | flag. | |
150 | The label is read from the in-core kernel copy, | |
151 | or directly from the disk if the | |
152 | .B \-r | |
153 | flag is also given. | |
154 | The label is formatted and then supplied to an editor for changes. | |
155 | If no editor is specified in an EDITOR environment variable, | |
156 | .IR vi (1) | |
157 | is used. | |
158 | When the editor terminates, the formatted label is reread | |
159 | and used to rewrite the disk label. | |
37adbef5 | 160 | .PP |
2ab70f66 | 161 | With the |
85fd189d MK |
162 | .B \-R |
163 | flag, | |
37adbef5 MK |
164 | .I disklabel |
165 | is capable of restoring a disk label that was formatted | |
85fd189d | 166 | in a prior operation and saved in an ascii file. |
250c0be5 MK |
167 | The prototype file used to create the label should be in the same format |
168 | as that produced when reading or editing a label. | |
169 | Comments are delimited by | |
170 | .B # | |
171 | and newline. | |
85fd189d MK |
172 | If the |
173 | .B \-r | |
174 | option is also given, | |
175 | a block-0 bootstrap is installed on machines that use one; | |
176 | either the disktype or the names of the bootstrap files must be specified | |
177 | on such machines. | |
2ab70f66 KB |
178 | .PP |
179 | Finally, the \fB-NW\fP flags for \fIdisklabel\fP explicitly disallow and | |
180 | allow, respectively, writing of the pack label area on the selected disk. | |
37adbef5 MK |
181 | .SH FILES |
182 | /etc/disktab | |
183 | .br | |
184 | /usr/mdec/\fIxx\fPboot | |
185 | .br | |
186 | /usr/mdec/boot\fIxx\fP | |
187 | .SH "SEE ALSO" | |
188 | disktab(5), disklabel(5) | |
250c0be5 MK |
189 | .SH DIAGNOSTICS |
190 | The kernel device drivers will not allow the size of a disk partition | |
191 | to be decreased or the offset of a partition to be changed while it is open. | |
192 | Some device drivers create a label containing only a single large partition | |
193 | if a disk is unlabeled; thus, the label must be written to the ``a'' | |
194 | partition of the disk while it is open. | |
195 | This sometimes requires the desired label to be set in two steps, | |
196 | the first one creating at least one other partition, | |
197 | and the second setting the label on the new partition | |
198 | while shrinking the ``a'' partition. | |
199 | .SH BUGS | |
200 | When a disk name is given without a full pathname, | |
201 | the constructed device name uses the ``c'' partition on the vax | |
202 | and the ``a'' partition on the tahoe. |