1.\" $NetBSD: dk.4,v 1.17 2024/11/09 03:22:25 charlotte Exp $ 2.\" 3.\" Copyright (c) 2006 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" This code is derived from software contributed to The NetBSD Foundation 7.\" by Jason R. Thorpe. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28.\" POSSIBILITY OF SUCH DAMAGE. 29.\" 30.\" Jonathan A. Kollasch used vnd(4) as the template for this man page. 31.\" 32.Dd April 2, 2024 33.Dt DK 4 34.Os 35.Sh NAME 36.Nm dk 37.Nd disk partition 38.Pq wedge 39driver 40.Sh SYNOPSIS 41.Cd "options DKWEDGE_AUTODISCOVER" 42.Cd "options DKWEDGE_METHOD_APPLE" 43.Cd "options DKWEDGE_METHOD_BSDLABEL" 44.Cd "options DKWEDGE_METHOD_GPT" 45.Cd "options DKWEDGE_METHOD_MBR" 46.Cd "options DKWEDGE_METHOD_RDB" 47.Cd "options DKWEDGE_METHOD_TOS" 48.Sh DESCRIPTION 49The 50.Nm 51driver provides a disk-like interface, or 52.Em wedge , 53to an area of a physical disk. 54Wedges may be configured manually with 55.Xr dkctl 8 56or automatically by the kernel upon the attachment of the physical disk. 57.Pp 58Wedges need to have unique names. 59If a duplicate name is detected during 60auto-discovery, that partition is ignored. 61.Sh KERNEL OPTIONS 62.Bl -tag -width Dv 63.\" 64.It Dv DKWEDGE_AUTODISCOVER 65Automatically detect and configure wedges using any available methods. 66For each partition found, a wedge with a corresponding name is created. 67.Pp 68Currently only 69.Dv DKWEDGE_METHOD_GPT 70and 71.Dv DKWEDGE_METHOD_APPLE 72are enabled by default. 73.\" 74.It Dv DKWEDGE_METHOD_APPLE 75Apple partition map detection method. 76.\" 77.It Dv DKWEDGE_METHOD_BSDLABEL 78.Tn BSD 79disklabel detection method. 80For each configured partition in the 81.Xr disklabel 5 82that is not of type 83.Dv FS_UNUSED , 84a wedge is created and named after the 85.Fa d_packname 86field followed by 87.Ql \&/ 88and the partition letter 89.Sm off 90.So Li a Sc \&.. So Li p Sc . 91.Sm on 92.Pp 93When the 94.Fa d_packname 95is empty or has the value 96.Ql fictitious , 97the regular partition names 98are used as wedge names, i.e. the device name, unit number and 99partition letter, for example 100.Ql wd0a . 101.\" 102.It Dv DKWEDGE_METHOD_GPT 103Extensible Firmware Interface Globally Unique Identifier Partition Table 104.Tn ( GPT ) 105detection method. 106.Pp 107For every GPT partition a wedge is created and named after the 108partition label. 109GPT partitions are UTF-16\(enencoded, this is converted into UTF-8. 110If a partition has no label, its UUID is used instead. 111.\" 112.It Dv DKWEDGE_METHOD_MBR 113IBM PC-compatible Master Boot Record 114.Tn ( MBR ) 115partitioning detection method, with support for Extended MBRs. 116.Pp 117For every partition in the MBR a wedge is created and named like a 118regular partition name, i.e. the device name, unit number and a 119partition letter, for example 120.Ql wd0e . 121Primary partitions start with 122.Ql e , 123extended partitions start with 124.Ql i . 125.\" 126.It Dv DKWEDGE_METHOD_RDB 127Amiga Rigid Disk Block 128.Tn ( RDB ) 129partitioning detection method. 130.\" 131.It Dv DKWEDGE_METHOD_TOS 132Atari's 133.Tn TOS 134partition map detection method, for disks that conform to Atari's AHDI 135specification. 136.Pp 137For each partition, a wedge is created with a name of the format 138.Sm off 139.Li ATARI_ Bro Ar type Brc Li _ Bro Ar number Brc 140.Sm on 141where 142.Ar type 143may either be 144.Ql GEM 145or 146.Ql BGM . 147The number 0 partition typically corresponds to the 148.Ql C: 149drive when read on an actual Atari, the next to 150.Ql D: 151and so on. 152Extended partitions 153.Pq those of type Ql XGM 154are not currently supported. 155.El 156.Sh FILES 157.Bl -tag -width Pa -compact 158.It Pa /dev/dk* 159Block mode 160.Nm 161device special files. 162.It Pa /dev/rdk* 163Raw mode 164.Nm 165device special files. 166.El 167.Sh SEE ALSO 168.Xr config 1 , 169.Xr disklabel 8 , 170.Xr dkctl 8 , 171.Xr fdisk 8 , 172.Xr gpt 8 , 173.Xr MAKEDEV 8 174.Sh HISTORY 175The 176.Nm 177driver first appeared in 178.Nx 3.0 . 179.Sh AUTHORS 180The 181.Nm 182driver was written by 183.An Jason R. Thorpe . 184