don't look for consoles except on 630
[unix-history] / usr / src / sbin / disklabel / disklabel.5.5
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.\"
afbc24d7 6.\" @(#)disklabel.5.5 6.2 (Berkeley) %G%
37adbef5
MK
7.\"
8.TH DISKLABEL 5 ""
9.UC 7
10.SH NAME
11disklabel \- disk pack label
12.SH SYNOPSIS
13.B #include <sys/disklabel.h>
14.SH DESCRIPTION
15Each disk or disk pack on a system may contain a disk label
16which provides detailed information
17about the geometry of the disk and the partitions into which the disk
18is divided.
19It should be initialized when the disk is formatted,
20and may be changed later with the
21.IR disklabel (8)
22program.
23This information is used by the system disk driver and by the bootstrap
24program to determine how to program the drive
25and where to find the filesystems on the disk partitions.
26Additional information is used by the filesystem in order
27to use the disk most efficiently and to locate important filesystem information.
afbc24d7
MK
28The description of each partition contains an identifier for the partition
29type (standard filesystem, swap area, etc.).
30The filesystem updates the in-core copy of the label if it contains
31incomplete information about the filesystem.
32.PP
37adbef5
MK
33The label is located in sector number
34.I LABELSECTOR
35of the drive, usually sector 0 where it may be found
36without any information about the disk geometry.
37It is at an offset
38.I LABELOFFSET
39from the beginning of the sector, to allow room for the initial bootstrap.
afbc24d7
MK
40The disk sector containing the label is normally made read-only
41so that it is not accidentally overwritten by pack-to-pack copies
42or swap operations;
43the DIOCWLABEL
44.IR ioctl ,
45which is done as needed by the
46.IR disklabel (8)
47program.
48.PP
49A copy of the in-core label for a disk can be obtained with the DIOCGDINFO
50.IR ioctl ;
51this works with a file descriptor for a block or character (``raw'') device
52for any partition of the disk.
53The in-core copy of the label is set by the DIOCSDINFO
54.IR ioctl .
55The offset of a partition cannot generally be changed while it is open,
56nor can it be made smaller while it is open.
57One exception is that any change is allowed if no label was found
58on the disk, and the driver was able to construct only a skeletal label
59without partition information.
60Finally, the DIOCWDINFO
61.I ioctl
62operation sets the in-core label and then updates the on-disk label;
63there must be an existing label on the disk for this operation to succeed.
64Thus, the initial label for a disk or disk pack must be installed
65by writing to the raw disk.
66All of these operations are normally done using
67.IR disklabel (8).
68.PP
37adbef5
MK
69The format of the disk label, as specified in
70.RI < sys/disklabel.h >,
71is
72.nf
73.DT
74.so /usr/include/sys/disklabel.h
75.SH "SEE ALSO"
76disktab(5), disklabel(8)