group options together in output display
[unix-history] / usr / src / sbin / disklabel / disklabel.8
CommitLineData
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
24disklabel \- 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
66can be used to install, examine or modify the label on a disk drive or pack.
67When writing the label, it can be used
68to change the drive identification,
69the disk partitions on the drive,
70or to replace a damaged label or bootstrap.
bdb6580b
MK
71The disk label is located on one of the first sectors
72of each disk (usually block 0).
73On machines that require a block-0 bootstrap (VAX 11/750),
74the label is inserted into the bootstrap program.
37adbef5
MK
75This information is used by the system disk driver and by the bootstrap
76program to determine how to program the drive.
bdb6580b
MK
77There are several forms of the command that display, install or modify
78the label on a disk.
79Each form has an additional option,
80.BR \-r ,
81which causes the label to be read from or written to the disk directly,
82rather than going through the system's in-core copy of the label.
83When writing, the in-core copy is also updated if possible.
85fd189d
MK
84This option may allow a label to be installed on a disk
85without kernel support for a label, such as when labels are first installed
250c0be5 86on a system; it must be used when first installing a label on a disk.
37adbef5
MK
87.PP
88The first form of the command is used to examine the label on the named
89disk drive (e.g. hp0 or /dev/rhp0c).
90It will display all of the parameters associated with the drive
91and its partition layout.
250c0be5
MK
92Unless the
93.B \-r
94flag is given,
95the kernel's in-core copy of the label is displayed;
37adbef5 96if the disk has no label, or the partition types on the disk are incorrect,
85fd189d 97the kernel may have constructed or modified the label.
37adbef5
MK
98If the
99.B \-r
100flag is given, the label from the raw disk will be displayed rather
101than the in-core label.
102.PP
103The second form of the command, with the
104.B \-w
105flag, is used to write a standard label on the designated drive.
106The required arguments to
107.I disklabel
108are the drive to be labelled (e.g. hp0), and
109the drive type as described in the
110.IR disktab (5)
111file.
112The drive parameters and partitions are taken from that file.
113If different disks of the same physical type are to have different
114partitions, it will be necessary to have separate disktab entries
250c0be5
MK
115describing each, or to edit the label after installation as described below.
116The first optional argument is a pack identification string,
117up to 16 characters long.
37adbef5
MK
118The pack id must be quoted if it contains blanks.
119If the
120.B \-r
121flag is given, the disk sectors containing the label and bootstrap
122will be written directly,
250c0be5 123otherwise the existing label will be updated in place without modifying
85fd189d
MK
124the bootstrap.
125If the disk does not already have a label, the
37adbef5 126.B \-r
85fd189d
MK
127flag must be used.
128In either case, the kernel's in-core label is replaced.
129.PP
130Alternate versions of the bootstrap files may be specified
37adbef5
MK
131after the pack identifier.
132If an alternate bootstrap is not specified, the standard bootstrap will be used.
133The bootstrap programs are located in
85fd189d
MK
134.IR /usr/mdec .
135The names of the bootstrap programs may be specified in
136.IR disktab (5);
250c0be5
MK
137if not specified,
138the default names are of the form
139.IR basename boot
37adbef5 140for the primary (block 0) bootstrap, and
250c0be5 141.RI boot basename
37adbef5 142for the secondary (block 1-15) bootstrap;
250c0be5
MK
143for example, /usr/mdec/hpboot and /usr/mdec/boothp
144if the disk device is
145.BR hp0 .
37adbef5
MK
146.PP
147An existing disk label may be edited by using the
148.B \-e
149flag.
150The label is read from the in-core kernel copy,
151or directly from the disk if the
152.B \-r
153flag is also given.
154The label is formatted and then supplied to an editor for changes.
155If no editor is specified in an EDITOR environment variable,
156.IR vi (1)
157is used.
158When the editor terminates, the formatted label is reread
159and used to rewrite the disk label.
37adbef5 160.PP
2ab70f66 161With the
85fd189d
MK
162.B \-R
163flag,
37adbef5
MK
164.I disklabel
165is capable of restoring a disk label that was formatted
85fd189d 166in a prior operation and saved in an ascii file.
250c0be5
MK
167The prototype file used to create the label should be in the same format
168as that produced when reading or editing a label.
169Comments are delimited by
170.B #
171and newline.
85fd189d
MK
172If the
173.B \-r
174option is also given,
175a block-0 bootstrap is installed on machines that use one;
176either the disktype or the names of the bootstrap files must be specified
177on such machines.
2ab70f66
KB
178.PP
179Finally, the \fB-NW\fP flags for \fIdisklabel\fP explicitly disallow and
180allow, 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"
188disktab(5), disklabel(5)
250c0be5
MK
189.SH DIAGNOSTICS
190The kernel device drivers will not allow the size of a disk partition
191to be decreased or the offset of a partition to be changed while it is open.
192Some device drivers create a label containing only a single large partition
193if a disk is unlabeled; thus, the label must be written to the ``a''
194partition of the disk while it is open.
195This sometimes requires the desired label to be set in two steps,
196the first one creating at least one other partition,
197and the second setting the label on the new partition
198while shrinking the ``a'' partition.
199.SH BUGS
200When a disk name is given without a full pathname,
201the constructed device name uses the ``c'' partition on the vax
202and the ``a'' partition on the tahoe.