Merge branch 'vendor/LIBRESSL'
[dragonfly.git] / sbin / disklabel64 / disklabel64.5
1 .\" Copyright (c) 1987, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" This code is derived from software contributed to Berkeley by
5 .\" Symmetric Computer Systems.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\" 3. Neither the name of the University nor the names of its contributors
16 .\"    may be used to endorse or promote products derived from this software
17 .\"    without specific prior written permission.
18 .\"
19 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 .\" SUCH DAMAGE.
30 .\"
31 .\"     @(#)disklabel.5.5       8.1 (Berkeley) 6/5/93
32 .\" $FreeBSD: src/sbin/disklabel/disklabel.5,v 1.7.2.4 2002/08/21 18:58:16 trhodes Exp $
33 .\" $DragonFly: src/sbin/disklabel64/disklabel64.5,v 1.3 2008/08/21 21:59:23 thomas Exp $
34 .\"
35 .Dd August 21, 2008
36 .Dt DISKLABEL64 5
37 .Os
38 .Sh NAME
39 .Nm disklabel64
40 .Nd 64 bit disk pack label
41 .Sh SYNOPSIS
42 .In sys/disklabel64.h
43 .Sh DESCRIPTION
44 Each disk or disk pack on a system may contain a 64 bit disk label
45 which provides detailed information
46 the disk and the partitions into which the disk
47 is divided.
48 It should be initialized when the disk is formatted,
49 and may be changed later with the
50 .Xr disklabel64 8
51 program.
52 This information is used by the system disk driver
53 to determine how to program the drive.
54 Additional information is used by the file system in order
55 to locate important file system information.
56 The description of each partition contains an identifier for the partition
57 type (standard file system, swap area, etc.).
58 The file system updates the in-core copy of the label if it contains
59 incomplete information about the file system.
60 .Pp
61 The label is located in byte number 0 where it may be found
62 without any information about the disk geometry.
63 The disk sector containing the label is normally made read-only
64 so that it is not accidentally overwritten by pack-to-pack copies
65 or swap operations;
66 the
67 .Dv DIOCWLABEL
68 .Xr ioctl 2 ,
69 which is done as needed by the
70 .Xr disklabel64 8
71 program.
72 .Pp
73 A copy of the in-core label for a disk can be obtained with the
74 .Dv DIOCGDINFO64
75 .Xr ioctl 2 ;
76 this works with a file descriptor for a block or character
77 .Pq Dq raw
78 device
79 for any partition of the disk.
80 The in-core copy of the label is set by the
81 .Dv DIOCSDINFO64
82 .Xr ioctl 2 .
83 The offset of a partition cannot generally be changed while it is open,
84 nor can it be made smaller while it is open.
85 One exception is that any change is allowed if no label was found
86 on the disk, and the driver was able to construct only a skeletal label
87 without partition information.
88 Finally, the
89 .Dv DIOCWDINFO64
90 .Xr ioctl 2
91 operation sets the in-core label and then updates the on-disk label;
92 there must be an existing label on the disk for this operation to succeed.
93 Thus, the initial label for a disk or disk pack must be installed
94 by writing to the raw disk.
95 All of these operations are normally done using
96 .Xr disklabel64 8 .
97 .Pp
98 The format of the 64 bit disk label is specified in
99 .In sys/disklabel64.h .
100 .Sh SEE ALSO
101 .Xr disklabel32 5 ,
102 .Xr disktab 5 ,
103 .Xr disklabel64 8