xref: /netbsd-src/share/man/man4/dk.4 (revision 3117ece4fc4a4ca4489ba793710b60b0d26bab6c)
1.\"	$NetBSD: dk.4,v 1.15 2024/04/03 00:40:46 uwe 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.
135.Pp
136For each partition, a wedge is created with a name of the format
137.Sm off
138.Li ATARI_ Bro Ar type Brc Li _ Bro Ar number Brc
139.Sm on
140where
141.Ar type
142may either be
143.Ql GEM
144or
145.Ql BGM .
146The first partition typically corresponds to the
147.Ql C:
148drive when read on an actual Atari, the second to
149.Ql D:
150and so on.
151Extended partitions
152.Pq those of type Ql XGM
153are not currently supported.
154.El
155.Sh FILES
156.Bl -tag -width Pa -compact
157.It Pa /dev/dk*
158Block mode
159.Nm
160device special files.
161.It Pa /dev/rdk*
162Raw mode
163.Nm
164device special files.
165.El
166.Sh SEE ALSO
167.Xr config 1 ,
168.Xr disklabel 8 ,
169.Xr dkctl 8 ,
170.Xr fdisk 8 ,
171.Xr gpt 8 ,
172.Xr MAKEDEV 8
173.Sh HISTORY
174The
175.Nm
176driver first appeared in
177.Nx 3.0 .
178.Sh AUTHORS
179The
180.Nm
181driver was written by
182.An Jason R. Thorpe .
183