8212 manpages contain obsolete references
[unleashed.git] / usr / src / man / man7d / sd.7d
blob476a048757d30a50fca0f396edf32ddbe068d895
1 '\" te
2 .\" Copyright (c) 2009 Sun Microsystems, Inc.  All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
4 .\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER,
5 .\" with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH SD 7D "May 13, 2017"
7 .SH NAME
8 sd \- SCSI disk and ATAPI/SCSI CD-ROM device driver
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBsd@target,lun:partition\fR
13 .fi
15 .SH DESCRIPTION
16 .LP
17 To open a device without checking if the vtoc is valid, use the O_NDELAY flag.
18 When the device is opened using O_NDELAY, the first read or write to the device
19 that happens after the open results in the label being read if the label is not
20 currently valid. Once read, the label remains valid until the last close of the
21 device. Except for reading the label, O_NDELAY has no impact on the driver.
22 .SS "SPARC"
23 .LP
24 The \fBsd\fR \fBSCSI\fR and \fBSCSI/ATAPI\fR driver supports embedded
25 \fBSCSI\fR-2 and \fBCCS\fR-compatible \fBSCSI\fR disk and CD-ROM drives,
26 \fBATAPI \fR 2.6 (SFF-8020i)-compliant CD-ROM drives, SFF-8090-compliant
27 \fBSCSI/ATAPI\fR DVD-ROM drives, IOMEGA \fBSCSI/ATAPI\fR ZIP drives, \fBSCSI
28 JAZ\fR drives, and USB mass storage devices (refer to \fBscsa2usb\fR(7D)).
29 .sp
30 .LP
31 To determine the disk drive type, use the \fBSCSI/ATAPI\fR inquiry command and
32 read the volume label stored on block 0 of the drive. (The volume label
33 describes the disk geometry and partitioning and must be present for the disk
34 to be mounted by the system.) A volume label is not required for removable,
35 re-writable or read-only media.
36 .SS "x86 Only"
37 .LP
38 The \fBsd\fRdriver supports embedded \fBSCSI\fR-2 and \fBCCS\fR-compatible
39 \fBSCSI \fRdisk and CD-ROM drives, \fBATAPI \fR2.6 (SFF-8020i)-compliant CD-ROM
40 drives, SFF-8090-compliant \fBSCSI/ATAPI\fR DVD-ROM drives, IOMEGA
41 \fBSCSI/ATAPI\fR ZIP drives\fB, and SCSI JAZ\fR drives.
42 .sp
43 .LP
44 The x86 BIOS legacy requires a master boot record (MBR) and \fBfdisk\fR table
45 in the first physical sector of the bootable media. If the x86 hard disk
46 contains a Solaris disk label, it is located in the second 512-byte sector of
47 the FDISK partition.
48 .SH DEVICE SPECIAL FILES
49 .LP
50 Block-files access the disk using normal buffering mechanism and are read-from
51 and written-to without regard to physical disk records. A \fBraw\fR interface
52 enables direct transmission between the disk and the user's read or write
53 buffer. A single \fBread\fR or \fBwrite\fR call usually results in a single I/O
54 operation, therefore raw I/O is more efficient when many bytes are transmitted.
55 Block files names are found in \fB/dev/dsk\fR; raw file names are found in
56 \fB/dev/rdsk\fR.
57 .sp
58 .LP
59 I/O requests to the raw device must be aligned on a 512-byte (\fBDEV_BSIZE\fR)
60 boundary and all I/O request lengths must be in multiples of 512 bytes.
61 Requests that do not meet these requirements will trigger an \fBEINVAL\fR
62 error. There are no alignment or length restrictions on I/O requests to the
63 block device.
64 .SH CD-ROM DRIVE SUPPORT
65 .LP
66 A CD-ROM disk is single-sided and contains approximately 640 megabytes of data
67 or 74 minutes of audio. When the CD-ROM is opened, the eject button is disabled
68 to prevent manual removal of the disk until the last \fBclose()\fR is called.
69 No volume label is required for a CD-ROM. The disk geometry and partitioning
70 information are constant and never change. If the CD-ROM contains data recorded
71 in a Solaris-aware file system format, it can be mounted using the appropriate
72 Solaris file system support.
73 .SH DVD-ROM DRIVE SUPPORT
74 .LP
75 DVD-ROM media can be single or double-sided and can be recorded upon using a
76 single or double layer structure. Double-layer media provides parallel or
77 opposite track paths. A DVD-ROM can hold from between 4.5 Gbytes and 17 Gbytes
78 of data, depending on the layer structure used for recording and if the DVD-ROM
79 is single or double-sided.
80 .sp
81 .LP
82 When the DVD-ROM is opened, the eject button is disabled to prevent the manual
83 removal of a disk until the last \fBclose()\fR is called. No volume label is
84 required for a DVD-ROM. If the DVD-ROM contains data recorded in a
85 Solaris-aware file system format, it can be mounted using the appropriate
86 Solaris file system support.
87 .SH ZIP/JAZ DRIVE SUPPORT
88 .LP
89 \fBZIP/JAZ\fR media provide varied data capacity points; a single \fBJAZ
90 \fRdrive can store up to 2 GBytes of data, while a ZIP-250 can store up to
91 250MBytes of data. \fBZIP/JAZ\fR drives can be read-from or written-to using
92 the appropriate drive.
93 .sp
94 .LP
95 When a \fBZIP/JAZ\fR drive is opened, the eject button is disabled to prevent
96 the manual removal of a disk until the last \fBclose()\fR is called. No volume
97 label is required for a \fBZIP/JAZ\fR drive. If the \fBZIP/JAZ\fR drive
98 contains data recorded in a Solaris-aware file system format, it can be mounted
99 using the appropriate Solaris file system support.
100 .SH DEVICE STATISTICS SUPPORT
102 Each device maintains I/O statistics for the device and for partitions
103 allocated for that device. For each device/partition, the driver accumulates
104 reads, writes, bytes read, and bytes written. The driver also initiates
105 hi-resolution time stamps at queue entry and exit points to enable monitoring
106 of residence time and cumulative residence-length product for each queue.
109 Not all device drivers make per-partition IO statistics available for
110 reporting. \fBsd\fR and \fBssd\fR(7D) per-partition statistics are enabled by
111 default but may disabled in their configuration files.
112 .SH IOCTLS
114 Refer to \fBdkio\fR(7I), and \fBcdio\fR(7I)
115 .SS "ERRORS"
116 .ne 2
118 \fB\fBEACCES\fR\fR
120 .RS 10n
121 Permission denied
125 .ne 2
127 \fB\fBEBUSY\fR\fR
129 .RS 10n
130 The partition was opened exclusively by another thread
134 .ne 2
136 \fB\fBEFAULT\fR\fR
138 .RS 10n
139 The argument features a bad address
143 .ne 2
145 \fB\fBEINVAL\fR\fR
147 .RS 10n
148 Invalid argument
152 .ne 2
154 \fB\fBENOTTY\fR\fR
156 .RS 10n
157 The device does not support the requested ioctl function
161 .ne 2
163 \fB\fBENXIO\fR\fR
165 .RS 10n
166 During opening, the device did not exist. During close, the drive unlock failed
170 .ne 2
172 \fB\fBEROFS\fR\fR
174 .RS 10n
175 The device is read-only
179 .ne 2
181 \fB\fBEAGAIN\fR\fR
183 .RS 10n
184 Resource temporarily unavailable
188 .ne 2
190 \fB\fBEINTR\fR\fR
192 .RS 10n
193 A signal was caught during the execution of the \fBioctl()\fR function
197 .ne 2
199 \fB\fBENOMEM\fR\fR
201 .RS 10n
202 Insufficient memory
206 .ne 2
208 \fB\fBEPERM\fR\fR
210 .RS 10n
211 Insufficent access permission
215 .ne 2
217 \fB\fBEIO\fR\fR
219 .RS 10n
220 An I/O error occurred. Refer to notes for details on copy-protected DVD-ROM
221 media.
224 .SH CONFIGURATION
226 The \fBsd\fR driver can be configured by defining properties in the
227 \fBsd.conf\fR file. The \fBsd\fR driver supports the following properties:
229 .ne 2
231 \fB\fBenable-partition-kstats\fR\fR
233 .RS 27n
234 The default value is 1, which causes partition IO statistics to be maintained.
235 Set this value to zero to prevent the driver from recording partition
236 statistics. This slightly reduces the CPU overhead for IO, mimimizes the amount
237 of \fBsar\fR(1) data collected and makes these statistics unavailable for
238 reporting by \fBiostat\fR(1M) even though the \fB-p\fR/\fB-P\fR option is
239 specified. Regardless of this setting, disk IO statistics are always
240 maintained.
244 .ne 2
246 \fB\fBqfull-retries\fR\fR
248 .RS 27n
249 The supplied value is passed as the \fBqfull-retries\fR capability value of the
250 HBA driver. See \fBscsi_ifsetcap\fR(9F) for details.
254 .ne 2
256 \fB\fBqfull-retry-interval\fR\fR
258 .RS 27n
259 The supplied value is passed as the \fBqfull-retry interval\fR capability value
260 of the HBA driver. See \fBscsi_ifsetcap\fR(9F) for details.
264 .ne 2
266 \fB\fBallow-bus-device-reset\fR\fR
268 .RS 27n
269 The default value is 1, which allows resetting to occur. Set this value to
270 \fB0\fR (zero) to prevent the \fBsd\fR driver from calling \fBscsi_reset\fR(9F)
271 with a second argument of \fBRESET_TARGET\fR when in error-recovery mode. This
272 \fBscsi_reset\fR(9F) call may prompt the HBA driver to send a SCSI Bus Device
273 Reset message. The \fBscsi_reset\fR(9F) call with a second argument of
274 \fBRESET_TARGET\fR may result from an explicit request via the \fBUSCSICMD\fR
275 \fBioctl\fR. Some high-availability multi-initiator systems may wish to
276 prohibit the Bus Device Reset message; to do this, set the
277 \fBallow-bus-device-reset\fR property to \fB0\fR.
281 .ne 2
283 \fBoptical-device-bind\fR
285 .RS 27n
286 Controls the binding of the driver to non self-identifying SCSI target optical
287 devices. (See \fBscsi\fR(4)). The default value is 1, which causes \fBsd\fR to
288 bind to DTYPE_OPTICAL devices (as noted in \fBscsi\fR(4)).  Setting this value
289 to 0 prevents automatic binding. The default behavior for the SPARC-based
290 \fBsd\fR driver prior to Solaris 9 was not to bind to optical devices.
294 .ne 2
296 \fB\fBpower-condition\fR\fR
298 .RS 27n
299 Boolean type, when set to \fBFalse\fR, it indicates that the disk does not
300 support \fBpower condition\fR field in the \fBSTART STOP UNIT\fR command.
305 In addition to the above properties, some device-specific tunables can be
306 configured in \fBsd.conf\fR using the \fBsd-config-list\fR global property. The
307 value of this property is a list of duplets. The formal syntax is:
309 .in +2
311 sd-config-list = <duplet> [, <duplet> ]* ;
313 where
315 <duplet>:= "<vid+pid>" , "<tunable-list>"
319 <tunable-list>:= <tunable>  [, <tunable> ]*;
320 <tunable> = <name> : <value>
322 The <vid+pid> is the string that is returned by the target device
323 on a SCSI inquiry command.
325 The <tunable-list> contains one or more tunables to apply to
326 all target devices with the specified <vid+pid>.
328 Each <tunable> is a <name> : <value> pair. Supported
329 tunable names are:
331    delay-busy: when busy, nsecs of delay before retry.
333    retries-timeout: retries to perform on an IO timeout.
335 .in -2
338 .ne 2
340 \fB\fBmmc-gesn-polling\fR\fR
342 .RS 20n
343 For optical drives compliant with \fBMMC-3\fR and supporting the \fBGET EVENT
344 STATUS NOTIFICATION\fR command, this command is used for periodic media state
345 polling, usually initiated by the \fBDKIOCSTATE\fR \fBdkio\fR(7I) ioctl. To
346 disable the use of this command, set this boolean property to \fBfalse\fR. In
347 that case, either the \fBTEST UNIT READY\fR or zero-length \fBWRITE(10)\fR
348 command is used instead.
351 .SH EXAMPLES
352 .in +2
354 The following is an example of a global sd-config-list property:
356    sd-config-list =
357       "SUN     T4", "delay-busy:600, retries-timeout:6",
358       "SUN     StorEdge_3510", "retries-timeout:3";
360 .in -2
362 .SH FILES
363 .ne 2
365 \fB\fB/kernel/drv/sd.conf\fR\fR
367 .RS 23n
368 Driver configuration file
372 .ne 2
374 \fB\fB/dev/dsk/cntndnsn\fR\fR
376 .RS 23n
377 Block files
381 .ne 2
383 \fB\fB/dev/rdsk/cntndnsn\fR\fR
385 .RS 23n
386 Raw files
391 Where:
393 .ne 2
395 \fBcn\fR
397 .RS 6n
398 controller n
402 .ne 2
404 \fBtn\fR
406 .RS 6n
407 SCSI target id n (0-6)
411 .ne 2
413 \fBdn\fR
415 .RS 6n
416 SCSI LUN n (0-7 normally; some HBAs support LUNs to 15 or 32. See the specific
417 manpage for details)
421 .ne 2
423 \fBsn\fR
425 .RS 6n
426 partition n (0-7)
429 .SS "x86 Only"
430 .ne 2
432 \fB\fB/dev/rdsk/cntndnpn\fR\fR
434 .RS 22n
435 raw files
440 Where:
442 .ne 2
444 \fBpn\fR
446 .RS 6n
447 Where \fIn\fR=0 the node corresponds to the entire disk.
450 .SH SEE ALSO
452 \fBsar\fR(1), \fBcfgadm_scsi\fR(1M), \fBfdisk\fR(1M), \fBformat\fR(1M),
453 \fBiostat\fR(1M), \fBclose\fR(2), \fBioctl\fR(2), \fBlseek\fR(2),
454 \fBread\fR(2), \fBwrite\fR(2), \fBdriver.conf\fR(4), \fBscsi\fR(4),
455 \fBfilesystem\fR(5), \fBscsa2usb\fR(7D), \fBssd\fR(7D), \fBhsfs\fR(7FS),
456 \fBpcfs\fR(7FS), \fBudfs\fR(7FS), \fBcdio\fR(7I), \fBdkio\fR(7I),
457 \fBscsi_ifsetcap\fR(9F), \fBscsi_reset\fR(9F)
460 \fIANSI Small Computer System Interface-2 (SCSI-2)\fR
463 \fIATA Packet Interface for CD-ROMs, SFF-8020i\fR
466 \fIMt.Fuji Commands for CD and DVD, SFF8090v3\fR
467 .SH DIAGNOSTICS
468 .in +2
470 Error for Command:\fI<command name>\fR
471 Error Level: Fatal
472 Requested Block: \fI<n>\fR
473 Error  Block: \fI<m>\fR
474 Vendor:'\fI<vendorname>\fR\&'
475 Serial Number:'\fI<serial number>\fR\&'
476 Sense Key:\fI<sense key name>\fR
478 .in -2
482 .ne 2
484 \fBASC: 0x<a> (<ASC name>), ASCQ: 0x<b>, FRU: 0x<c>\fR
486 .sp .6
487 .RS 4n
488 The command indicated by <command name> failed. The Requested Block is the
489 block where the transfer started and the Error Block is the block that caused
490 the error. Sense Key, \fBASC\fR, and \fBASCQ\fR information is returned by the
491 target in response to a request sense command.
495 .ne 2
497 \fBCaddy not inserted in drive\fR
499 .sp .6
500 .RS 4n
501 The drive is not ready because no caddy has been inserted.
505 .ne 2
507 \fBCheck Condition on REQUEST SENSE\fR
509 .sp .6
510 .RS 4n
511 A REQUEST SENSE command completed with a check condition. The original command
512 will be retried a number of times.
516 .ne 2
518 \fBLabel says <m> blocks Drive says <n> blocks\fR
520 .sp .6
521 .RS 4n
522 There is a discrepancy between the label and what the drive returned on the
523 \fBREAD CAPACITY\fR command.
527 .ne 2
529 \fBNot enough sense information\fR
531 .sp .6
532 .RS 4n
533 The request sense data was less than expected.
537 .ne 2
539 \fBRequest Sense couldn't get sense data\fR
541 .sp .6
542 .RS 4n
543 The \fBREQUEST SENSE\fR command did not transfer any data.
547 .ne 2
549 \fBReservation Conflict\fR
551 .sp .6
552 .RS 4n
553 The drive was reserved by another initiator.
557 .ne 2
559 \fBSCSI transport failed: reason \fB\&'xxxx'\fR: {retrying|giving up}\fR
561 .sp .6
562 .RS 4n
563 The host adapter has failed to transport a command to the target for the reason
564 stated. The driver will either retry the command or, ultimately, give up.
568 .ne 2
570 \fBUnhandled Sense Key<\fIn\fR>\fR
572 .sp .6
573 .RS 4n
574 The REQUEST SENSE data included an invalid sense.
578 .ne 2
580 \fBUnit not ready. Additional sense code 0x\fR
582 .sp .6
583 .RS 4n
584 \fI<n>\fR The drive is not ready.
588 .ne 2
590 \fBCan't do switch back to mode 1\fR
592 .sp .6
593 .RS 4n
594 A failure to switch back to read mode 1.
598 .ne 2
600 \fBCorrupt label - bad geometry\fR
602 .sp .6
603 .RS 4n
604 The disk label is corrupted.
608 .ne 2
610 \fBCorrupt label - label checksum failed\fR
612 .sp .6
613 .RS 4n
614 The disk label is corrupted.
618 .ne 2
620 \fBCorrupt label - wrong magic number\fR
622 .sp .6
623 .RS 4n
624 The disk label is corrupted.
628 .ne 2
630 \fBDevice busy too long\fR
632 .sp .6
633 .RS 4n
634 The drive returned busy during a number of retries.
638 .ne 2
640 \fBDisk not responding to selection\fR
642 .sp .6
643 .RS 4n
644 The drive is powered down or died
648 .ne 2
650 \fBFailed to handle UA\fR
652 .sp .6
653 .RS 4n
654 A retry on a Unit Attention condition failed.
658 .ne 2
660 \fBI/O to invalid geometry\fR
662 .sp .6
663 .RS 4n
664 The geometry of the drive could not be established.
668 .ne 2
670 \fBIncomplete read/write - retrying/giving up\fR
672 .sp .6
673 .RS 4n
674 There was a residue after the command completed normally.
678 .ne 2
680 \fBNo bp for direct access device format geometry\fR
682 .sp .6
683 .RS 4n
684 A bp with consistent memory could not be allocated.
688 .ne 2
690 \fBNo bp for disk label\fR
692 .sp .6
693 .RS 4n
694 A bp with consistent memory could not be allocated.
698 .ne 2
700 \fBNo bp for fdisk\fR
702 .sp .6
703 .RS 4n
704 A bp with consistent memory could not be allocated.
708 .ne 2
710 \fBNo bp for rigid disk geometry\fR
712 .sp .6
713 .RS 4n
714 A bp with consistent memory could not be allocated.
718 .ne 2
720 \fBNo mem for property\fR
722 .sp .6
723 .RS 4n
724 Free memory pool exhausted.
728 .ne 2
730 \fBNo memory for direct access device format geometry\fR
732 .sp .6
733 .RS 4n
734 Free memory pool exhausted.
738 .ne 2
740 \fBNo memory for disk label\fR
742 .sp .6
743 .RS 4n
744 Free memory pool exhausted.
748 .ne 2
750 \fBNo memory for rigid disk geometry\fR
752 .sp .6
753 .RS 4n
754 The disk label is corrupted.
758 .ne 2
760 \fBNo resources for dumping\fR
762 .sp .6
763 .RS 4n
764 A packet could not be allocated during dumping.
768 .ne 2
770 \fBOffline\fR
772 .sp .6
773 .RS 4n
774 Drive went offline; probably powered down.
778 .ne 2
780 \fBRequeue of command fails\fR
782 .sp .6
783 .RS 4n
784 Driver attempted to retry a command and experienced a transport error.
788 .ne 2
790 \fBsdrestart transport failed()\fR
792 .sp .6
793 .RS 4n
794 Driver attempted to retry a command and experienced a transport error.
798 .ne 2
800 \fBTransfer length not modulo\fR
802 .sp .6
803 .RS 4n
804 Illegal request size.
808 .ne 2
810 \fBTransport of request sense fails()\fR
812 .sp .6
813 .RS 4n
814 Driver attempted to submit a request sense command and failed.
818 .ne 2
820 \fBTransport rejected()\fR
822 .sp .6
823 .RS 4n
824 Host adapter driver was unable to accept a command.
828 .ne 2
830 \fBUnable to read label\fR
832 .sp .6
833 .RS 4n
834 Failure to read disk label.
838 .ne 2
840 \fBUnit does not respond to selection\fR
842 .sp .6
843 .RS 4n
844 Drive went offline; probably powered down.
847 .SH NOTES
849 DVD-ROM media containing DVD-Video data may follow/adhere to the requirements
850 of content scrambling system or copy protection scheme. Reading of
851 copy-protected sector will cause I/O error. Users are advised to use the
852 appropriate playback software to view video contents on DVD-ROM media
853 containing DVD-Video data.