Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ disklabel(8) — OSF/1 X2.0-8 MIPS

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

disklabel(4)

disktab(4)

disklabel(8)  —  Maintenance

OSF

NAME

disklabel − Reads and writes disk pack label

SYNOPSIS

disklabel [−r] disk

disklabel −w [−r] disk disktype [packid] [primary-boot secondary-boot]

disklabel −e [−r] disk

disklabel −R [−r] disk protofile [disktype | primary-boot secondary-boot]

disklabel [−N | −W] disk

The disklabel command can be used to install, examine, or modify the label on a disk drive or pack. 

FLAGS

−eEdits an existing label. 

−rReads or writes the label directly to or from the disk, rather than going through the in-core copy of the label. 

−RRestores a disk label that was formatted in a prior operation and saved in an ASCII file. 

−wWrites a standard label on the designated drive. 

−NDisallows writing of the pack label area on the specified disk. 

−WAllows writing of the pack label area on the specified disk. 

DESCRIPTION

When writing the label, disklabel can be used to change the drive identification or the disk partitions on the drive, or to replace a damaged label or bootstrap.  The disk label is located on one of the first sectors of each disk (usually block 0).  On machines that require a block-0 bootstrap, the label is inserted into the bootstrap program.  This information is used by the system disk driver and by the bootstrap program to determine how to program the drive.  There are several forms of the command that display, install or modify the label on a disk. 

Each form has an additional option, −r, which causes the label to be read from or written to the disk directly, rather than going through the system’s in-core copy of the label.  When writing, the in-core copy is also updated, if possible.  This option may allow a label to be installed on a disk without kernel support for a label, such as when labels are first installed on a system; it must be used when first installing a label on a disk. 

The first form of the command is used to examine the label on the named disk drive (for example, rz0 or /dev/rrz0c).  It will display all of the parameters associated with the drive and its partition layout.  Unless the −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 −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 labeled (for example, rz0), and the drive type as described in the /etc/disktab 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 optional packid argument is a pack identification string, up to 16 characters long. the packid argument 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 the existing label will be updated in place without modifying the bootstrap. 

If the disk does not already have a label, the −r flag must be used.  In either case, the kernel’s in-core label is replaced.  Alternate versions of the bootstrap files may be specified (primary-boot and secondary-boot) after the packid argument.  If an alternate bootstrap is not specified, the standard bootstrap will be used. 

The bootstrap programs are located in /usr/mdec.  The names of the bootstrap programs may be specified in /etc/disktab; if not specified, the default names are of the form basename boot for the primary (block 0) bootstrap, and boot basename for the secondary (block 1-15) bootstrap.  For example, the names are /usr/mdec/rzboot and /usr/mdec/bootrz if the disk device is rz0. 

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 is used.  When the editor terminates, the formatted label is reread and used to rewrite the disk label. 

With the −R flag, disklabel is capable of restoring a disk label that was formatted in a prior operation and saved in an ASCII file.  The specified prototype file used to create the label, protofile, should be in the same format as that produced when reading or editing a label.  Comments are delimited by number signs (#) and newline.  If the −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. 

Finally, the −N and −W flags explicitly disallow and allow, respectively, writing of the pack label area on the selected disk.  The label sector is always write-protected when the drive is first opened; the write-enable flag set by −W persists only until all partitions on the drive are closed. 

NOTES

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 "a" or "c" 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 "a" partition. 

FILES

/etc/disktabContains information about disks and drives. 

/usr/mdec/xxbootPrimary bootstrap programs. 

/usr/mdec/bootxxSecondary bootstrap programs. 

RELATED INFORMATION

Files: disklabel(4), disktab(4)
 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026