p The first form of the command is used to examine the label on the named disk drive (e.g. hp0 or /dev/rhp0c). It will display all of the parameters associated with the drive and its partition layout. Unless the .Fl r flag is given, the kernel's in-core copy of the label is displayed; if the disk has no label, or the partition types on the disk are incorrect, the kernel may have constructed or modified the label. If the .Fl r flag is given, the label from the raw disk will be displayed rather than the in-core label.
p The second form of the command, with the .Fl w flag, is used to write a standard label on the designated drive. The required arguments to .Nm disklabel are the drive to be labelled (e.g. hp0), and the drive type as described in the .Xr disktab 5 file. The drive parameters and partitions are taken from that file. If different disks of the same physical type are to have different partitions, it will be necessary to have separate disktab entries describing each, or to edit the label after installation as described below. The first optional argument is a pack identification string, up to 16 characters long. The pack id must be quoted if it contains blanks. If the .Fl r flag is given, the disk sectors containing the label and bootstrap will be written directly, otherwise the existing label will be updated in place without modifying the bootstrap. If the disk does not already have a label, the .Fl r flag must be used. In either case, the kernel's in-core label is replaced.
p Alternate versions of the bootstrap files may be specified after the pack identifier. If an alternate bootstrap is not specified, the standard bootstrap will be used. The bootstrap programs are located in
a /usr/mdec . The names of the bootstrap programs may be specified in .Xr disktab 5 ; if not specified, the default names are of the form .Em basename No boot for the primary (block 0) bootstrap, and .No boot Em basename for the secondary (block 1-15) bootstrap; for example,
a /usr/mdec/boothp if the disk device is .Em hp0 .
p An existing disk label may be edited by using the .Fl e flag. The label is read from the in-core kernel copy, or directly from the disk if the .Fl r flag is also given. The label is formatted and then supplied to an editor for changes. If no editor is specified in an EDITOR environment variable, .Xr vi 1 is used. When the editor terminates, the formatted label is reread and used to rewrite the disk label.
p With the .Fl R flag, .Nm disklabel is capable of restoring a disk label that was formatted in a prior operation and saved in an ascii file. The prototype file used to create the label should be in the same format as that produced when reading or editing a label. Comments are delimited by .Em # and newline. If the .Fl r option is also given, a block-0 bootstrap is installed on machines that use one; either the disktype or the names of the bootstrap files must be specified on such machines.
p Finally, the .Fl NW flags for .Nm disklabel explicitly disallow and allow, respectively, writing of the pack label area on the selected disk. .Sh FILES l -item -compact t
a /usr/mdec/ Ns Sy xx Ns Pa boot t
a /usr/mdec/boot Ns Sy xx .Sh SEE ALSO .Xr disktab 5 , .Xr disklabel 5 .Sh DIAGNOSTICS The kernel device drivers will not allow the size of a disk partition to be decreased or the offset of a partition to be changed while it is open. Some device drivers create a label containing only a single large partition if a disk is unlabeled; thus, the label must be written to the .Dq a partition of the disk while it is open. This sometimes requires the desired label to be set in two steps, the first one creating at least one other partition, and the second setting the label on the new partition while shrinking the .Dq a partition. .Sh BUGS When a disk name is given without a full pathname, the constructed device name uses the .Dq c partition on the vax and the .Dq a partition on the tahoe.