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