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