.\" Copyright (c) 1987, 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" Symmetric Computer Systems. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgment: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)disklabel.5.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD: src/sbin/disklabel/disklabel.5,v 1.7.2.4 2002/08/21 18:58:16 trhodes Exp $ .\" $DragonFly: src/sbin/disklabel/disklabel.5,v 1.6 2008/08/21 21:08:08 thomas Exp $ .\" .Dd August 21, 2008 .Dt DISKLABEL32 5 .Os .Sh NAME .Nm disklabel32 .Nd 32 bit disk pack label .Sh SYNOPSIS .In sys/disklabel.h .Sh DESCRIPTION Each disk or disk pack on a system may contain a disk label which provides detailed information about the geometry of the disk and the partitions into which the disk is divided. It should be initialized when the disk is formatted, and may be changed later with the .Xr disklabel32 8 program. This information is used by the system disk driver and by the bootstrap program to determine how to program the drive and where to find the file systems on the disk partitions. Additional information is used by the file system in order to use the disk most efficiently and to locate important file system information. The description of each partition contains an identifier for the partition type (standard file system, swap area, etc.). The file system updates the in-core copy of the label if it contains incomplete information about the file system. .Pp The label is located in sector number .Dv LABELSECTOR of the drive, usually sector 0 where it may be found without any information about the disk geometry. It is at an offset .Dv LABELOFFSET from the beginning of the sector, to allow room for the initial bootstrap. The disk sector containing the label is normally made read-only so that it is not accidentally overwritten by pack-to-pack copies or swap operations; the .Dv DIOCWLABEL .Xr ioctl 2 , which is done as needed by the .Xr disklabel32 8 program. .Pp A copy of the in-core label for a disk can be obtained with the .Dv DIOCGDINFO .Xr ioctl 2 ; this works with a file descriptor for a block or character (``raw'') device for any partition of the disk. The in-core copy of the label is set by the .Dv DIOCSDINFO .Xr ioctl 2 . The offset of a partition cannot generally be changed while it is open, nor can it be made smaller while it is open. One exception is that any change is allowed if no label was found on the disk, and the driver was able to construct only a skeletal label without partition information. Finally, the .Dv DIOCWDINFO .Xr ioctl 2 operation sets the in-core label and then updates the on-disk label; there must be an existing label on the disk for this operation to succeed. Thus, the initial label for a disk or disk pack must be installed by writing to the raw disk. All of these operations are normally done using .Xr disklabel32 8 . .Pp The format of the disk label is specified in .In sys/disklabel32.h . .Sh SEE ALSO .Xr disklabel64 5 , .Xr disktab 5 , .Xr disklabel32 8