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