update to current prog
[unix-history] / usr / src / sbin / disklabel / disklabel.8
CommitLineData
37adbef5
MK
1.\" from Symmetric Computer Systems.
2.\" Modifications Copyright (c) 1987 Regents of the University of California.
3.\" All rights reserved. The Berkeley software License Agreement
4.\" specifies the terms and conditions for redistribution.
5.\"
85fd189d 6.\" @(#)disklabel.8 6.4 (Berkeley) %G%
37adbef5
MK
7.\"
8.TH DISKLABEL 8 ""
9.UC 5
10.SH NAME
11disklabel \- read and write disk pack label
12.SH SYNOPSIS
13.B disklabel
14[
15.B \-r
16]
17.I disk
18.br
19.B disklabel \-w
20[
21.B \-r
22]
23.I disk
24.I disktype
25[
26.I packid
27[
28.I priboot secboot
29] ]
30.br
31.B disklabel \-e
32[
33.B \-r
34]
35.I disk
36.br
37.B disklabel \-R
38[
39.B \-r
40]
4ec0116d 41.I disk protofile
37adbef5
MK
42[
43.I priboot secboot
44]
45.SH DESCRIPTION
46.I Disklabel
47can be used to install, examine or modify the label on a disk drive or pack.
48When writing the label, it can be used
49to change the drive identification,
50the disk partitions on the drive,
51or to replace a damaged label or bootstrap.
bdb6580b
MK
52The disk label is located on one of the first sectors
53of each disk (usually block 0).
54On machines that require a block-0 bootstrap (VAX 11/750),
55the label is inserted into the bootstrap program.
37adbef5
MK
56This information is used by the system disk driver and by the bootstrap
57program to determine how to program the drive.
bdb6580b
MK
58There are several forms of the command that display, install or modify
59the label on a disk.
60Each form has an additional option,
61.BR \-r ,
62which causes the label to be read from or written to the disk directly,
63rather than going through the system's in-core copy of the label.
64When writing, the in-core copy is also updated if possible.
85fd189d
MK
65This option may allow a label to be installed on a disk
66without kernel support for a label, such as when labels are first installed
67on a system.
37adbef5
MK
68.PP
69The first form of the command is used to examine the label on the named
70disk drive (e.g. hp0 or /dev/rhp0c).
71It will display all of the parameters associated with the drive
72and its partition layout.
73The kernel's in-core label is displayed;
74if the disk has no label, or the partition types on the disk are incorrect,
85fd189d 75the kernel may have constructed or modified the label.
37adbef5
MK
76If the
77.B \-r
78flag is given, the label from the raw disk will be displayed rather
79than the in-core label.
80.PP
81The second form of the command, with the
82.B \-w
83flag, is used to write a standard label on the designated drive.
84The required arguments to
85.I disklabel
86are the drive to be labelled (e.g. hp0), and
87the drive type as described in the
88.IR disktab (5)
89file.
90The drive parameters and partitions are taken from that file.
91If different disks of the same physical type are to have different
92partitions, it will be necessary to have separate disktab entries
93describing each or to edit the label as described below.
94The first optional argument is a pack identification, up to 16 characters.
95The pack id must be quoted if it contains blanks.
96If the
97.B \-r
98flag is given, the disk sectors containing the label and bootstrap
99will be written directly,
85fd189d
MK
100otherwise the existing label will be modified in place without modifying
101the bootstrap.
102If the disk does not already have a label, the
37adbef5 103.B \-r
85fd189d
MK
104flag must be used.
105In either case, the kernel's in-core label is replaced.
106.PP
107Alternate versions of the bootstrap files may be specified
37adbef5
MK
108after the pack identifier.
109If an alternate bootstrap is not specified, the standard bootstrap will be used.
110The bootstrap programs are located in
85fd189d
MK
111.IR /usr/mdec .
112The names of the bootstrap programs may be specified in
113.IR disktab (5);
114if not specified
115with default names of the form
37adbef5
MK
116.IR disktype boot
117for the primary (block 0) bootstrap, and
118.RI boot disktype
119for the secondary (block 1-15) bootstrap;
120for example, /usr/mdec/hpboot and /usr/mdec/boothp.
121.PP
122An existing disk label may be edited by using the
123.B \-e
124flag.
125The label is read from the in-core kernel copy,
126or directly from the disk if the
127.B \-r
128flag is also given.
129The label is formatted and then supplied to an editor for changes.
130If no editor is specified in an EDITOR environment variable,
131.IR vi (1)
132is used.
133When the editor terminates, the formatted label is reread
134and used to rewrite the disk label.
37adbef5
MK
135.PP
136Finally,
85fd189d
MK
137with the
138.B \-R
139flag,
37adbef5
MK
140.I disklabel
141is capable of restoring a disk label that was formatted
85fd189d
MK
142in a prior operation and saved in an ascii file.
143The prototype file used to create the label is in exactly the same format
144that is produced when reading or editing a label.
145If the
146.B \-r
147option is also given,
148a block-0 bootstrap is installed on machines that use one;
149either the disktype or the names of the bootstrap files must be specified
150on such machines.
37adbef5
MK
151.SH FILES
152/etc/disktab
153.br
154/usr/mdec/\fIxx\fPboot
155.br
156/usr/mdec/boot\fIxx\fP
157.SH "SEE ALSO"
158disktab(5), disklabel(5)