1md(7D) Devices md(7D)
2
3
4
6 md - user configurable pseudo device driver
7
9 md is a user configurable pseudo device driver that provides disk con‐
10 catenation, striping, mirroring, RAID5 metadevices, trans metadevices,
11 and hot spare utilities. Trans devices are no longer supported and have
12 been replaced by UFS logging. See mount_ufs(1M).
13
14
15 The block devices access the disk using the system's normal buffering
16 mechanism and are read and written without regard to physical disk
17 records. There is also a ``raw'' device which provides for direct
18 transmission between the disk and the user's read or write buffer. A
19 single read or write call usually results in one I/O operation; raw I/O
20 is therefore considerably more efficient when many bytes are transmit‐
21 ted. The names of the block devices are found in /dev/md/dsk; the names
22 of the raw devices are found in /dev/md/rdsk. Metadevices have the
23 appearance of whole disks; there are no slices (partitions).
24
25
26 I/O requests (such as lseek(2)) to the metadevices must have an offset
27 that is a multiple of 512 bytes (DEV_BSIZE), or the driver returns an
28 EINVAL error. If the transfer length is not a multiple of 512 bytes,
29 the tranfer count is rounded up by the driver.
30
31
32 The md pseudo device drivers support all disk devices on all Solaris
33 2.4 or later Solaris systems.
34
36 This section provides a list of the ioctls supported by the metadisk
37 driver.
38
39
40 The following ioctls are valid when issued to the raw metadevice, such
41 as /dev/md/rdsk/d0. See dkio(7I) for additional information.
42
43 DKIOCGGEOM This ioctl is used to get the disk geometry. The metadisk
44 driver fills in the dkg_nhead, dkg_nsect, dkg_rpm,
45 dkg_write_reinstruct and dkg_read_reinstruct from the
46 first component of the metadevice (at metainit time).
47 dkg_ncyl is calculated using the size of the metadevice
48 (reported by metastat) divided by (dkg_nhead *
49 dkg_nsect). The total size is always a multiple of
50 (dkg_nhead * dkg_nsect). If the first component of a
51 metadevice does not start on cylinder number 0, then the
52 dkg_ncyl is increased by one cylinder; because DKIOCGVTOC
53 reports the metadevice as starting on cylinder 1. The
54 side effect here is that it looks like cylinder 0 is not
55 being used, but all the arithmetic works out correctly.
56 If the metadevice is not set up, then ENXIO is returned.
57
58
59 DKIOCINFO When issued to the administrative device or metadevice,
60 this ioctl sets dki_unit to the unit number of the
61 metadevice, dki_ctype to a value of DKC_MD, and dki_par‐
62 tition to 0, because there are no slices.
63
64
65 DKIOCGVTOC This ioctl returns the current vtoc. If one has not been
66 written, then a default vtoc is returned. v_nparts is
67 always 1. v_part[0].p_start is 0 if the first component
68 of the metadevice starts on cylinder 0. Otherwise, the
69 p_start field is the starting sector of cylinder 1.
70 v_part[0].p_size is the same as the total size reported
71 by metastat.
72
73
74 DKIOCSVTOC This ioctl stores the vtoc in the metadevice state data‐
75 base so it is persistent across reboots.
76
77
79 Notice Log Messages
80 The informative log messages include:
81
82 md: dnum: Hotspared device dev with dev
83
84
85
86 The first device name listed has been hot spare replaced with the sec‐
87 ond device name listed.
88
89 md: dnum: Hotspared device dev(num,num) with dev(num,num)
90
91
92
93 The first device number listed has been hot spare replaced with the
94 second device number listed.
95
96 md: Could not load misc /dev
97
98
99
100 The named misc module is not loadable. It is possibly missing, or some‐
101 thing else has been copied over it.
102
103 md: dnum: no mem for property dev
104
105
106
107 Memory could not be allocated in the prop_op entry point.
108
109 md: db: Parsing error on 'dev'
110
111
112
113
114
115 Set command in /kernel/drv/md.conf for the mddb.bootlist <number> is
116 not in the correct format. metadb -p can be run to put the correct set
117 commands into the /kernel/drv/md.conf file.
118
119 md: dnum: dev(num,num) needs maintenance
120 md: dnum: dev needs maintenance
121
122
123
124 An I/O or open error has occurred on a device within a mirror causing a
125 component in the mirror to change to the Maintenance state.
126
127
128 md: dnum: dev(num,num) last erred md: dnum: dev last erred
129
130
131 An I/O or open error has occurred on a device within a mirror and the
132 data is not replicated elsewhere in the mirror. This is causing the
133 component in the mirror to change to the Last Erred state.
134
135 Warning Log Messages
136 The warning log messages include:
137
138 md: State database is stale
139
140
141
142 This error message comes when there are not enough usable replicas for
143 the state database to be able to update records in the database. All
144 accesses to the metadevice driver will fail. To fix this problem, more
145 replicas need to be added or inaccessible replicas need to be deleted.
146
147 md: dnum: read error on devmd: dnum: write error on dev
148
149
150
151 A read or write error has occurred on the specified submirror, at the
152 specified device name. This happens if any read or write errors occur
153 on a submirror.
154
155 md: dnum: read error on dev(num,num)md: dnum: write error on dev(
156 num,num)
157
158
159
160 A read or write error has occurred on the specified submirror, at the
161 specified device number. This happens if any read or write errors occur
162 on a submirror.
163
164 md: State database commit failed
165 md: State database delete failed
166
167
168
169 These messages occur when there have been device errors on components
170 where the state database replicas reside. These errors only occur when
171 more than half of the replicas have had device errors returned to them.
172 For instance, if you have three components with state database replicas
173 and two of the components report errors, then these errors may occur.
174 The state database commit or delete is retried periodically. If a
175 replica is added, then the commit or delete will finish and the system
176 will be operational. Otherwise the system will timeout and panic.
177
178 md: dnum: Cannot load dev driver
179
180
181
182
183 Underlying named driver module is not loadable (for example, sd, id,
184 xy, or a third-party driver). This could indicate that the driver mod‐
185 ule has been removed.
186
187 md: Open error of hotspare devmd: Open error of hotspare dev(num,num)
188
189
190
191 Named hotspare is not openable, or underlying driver is not loadable.
192
193 Panic Log Messages
194 The panic log messages include:
195
196 md: dnum: Unknown close typemd: dnum: Unknown open type
197
198
199
200 Metadevice is being opened/closed with an unknown open type (OTYP).
201
202 md: State database problem
203
204
205
206 Failed metadevice state database commit or delete has been retried the
207 default 100 times.
208
210 /dev/md/dsk/dn block device (where n is the device num‐
211 ber)
212
213
214 /dev/md/rdsk/dn raw device (where n is the device number)
215
216
217 /dev/md/setname/dsk/dn block device (where setname is the name
218 of the diskset and n is the device num‐
219 ber)
220
221
222 /dev/md/setname/rdsk/dn raw device (where setname is the name of
223 the diskset and n is the device number)
224
225
226 /dev/md/admin administrative device
227
228
229 /kernel/drv/md driver module
230
231
232 /kernel/drv/md.conf driver configuration file
233
234
235 /kernel/misc/md_stripe stripe driver misc module
236
237
238 /kernel/misc/md_mirror mirror driver misc module
239
240
241 /kernel/misc/md_hotspares hotspares driver misc module
242
243
244 /kernel/misc/md_trans metatrans driver for UFS logging
245
246
247 /kernel/misc/md_raid RAID5 driver misc module
248
249
251 mdmonitord(1M), metaclear(1M), metadb(1M), metadetach(1M), metahs(1M),
252 metainit(1M), metaoffline(1M), metaonline(1M), metaparam(1M), metare‐
253 cover(1M), metarename(1M), metareplace(1M), metaroot(1M), metas‐
254 sist(1M), metaset(1M), metastat(1M), metasync(1M), metattach(1M),
255 md.cf(4), md.tab(4), attributes(5),
256
257
258 Solaris Volume Manager Administration Guide
259
261 Trans metadevices have been replaced by UFS logging. Existing trans
262 devices are not logging--they pass data directly through to the under‐
263 lying device. See mount_ufs(1M) for more information about UFS logging.
264
265
266
267SunOS 5.11 29 Aug 2003 md(7D)