Index Index for
Section 9
Index Alphabetical
listing for D
Bottom of page Bottom of
page

disklabel(9s)

NAME

disklabel - Disk: Stores disk device label information

SYNOPSIS

struct disklabel { u_int d_magic; short d_type; short d_subtype; char d_typename[16]; union { char un_d_packname[16]; struct { char *un_d_boot0; char *un_d_boot1; } un_b; } d_un; u_int d_secsize; u_int d_nsectors; u_int d_ntracks; u_int d_ncylinders; u_int d_secpercyl; u_int d_secperunit; u_short d_sparespertrack; u_short d_sparespercyl; u_int d_acylinders; u_short d_rpm; u_short d_interleave; u_short d_trackskew; u_short d_cylskew; u_int d_headswitch; u_int d_trkseek; u_int d_flags; u_int d_drivedata[NDDATA]; u_int d_spare[NSPARE]; u_int d_magic2; u_short d_checksum; u_short d_npartitions; u_int d_bbsize; u_int d_sbsize; struct partition { u_int p_size; u_int p_offset; u_int p_fsize; u_char p_fstype; u_char p_frag; u_short p_cpg; } d_partitions[MAXPARTITIONS]; };

MEMBERS

d_magic The magic number DISKMAGIC identifies this as a disklabel structure. d_type Specifies the type of driver. See the DESCRIPTION section for the constants associated with the d_type member. d_subtype Specifies the device subtype specific to the controller or device type. d_typename Specifies up to a 16-character string array that gives the type name. The following type name strings are recognized: unknown, SMD, MSCP, old DEC, SCSI, ESDI, type 6, type 7, type 8, type 9, floppy, and SWXCR. d_packname Specifies the pack identifier returned when the disklabel is read off the disk or in-core copy. The d_boot0 and d_boot1 #defines are the (optional) names of the primary (block 0) and secondary (block 1-15) bootstraps as found in /usr/mdec. These are returned when using getdiskbyname to retrieve the values from /etc/disktab. d_secsize Specifies the number of bytes per sector. d_nsectors Specifies the number of data sectors per track. d_ntracks Specifies the number of tracks per cylinder. d_ncylinders Specifies the number of data cylinders per unit. d_secpercyl Specifies the number of data sectors per cylinder. d_secperuniit Specifies the number of data sectors per unit. d_sparespertrack Specifies the number of spare sectors per track. Spares are used for bad sector replacements and are not counted in d_nsectors or d_secpercyl. Spare sectors are assumed to be physical sectors occupying space at the end of each track, cylinder, or both. d_sparespercyl Specifies the number of spare sectors per cylinder. Spares are used for bad sector replacements and are not counted in d_nsectors or d_secpercyl. Spare sectors are assumed to be physical sectors occupying space at the end of each track, cylinder, or both. d_acylinders Specifies the number of alternate cylinders per unit. Alternate cylinders include maintenance, replacement, and configuration description areas. d_rpm Specifies rotational speed. d_interleave Specifies the physical sector interleave set up by the formatter or controller when formatting. When interleaving is in use, logically adjacent sectors are separated by some number of sectors, specified as the ratio of physical sectors traversed per logical sector. Thus, an interleave of 1:1 implies contiguous layout, while 2:1 implies that logical sector 0 is separated by one sector from logical sector 1. This member is used to compensate for a slow controller. d_trackskew Specifies the offset of sector 0 on a particular track relative to sector 0 on the previous track on the same cylinder. This member is used to compensate for a slow controller. d_cylskew Specifies the offset of sector 0 on a particular cylinder relative to sector 0 on the previous cylinder. This member is used to compensate for a slow controller. d_headswitch Specifies the head switch time in microseconds. d_trkseek Specifies track-to-track seek time in microseconds. d_flags Specifies the generic flags shared by various drives. See the DESCRIPTION section for the flags associated with the d_flags member. d_drivedata Specifies an array of integers for storing information specific to the drive type. d_magic2 Specifies the magic number. d_checksum Specifies bitwise exclusive OR (XOR) of the data, including partitions. d_npartitions Specifies the number of partitions in the partition map. d_bbsize Specifies the size of the boot area in bytes. d_sbsize Specifies the size of the superblock in bytes. d_partition Specifies an array of structures, one per partition, containing the following members: · p_size Number of sectors in the partition · p_offset Starting offset of the sector · p_fsize File system basic fragment size · p_fstype One of the following file system types: FS_UNUSED, FS_SWAP, FS_V6, FS_V7, FS_SYSV, FS_V71K, FS_V8, FS_BSDFFS, FS_ADVFS, FS_LSMpubl, FS_LSMpriv, and FS_LSMsimp. See the DESCRIPTION section for additional information on these constants. · p_frag File system fragments per block · p_cpg File system cylinders per group

DESCRIPTION

Each disk has a label that includes information about the hardware disk geometry, file system partitions, and drive-specific information. The label is in block 0 or 1, possibly offset from the beginning to leave room for bootstrap information. A device driver uses the LABELSECTOR and LABELOFFSET constants to refer to the location of the label. The disklabel structure is accessed by the disk device driver's open interface to set up the default geometry and partition 0 on the disk. The DIOCGDINFO and DIOCGPART ioctl commands use this structure to return the disklabel and partition structures; the DIOCSDINFO and DIOCWDINFO ioctl commands to set or write the contents of the structure. The d_type member takes one of the following drive type constants: DTYPE_SMD SMD, XSMD, VAX hp/up DTYPE_MSCP MSCP DTYPE_DEC DEC (rk, rl) DTYPE_SCSI SCSI DTYPE_ESDI ESDI interface DTYPE_ST506 ST506 etc. DTYPE_FLOPPY floppy diskette DTYPE_SWXCR StorageWorks (RAID) The d_flags member takes one of the following flags: D_REMOVABLE Removable media D_ECC Supports ECC D_RAMDISK Disk emulator D_CHAIN Supports back-to-back transfers D_DYNAM_GEOM Dynamic geometry device The p_fstype member of the d_partitions member takes one of the following file system types: FS_UNUSED Unused FS_SWAP Swap FS_V6 Sixth edition FS_V7 Seventh edition FS_SYSV System V FS_V71K Version 7, 1K blocks FS_V8 8th edition, 4K blocks FS_BSDFFS 4.2BSD, fast file system FS_ADVFS Advanced File System FS_LSMpubl Logical Storage Manager, public region FS_LSMpriv Logical Storage Manager, private region FS_LSMsimp Logical Storage Manager, simple disk

FILES

<sys/disklabel.h>

SEE ALSO

Kernel Interfaces: readdisklabel(9r), setdisklabel(9r), writedisklabel(9r) ioctl Commands: DIOCGDINFO(9r), DIOCGPART(9r), DIOCSDINFO(9r), DIOCWDINFO(9r)

Index Index for
Section 9
Index Alphabetical
listing for D
Top of page Top of
page