Modifications Copyright (c) 1987 Regents of the University of California.
All rights reserved. The Berkeley software License Agreement
specifies the terms and conditions for redistribution.
@(#)disklabel.8 6.2 (Berkeley) 06/19/87
disklabel -w [ -r ] disk disktype [ packid [ priboot secboot ] ]
disklabel -e [ -r ] disk
disklabel -R [ -r ] disk [ priboot secboot ]
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. The kernel's in-core label is displayed; if the disk has no label, or the partition types on the disk are incorrect, the kernel may have modified the label. If the -r flag is given, the label from the raw disk will be displayed rather than the in-core label.
The second form of the command, with the -w flag, is used to write a standard label on the designated drive. The required arguments to disklabel are the drive to be labelled (e.g. hp0), and the drive type as described in the 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 as described below. The first optional argument is a pack identification, up to 16 characters. The pack id must be quoted if it contains blanks. If the -r flag is given, the disk sectors containing the label and bootstrap will be written directly, otherwise only the label will be modified. In either case, the kernel's in-core label is replaced. On machines that require a block-0 bootstrap, the -r flag is assumed with -w . An alternate version of the bootstrap 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 /usr/mdec , with names of the form disktype boot for the primary (block 0) bootstrap, and boot disktype for the secondary (block 1-15) bootstrap; for example, /usr/mdec/hpboot and /usr/mdec/boothp.
An existing disk label may be edited by using the -e flag. The label is read from the in-core kernel copy, or directly from the disk if the -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, vi (1) is used. When the editor terminates, the formatted label is reread and used to rewrite the disk label.
Finally, disklabel is capable of restoring a disk label that was formatted in a prior operation and saved in an ascii file by the use of the -R flag. The prototype file used to create the label is exactly that produced when reading or editing a label. A block-0 bootstrap is also installed on machines that use one.