xref: /netbsd-src/share/man/man4/dk.4 (revision 7d62b00eb9ad855ffcd7da46b41e23feb5476fac)
1.\"	$NetBSD: dk.4,v 1.13 2021/01/06 18:05:58 wiz 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 January 6, 2021
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_BSDLABEL"
43.Cd "options DKWEDGE_METHOD_GPT"
44.Cd "options DKWEDGE_METHOD_MBR"
45.Cd "options DKWEDGE_METHOD_RDB"
46.Cd "options DKWEDGE_METHOD_APPLE"
47.Sh DESCRIPTION
48The
49.Nm
50driver provides a disk-like interface, or
51.Em wedge ,
52to an area of a physical disk.
53Wedges may be configured manually with
54.Xr dkctl 8
55or automatically by the kernel upon the attachment of the physical disk.
56.Pp
57Wedges need to have unique names.
58If a duplicate name is detected during
59auto-discovery, that partition is ignored.
60.Sh KERNEL OPTIONS
61.Bl -tag -width DKWEDGE_METHOD_BSDLABEL
62.It Dv DKWEDGE_AUTODISCOVER
63Automatically detect and configure wedges using any available methods.
64.Pp
65Currently only
66.Dv DKWEDGE_METHOD_GPT
67and
68.Dv DKWEDGE_METHOD_APPLE
69are enabled by default.
70.Pp
71For each partition found, a wedge with a corresponding name is created.
72.It Dv DKWEDGE_METHOD_BSDLABEL
73BSD disklabel detection method.
74For each configured partition in the
75.Xr disklabel 5
76that is not of type
77.Dv FS_UNUSED ,
78a wedge is created and named after the
79.Va d_packname
80field followed by
81.Sq \&/
82and the partition letter
83.So a Sc Ns \&.. Ns So p Sc .
84.Pp
85When the
86.Va d_packname
87is empty or has the value
88.Dq fictitious ,
89the regular partition names
90are used as wedge names, i.e. the device name, unit number and
91partition letter, for example
92.Dq wd0a .
93.It Dv DKWEDGE_METHOD_GPT
94Extensible Firmware Interface Globally Unique Identifier Partition Table
95(GPT) detection method.
96.Pp
97For every GPT partition a wedge is created and named after the
98partition label.
99GPT partitions are UTF-16-encoded, this is converted into UTF-8.
100If a partition has no label, its UUID is used instead.
101.It Dv DKWEDGE_METHOD_MBR
102IBM PC-compatible Master Boot Record (MBR) partitioning detection method,
103with support for Extended MBRs.
104.Pp
105For every partition in the MBR a wedge is created and named like a
106regular partition name, i.e. the device name, unit number and a
107partition letter, for example
108.Dq wd0e .
109Primary partitions start with
110.Sq e ,
111extended partitions start with
112.Sq i .
113.It Dv DKWEDGE_METHOD_RDB
114Amiga Rigid Disk Block (RDB) partitioning detection method.
115.It Dv DKWEDGE_METHOD_APPLE
116Apple partition map detection method.
117.El
118.Sh FILES
119.Bl -tag -width /dev/XXrXdkX -compact
120.It Pa /dev/{,r}dk*
121.Nm
122device special files.
123.El
124.Sh SEE ALSO
125.Xr config 1 ,
126.Xr disklabel 8 ,
127.Xr dkctl 8 ,
128.Xr fdisk 8 ,
129.Xr gpt 8 ,
130.Xr MAKEDEV 8
131.Sh HISTORY
132The
133.Nm
134driver first appeared in
135.Nx 3.0 .
136.Sh AUTHORS
137The
138.Nm
139driver was written by
140.An Jason R. Thorpe .
141