Print this page
12315 errors in section 7i of the manual
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man7i/dkio.7i.man.txt
+++ new/usr/src/man/man7i/dkio.7i.man.txt
1 1 DKIO(7I) Ioctl Requests DKIO(7I)
2 2
3 3 NAME
4 4 dkio - disk control operations
5 5
6 6 SYNOPSIS
7 7 #include <sys/dkio.h>
8 8 #include <sys/vtoc.h>
9 9
10 10 DESCRIPTION
11 11 Disk drivers support a set of ioctl(2) requests for disk controller,
12 12 geometry, and partition information. Basic to these ioctl(2) requests
13 13 are the definitions in <sys/dkio.h>.
14 14
15 15 IOCTLS
16 16 The following ioctl(2) requests set and/or retrieve the current disk
17 17 controller, partitions, or geometry information on all architectures:
18 18
19 19 DKIOCINFO
20 20
21 21 The argument is a pointer to a dk_cinfo structure (described below).
22 22 This structure tells the controller-type and attributes regarding bad-
23 23 block processing done on the controller.
24 24
25 25 /*
26 26 * Structures and definitions for disk I/O control commands
27 27 */
28 28 #define DK_DEVLEN 16 /* device name max length, */
29 29 /* including unit # and NULL */
30 30
31 31 /* Used for controller info */
32 32 struct dk_cinfo {
33 33 char dki_cname[DK_DEVLEN]; /* controller name */
34 34 /* (no unit #) */
35 35 ushort_t dki_ctype; /* controller type */
36 36 ushort_t dki_flags; /* flags */
37 37 ushort_t dki_cnum; /* controller number */
38 38 uint_t dki_addr; /* controller address */
39 39 uint_t dki_space; /* controller bus type */
40 40 uint_t dki_prio; /* interrupt priority */
41 41 uint_t dki_vec; /* interrupt vector */
42 42 char dki_dname[DK_DEVLEN]; /* drive name (no unit #) */
43 43 uint_t dki_unit; /* unit number */
44 44 uint_t dki_slave; /* slave number */
45 45 ushort_t dki_partition; /* partition number */
46 46 ushort_t dki_maxtransfer; /* maximum transfer size */
47 47 /* in DEV_BSIZE */
48 48 };
49 49
50 50 /*
51 51 * Controller types
52 52 */
53 53 #define DKC_UNKNOWN 0
54 54 #define DKC_CDROM 1 /* CD-ROM, SCSI or other */
55 55 #define DKC_WDC2880 2
56 56 #define DKC_XXX_0 3 /* unassigned */
57 57 #define DKC_XXX_1 4 /* unassigned */
58 58 #define DKC_DSD5215 5
59 59 #define DKC_ACB4000 7
60 60 #define DKC_XXX_2 9 /* unassigned */
61 61 #define DKC_NCRFLOPPY 10
62 62 #define DKC_SMSFLOPPY 12
63 63 #define DKC_SCSI_CCS 13 /* SCSI CCS compatible */
64 64 #define DKC_INTEL82072 14 /* native floppy chip */
65 65 #define DKC_INTEL82077 19 /* 82077 floppy disk */
66 66 /* controller */
67 67 #define DKC_DIRECT 20 /* Intel direct attached */
68 68 /* device (IDE) */
69 69 #define DKC_PCMCIA_MEM 21 /* PCMCIA memory disk-like */
70 70 /* type */
71 71 #define DKC_PCMCIA_ATA 22 /* PCMCIA AT Attached type */
72 72
73 73 /*
74 74 * Sun reserves up through 1023
75 75 */
76 76
77 77 #define DKC_CUSTOMER_BASE 1024
78 78
79 79 /*
80 80 * Flags
81 81 */
82 82 #define DKI_BAD144 0x01 /* use DEC std 144 */
83 83 /* bad sector fwding */
84 84 #define DKI_MAPTRK 0x02 /* controller does */
85 85 /* track mapping */
86 86 #define DKI_FMTTRK 0x04 /* formats only full
87 87 /* track at a time */
88 88 #define DKI_FMTVOL 0x08 /* formats only full */
89 89 /* volume at a time */
90 90 #define DKI_FMTCYL 0x10 /* formats only full */
91 91 /* cylinders at a time */
92 92 #define DKI_HEXUNIT 0x20 /* unit number printed */
93 93 /* as 3 hexdigits */
94 94 #define DKI_PCMCIA_PFD 0x40 /* PCMCIA pseudo-floppy */
95 95 /* memory card */
96 96
97 97 DKIOCGAPART
98 98
99 99 The argument is a pointer to a dk_allmap structure (described below).
100 100 This ioctl(2) gets the controller's notion of the current partition
101 101 table for disk drive.
102 102
103 103 DKIOCSAPART
104 104
105 105 The argument is a pointer to a dk_allmap structure (described below).
106 106 This ioctl(2) sets the controller's notion of the partition table
107 107 without changing the disk itself.
108 108
109 109 /*
110 110 * Partition map (part of dk_label)
111 111 */
112 112 struct dk_map {
113 113 daddr_t dkl_cylno; /* starting cylinder */
114 114 daddr_t dkl_nblk; /* number of blocks */
115 115 };
116 116
117 117 /*
118 118 * Used for all partitions
119 119 */
120 120 struct dk_allmap {
121 121 struct dk_map dka_map[NDKMAP];
122 122 };
123 123
124 124 DKIOCGGEOM
125 125
126 126 The argument is a pointer to a dk_geom structure (described below).
127 127 This ioctl(2) gets the controller's notion of the current geometry of
128 128 the disk drive.
129 129
130 130 DKIOCSGEOM
131 131
132 132 The argument is a pointer to a dk_geom structure (described below).
133 133 This ioctl(2) sets the controller's notion of the geometry without
134 134 changing the disk itself.
135 135
136 136 DKIOCGVTOC
137 137
138 138 The argument is a pointer to a vtoc structure (described below). This
139 139 ioctl(2) returns the device's current volume table of contents (VTOC).
140 140 For disks larger than 1TB, DKIOCGEXTVTOC must be used instead.
141 141
142 142 DKIOCSVTOC
143 143
144 144 The argument is a pointer to a vtoc structure (described below). This
145 145 ioctl(2) changes the VTOC associated with the device. For disks
146 146 larger than 1TB, DKIOCSEXTVTOC must be used instead.
147 147
148 148 struct partition {
149 149 ushort_t p_tag; /* ID tag of partition */
150 150 ushort_t p_flag; /* permission flags */
151 151 daddr_t p_start; /* start sector of partition */
152 152 long p_size; /* # of blocks in partition */
153 153 };
154 154
155 155 If DKIOCSVTOC is used with a floppy diskette, the p_start field must
156 156 be the first sector of a cylinder. To compute the number of sectors
157 157 per cylinder, multiply the number of heads by the number of sectors
158 158 per track.
159 159
160 160 struct vtoc {
161 161 unsigned long v_bootinfo[3]; /* info needed by mboot */
162 162 /* (unsupported) */
163 163 unsigned long v_sanity; /* to verify vtoc */
164 164 /* sanity */
165 165 unsigned long v_version; /* layout version */
166 166 char v_volume[LEN_DKL_VVOL]; /* volume name */
167 167 ushort_t v_sectorsz; /* sector size in bytes */
168 168 ushort_t v_nparts; /* number of partitions */
169 169 unsigned long v_reserved[10]; /* free space */
170 170 struct partition v_part[V_NUMPAR]; /* partition headers */
171 171 time_t timestamp[V_NUMPAR]; /* partition timestamp */
172 172 /* (unsupported) */
173 173 char v_asciilabel[LEN_DKL_ASCII]; /* compatibility */
174 174 };
175 175
176 176 /*
177 177 * Partition permission flags
178 178 */
179 179 #define V_UNMNT 0x01 /* Unmountable partition */
180 180 #define V_RONLY 0x10 /* Read only */
181 181
182 182 /*
183 183 * Partition identification tags
184 184 */
185 185 #define V_UNASSIGNED 0x00 /* unassigned partition */
186 186 #define V_BOOT 0x01 /* Boot partition */
187 187 #define V_ROOT 0x02 /* Root filesystem */
188 188 #define V_SWAP 0x03 /* Swap filesystem */
189 189 #define V_USR 0x04 /* Usr filesystem */
190 190 #define V_BACKUP 0x05 /* full disk */
191 191 #define V_VAR 0x07 /* Var partition */
192 192 #define V_HOME 0x08 /* Home partition */
193 193 #define V_ALTSCTR 0x09 /* Alternate sector partition */
194 194
195 195 DKIOCGEXTVTOC
196 196
197 197 The argument is a pointer to an extvtoc structure (described below).
198 198 This ioctl returns the device's current volume table of contents
199 199 (VTOC). VTOC is extended to support a disk up to 2TB in size. For
200 200 disks larger than 1TB this ioctl must be used instead of DKIOCGVTOC.
201 201
202 202 DKIOCSEXTVTOC
203 203
204 204 The argument is a pointer to an extvtoc structure (described below).
205 205 This ioctl changes the VTOC associated with the device. VTOC is
206 206 extended to support a disk up to 2TB in size. For disks larger than
207 207 1TB this ioctl must be used instead of DKIOCSVTOC.
208 208
209 209 struct extpartition {
210 210 ushort_t p_tag; /* ID tag of partition */
211 211 ushort_t p_flag; /* permission flags */
212 212 ushort_t p_pad[2]; /* reserved */
213 213 diskaddr_t p_start; /* start sector no of partition */
214 214 diskaddr_t p_size; /* # of blocks in partition */
215 215 };
216 216
217 217 struct extvtoc {
218 218 uint64_t v_bootinfo[3]; /* info needed by mboot (unsupported) */
219 219 uint64_t v_sanity; /* to verify vtoc sanity */
220 220 uint64_t v_version; /* layout version */
221 221 char v_volume[LEN_DKL_VVOL]; /* volume name */
222 222 ushort_t v_sectorsz; /* sector size in bytes */
223 223 ushort_t v_nparts; /* number of partitions */
224 224 ushort_t pad[2];
225 225 uint64_t v_reserved[10];
226 226 struct extpartition v_part[V_NUMPAR]; /* partition headers */
227 227 uint64_t timestamp[V_NUMPAR]; /* partition timestamp */
228 228 /* (unsupported) */
229 229 char v_asciilabel[LEN_DKL_ASCII]; /* for compatibility */
230 230 };
231 231
232 232 Partition permissions flags and identification tags are defined the
233 233 same as vtoc structure.
234 234
235 235 DKIOCEJECT
236 236
237 237 If the drive supports removable media, this ioctl(2) requests the disk
238 238 drive to eject its disk.
239 239
240 240 DKIOCREMOVABLE
241 241
242 242 The argument to this ioctl(2) is an integer. After successful
243 243 completion, this ioctl(2) sets that integer to a non-zero value if the
244 244 drive in question has removable media. If the media is not removable,
245 245 the integer is set to 0.
246 246
247 247 DKIOCHOTPLUGGABLE
248 248
249 249 The argument to this ioctl(2) is an integer. After successful
250 250 completion, this ioctl(2) sets that integer to a non-zero value if the
251 251 drive in question is hotpluggable. If the media is not hotpluggable,
252 252 the integer is set to 0.
253 253
254 254 DKIOCSTATE
255 255
256 256 This ioctl(2) blocks until the state of the drive, inserted or
257 257 ejected, is changed. The argument is a pointer to a dkio_state, enum,
258 258 whose possible enumerations are listed below. The initial value
259 259 should be either the last reported state of the drive, or DKIO_NONE.
260 260 Upon return, the enum pointed to by the argument is updated with the
261 261 current state of the drive.
262 262
263 263 enum dkio_state {
264 264 DKIO_NONE, /* Return disk's current state */
265 265 DKIO_EJECTED, /* Disk state is 'ejected' */
266 266 DKIO_INSERTED /* Disk state is 'inserted' */
267 267 };
268 268
269 269 DKIOCLOCK
270 270
271 271 For devices with removable media, this ioctl(2) requests the disk
272 272 drive to lock the door.
273 273
274 274 DKIOCUNLOCK
275 275
276 276 For devices with removable media, this ioctl(2) requests the disk
277 277 drive to unlock the door.
278 278
279 279 DKIOCGMEDIAINFO
280 280
281 281 The argument to this ioctl(2) is a pointer to a dk_minfo structure.
282 282 The structure indicates the type of media or the command set profile
283 283 used by the drive to operate on the media. The dk_minfo structure
284 284 also indicates the logical media block size the drive uses as the
285 285 basic unit block size of operation and the raw formatted capacity of
286 286 the media in number of logical blocks.
287 287
288 288 DKIOCGMEDIAINFOEXT
289 289
290 290 The argument to this ioctl(2) is a pointer to a dk_minfo_ext
291 291 structure. The structure indicates the type of media or the command
292 292 set profile used by the drive to operate on the media. The
293 293 dk_minfo_ext structure also indicates the logical media block size the
294 294 drive uses as the basic unit block size of operation, the raw
295 295 formatted capacity of the media in number of logical blocks and the
296 296 physical block size of the media.
297 297
298 298 /*
299 299 * Used for media info or profile info
300 300 */
301 301 struct dk_minfo {
302 302 uint_t dki_media_type; /* Media type or profile info */
303 303 uint_t dki_lbsize; /* Logical blocksize of media */
304 304 diskaddr_t dki_capacity; /* Capacity as # of dki_lbsize blks */
305 305 };
306 306
307 307 /*
308 308 * Used for media info or profile info and physical blocksize
309 309 */
310 310 struct dk_minfo_ext {
311 311 uint_t dki_media_type; /* Media type or profile info */
312 312 uint_t dki_lbsize; /* Logical blocksize of media */
313 313 diskaddr_t dki_capacity; /* Capacity as # of dki_lbsize blks */
314 314 uint_t dki_pbsize; /* Physical blocksize of media */
315 315 };
316 316
317 317
318 318 /*
319 319 * Media types or profiles known
320 320 */
321 321 #define DK_UNKNOWN 0x00 /* Media inserted - type unknown */
322 322
323 323 /*
324 324 * SFF 8090 Specification Version 3, media types 0x01 - 0xfffe are
325 325 * retained to maintain compatibility with SFF8090. The following
326 326 * define the optical media type.
327 327 */
328 328 #define DK_MO_ERASABLE 0x03 /* MO Erasable */
329 329 #define DK_MO_WRITEONCE 0x04 /* MO Write once */
330 330 #define DK_AS_MO 0x05 /* AS MO */
331 331 #define DK_CDROM 0x08 /* CDROM */
332 332 #define DK_CDR 0x09 /* CD-R */
333 333 #define DK_CDRW 0x0A /* CD-RW */
334 334 #define DK_DVDROM 0x10 /* DVD-ROM */
335 335 #define DK_DVDR 0x11 /* DVD-R */
336 336 #define DK_DVDRAM 0x12 /* DVD_RAM or DVD-RW */
337 337
338 338 /*
339 339 * Media types for other rewritable magnetic media
340 340 */
341 341 #define DK_FIXED_DISK 0x10001 /* Fixed disk SCSI or otherwise */
342 342 #define DK_FLOPPY 0x10002 /* Floppy media */
343 343 #define DK_ZIP 0x10003 /* IOMEGA ZIP media */
344 344 #define DK_JAZ 0x10004 /* IOMEGA JAZ media */
345 345
346 346 If the media exists and the host can obtain a current profile list,
347 347 the command succeeds and returns the dk_minfo structure with data
348 348 representing that media.
349 349
350 350 If there is no media in the drive, the command fails and the host
351 351 returns an ENXIO error, indicating that it cannot gather the
352 352 information requested.
353 353
354 354 If the profile list is not available, the host attempts to identify
355 355 the media-type based on the available information.
356 356
357 357 If identification is not possible, the host returns media type
358 358 DK_UNKNOWN. See NOTES for blocksize usage and capacity information.
359 359
360 360 DKIOCSMBOOT
361 361
362 362 The argument is a pointer to struct mboot.
363 363
364 364 Copies the mboot information supplied in the argument to the absolute
365 365 sector 0 of the device. Prior to copying the information, this
366 366 ioctl(2) performs the following checks on the mboot data:
367 367
368 368 o Ensures that the signature field is set to 0xAA55.
369 369
370 370 o Ensures that partitions do not overlap.
371 371
372 372 o On SPARC platforms, determines if the device is a removable
373 373 media.
374 374
375 375 If the above verification fails, errno is set to EINVAL and the
376 376 ioctl(2) command fails.
377 377
378 378 x86 Platforms -- Upon successful write of mboot, the partition map
379 379 structure maintained in the driver is updated. If the new Solaris
380 380 partition is different from the previous one, the internal VTOC table
381 381 maintained in the driver is set as follows:
382 382
383 383 If _SUNOS_VTOC_8 is defined:
384 384
385 385 Partition: 0 Start: 0 Capacity = Capacity of device.
386 386 Partition: 2 Start: 0 Capacity = Capacity of device.
387 387
388 388 If _SUNOS_VTOC_16 is defined:
389 389
390 390 Partition: 2 Start: 0 Size = Size specified in mboot - 2 cylinders.
391 391 Partition: 8 Start: 0 Size = Sectors/cylinder.
392 392 Partition: 9 Start: Sectors/cylinder Size = 2 * sectors/cylinder
393 393
394 394 To determine if the Solaris partition has changed:
395 395
396 396 If either offset or the size of the Solaris partition is different
397 397 from the previous one then it shall be deemed to have changed. In
398 398 all other cases, the internal VTOC info remains as before.
399 399
400 400 SPARC Platforms -- The VTOC label and mboot both occupy the same
401 401 location, namely sector 0. As a result, following the successful
402 402 write of mboot info, the internal VTOC table maintained in the driver
403 403 is set as follows:
404 404
405 405 Partition: 0 Start: 0 Size = Capacity of device.
406 406 Partition: 2 Start: 0 Size = Capacity of device.
407 407
408 408 See the NOTES section for usage of DKIOCSMBOOT when modifying Solaris
409 409 partitions.
410 410
411 411 DKIOCGETVOLCAP
412 412
413 413 This ioctl provides information and status of available capabilities.
414 414 vc_info is a bitmap and the valid flag values are:
415 415
416 416 DKV_ABR_CAP Capable of application-based recovery
417 417 DKV_DMR_CAP Ability to read specific copy of data when multiple
418 418 copies exist. For example, in a two way mirror, this
419 419 ioctl is used to read each side of the mirror.
420 420
421 421 vc_set is a bitmap and the valid flag values are:
422 422
423 423 DKV_ABR_CAP This flag is set if ABR has been set on a device that
424 424 supports ABR functionality.
425 425 DKV_DMR_CAP Directed read has been enabled.
426 426
427 427 These capabilities are not required to be persistent across a system
428 428 reboot and their persistence depends upon the implementation. For
429 429 example, if the ABR capability for a DRL mirror simply clears the
430 430 dirty-region list and subsequently stops updating this list, there is
431 431 no reason for persistence because the VM recovery is a no-op.
432 432 Conversely, if the ABR capability is applied to a non-DRL mirror to
433 433 indicate that the VM should not perform a full recovery of the mirror
434 434 following a system crash, the capability must be persistent so that
435 435 the VM know whether or not to perform recovery.
436 436
437 437 Return Errors:
438 438
439 439 EINVAL Invalid device for this operation.
440 440 ENOTSUP Functionality that is attempted to be set is not supported.
441 441
442 442 DKIOCSETVOLCAP
443 443
444 444 This ioctl sets the available capabilities for the device. If a
445 445 capability flag is not set in vc_set, that capability is cleared.
446 446
447 447 vc_info flags are ignored.
448 448
449 449 vc_set valid flags are:
450 450
451 451 DKV_ABR_CAP Flag to set application-based recovery. A device can
452 452 successfully support ABR only if it is capable.
453 453 DKV_DMR_CAP Flag to set directed read.
454 454
455 455 DKIODMR
456 456
457 457 int ioctl(int, DKIODMR, vol_directed_rd *)
458 458
459 459 This ioctl allows highly available applications to perform round-robin
460 460 reads from the underlying devices of a replicated device.
461 461
462 462 vdr_offset Offset at which the read should occur.
463 463 vdr_nbytes Number of bytes to be read
464 464 vdr_bytesread Number of bytes successfully read by the kernel.
465 465 vdr_data Pointer to a user allocated buffer to return the data
466 466 read
467 467 vdr_side Side to be read. Initialized to DKV_SIDE_INIT
468 468 vdr_side_name The volume name that has been read.
469 469
470 470 Valid vdr_flags are:
471 471
472 472 DKV_DMR_NEXT_SIDE Set by user
473 473 DKV_DMR_DONE Return value
474 474 DKV_DMR_ERROR Return value
475 475 DKV_DMR_SUCCESS Return value
476 476 DKV_DMR_SHORT Return value
477 477
478 478 The calling sequence is as follows: The caller sets the vdr_flags to
479 479 DK_DMR_NEXT_SIDE and vdr_side to DKV_SIDE_INIT at the start.
480 480 Subsequent calls should be made without any changes to these values.
481 481 If they are changed the results of the ioctl are indeterminate.
482 482
483 483 When DKV_SIDE_INIT is set, the call results in the kernel reading from
484 484 the first side. The kernel updates vdr_side to indicate the side that
485 485 was read, and vdr_side_name to contain the name of that side.
486 486 vdr_data contains the data that was read. Therefore to perform a
487 487 round-robin read all of the valid sides, there is no need for the
488 488 caller to change the contents of vdr_side.
489 489
490 490 Subsequent ioctl(2) calls result in reads from the next valid side
491 491 until all valid sides have been read. On success, the kernel sets
492 492 DKV_DMR_SUCCESS. The following table shows the values of vdr_flags
493 493 that are returned when an error occurs:
494 494
495 495 vda_flags vdr_side Notes
496 496 DKV_DMR_ERROR DKV_SIDE_INIT No valid side to read
497 497 DKV_DMR_DONE Not Init side All valid sides read
498 498 DKV_DMR_SHORT Any value Bytes requested cannot be read
499 499 vdr_bytesread set to bytes
500 500 actually read
501 501 Typical code fragment:
502 502
503 503 enable->vc_set |= DKV_ABR_SET;
504 504 retval = ioctl(filedes, DKIOSETVOLCAP, enable);
505 505 if (retval != EINVAL || retval != ENOTSUP) {
506 506 if (info->vc_set & DKV_DMR_SET) {
507 507 dr->vdr_flags |= DKV_DMR_NEXT_SIDE;
508 508 dr->vdr_side = DKV_SIDE_INIT;
509 509 dr->vdr_nbytes = 1024;
510 510 dr->vdr_offset = 0xff00;
511 511 do {
512 512 rval = ioctl(fildes, DKIODMR, dr);
513 513 if (rval != EINVAL) {
514 514 /* Process data */
515 515 }
516 516 } while (rval != EINVAL || dr->vdr_flags &
517 517 (DKV_DMR_DONE | DKV_DMR_ERROR | DKV_DMR_SHORT)
518 518 }
519 519 }
520 520
521 521 RETURN VALUES
522 522 Upon successful completion, the value returned is 0. Otherwise, -1 is
523 523 returned and errno is set to indicate the error.
524 524
525 525 x86 Only
526 526 The following ioctl(2) requests set and/or retrieve the current disk
527 527 controller, partitions, or geometry information on the x86 architecture.
528 528
529 529 DKIOCG_PHYGEOM
530 530
531 531 The argument is a pointer to a dk_geom structure (described below).
532 532 This ioctl(2) gets the driver's notion of the physical geometry of the
533 533 disk drive. It is functionally identical to the DKIOCGGEOM ioctl(2).
534 534
535 535 DKIOCG_VIRTGEOM
536 536
537 537 The argument is a pointer to a dk_geom structure (described below).
538 538 This ioctl(2) gets the controller's (and hence the driver's) notion of
539 539 the virtual geometry of the disk drive. Virtual geometry is a view of
540 540 the disk geometry maintained by the firmware in a host bus adapter or
541 541 disk controller. If the disk is larger than 8 Gbytes, this ioctl
542 542 fails because a CHS-based geometry is not relevant or useful for this
543 543 drive.
544 544
545 545 /*
546 546 * Definition of a disk's geometry
547 547 */
548 548 struct dk_geom {
549 549 unsigned shor dkg_ncyl; /* # of data cylinders */
550 550 unsigned shor dkg_acyl; /* # of alternate cylinders */
551 551 unsigned short dkg_bcyl; /* cyl offset (for fixed head */
552 552 /* area) */
553 553 unsigned short dkg_nhead; /* # of heads */
554 554 unsigned short dkg_obs1; /* obsolete */
555 555 unsigned short dkg_nsect; /* # of sectors per track */
556 556 unsigned short dkg_intrlv; /* interleave factor */
557 557 unsigned short dkg_obs2; /* obsolete */
558 558 unsigned short dkg_obs3; /* obsolete */
559 559 unsigned short dkg_apc; /* alternates per cylinder */
560 560 /* (SCSI only) */
561 561 unsigned short dkg_rpm; /* revolutions per min */
562 562 unsigned short dkg_pcyl; /* # of physical cylinders */
563 563 unsigned short dkg_write_reinstruct; /* # sectors to skip, */
564 564 /* writes */
565 565 unsigned short dkg_read_reinstruct; /* # sectors to skip ,*/
566 566 /* reads */
567 567 unsigned short dkg_extra[7]; /* for compatible expansion */
568 568 };
569 569
570 570 DKIOCADDBAD
571 571
572 572 This ioctl(2) forces the driver to re-examine the alternates slice and
573 573 rebuild the internal bad block map accordingly. It should be used
574 574 whenever the alternates slice is changed by any method other than the
575 575 addbadsec(1M) or format(1M) utilities. DKIOCADDBAD can only be used
576 576 for software remapping on IDE drives; SCSI drives use hardware
577 577 remapping of alternate sectors.
578 578
579 579 DKIOCPARTINFO
580 580
581 581 The argument is a pointer to a part_info structure (described below).
582 582 This ioctl(2) gets the driver's notion of the size and extent of the
583 583 partition or slice indicated by the file descriptor argument.
584 584
585 585 /*
586 586 * Used by applications to get partition or slice information
587 587 */
588 588 struct part_info {
589 589 daddr_t p_start;
590 590 int p_length;
591 591 };
592 592
593 593 DKIOCEXTPARTINFO
594 594
↓ open down ↓ |
594 lines elided |
↑ open up ↑ |
595 595 The argument is a pointer to an extpart_info structure (described
596 596 below). This ioctl gets the driver's notion of the size and extent of
597 597 the partition or slice indicated by the file descriptor argument. On
598 598 disks larger than 1TB, this ioctl must be used instead of
599 599 DKIOCPARTINFO.
600 600
601 601 /*
602 602 * Used by applications to get partition or slice information
603 603 */
604 604 struct extpart_info {
605 - diskkaddr_t p_start;
605 + diskaddr_t p_start;
606 606 diskaddr_t p_length;
607 607 };
608 608
609 609 DKIOCSETEXTPART
610 610
611 611 This ioctl is used to update the in-memory copy of the logical drive
612 612 information maintained by the driver. The ioctl takes no arguments.
613 613 It causes a re-read of the partition information and recreation of
614 614 minor nodes if required. Prior to updating the data structures, the
615 615 ioctl ensures that the partitions do not overlap. Device nodes are
616 616 created only for valid partition entries. If there is any change in
617 617 the partition offset, size or ID from the previous read, the partition
618 618 is deemed to have been changed and hence the device nodes are
619 619 recreated. Any modification to any of the logical partitions results
620 620 in the recreation of all logical device nodes.
621 621
622 622 SEE ALSO
623 623 addbadsec(1M), fdisk(1M), format(1M), ioctl(2), cmdk(7D), sd(7D),
624 624 cdio(7I), fdio(7I), hdio(7I)
625 625
626 626 NOTES
627 627 Blocksize information provided in DKIOCGMEDIAINFO is the size (in bytes)
628 628 of the device's basic unit of operation and can differ from the blocksize
629 629 that the Solaris operating environment exports to the user. Capacity
630 630 information provided in the DKIOCGMEDIAINFO are for reference only and
631 631 you are advised to use the values returned by DKIOCGGEOM or other
632 632 appropriate ioctl(2) for accessing data using the standard interfaces.
633 633
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
634 634 For x86 only: If the DKIOCSMBOOT command is used to modify the Solaris
635 635 partitions, the VTOC information should also be set appropriately to
636 636 reflect the changes to partition. Failure to do so leads to unexpected
637 637 results when the device is closed and reopened fresh at a later time.
638 638 This is because a default VTOC is assumed by driver when a Solaris
639 639 partition is changed. The default VTOC persists until the ioctl
640 640 DKIOCSVTOC is called to modify VTOC or the device is closed and reopened.
641 641 At that point, the old valid VTOC is read from the disk if it is still
642 642 available.
643 643
644 -illumos October 23, 2017 illumos
644 +illumos February 17, 2020 illumos
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX