3 sd \- storage device interface
15 The storage device interface serves a two-level directory
16 giving access to multiple storage units,
17 typically ATA(PI) or SCSI discs.
19 is accessed via files in the directory named by the controller
20 to which it is attached,
22 and by its unit number
24 The controller naming convention for ATA(PI) units starts
25 with the first controller being named
29 etc. up to a maximum of 4 controllers
31 legacy controllers are always 'C' and 'D'.
32 There can be a maximum of 2 units per ATA(PI) controller
34 The controller naming convention for SCSI units starts with
35 the first controller being named
39 etc. up to a maximum of 16 controllers
41 There can be a maximum of 16 units per SCSI controller
44 Units are not accessed before the first attach.
45 Units may be individually attached using the attach specifier,
52 An attach without a specifier will cause the driver to scan for all possible
53 units before processing the rest of the name.
55 The subdirectory for each unit contains two files,
60 if the unit is a direct-access disc of some type
61 it may be split into partitions and
62 the subdirectory may contain a file per partition.
66 will exist for such media.
68 Partitions are added and deleted by writing to the
73 part \f2name start-sector end-sector\fP
79 partition may be deleted.
80 A partition cannot be deleted if a process has it open.
81 If a change of removable media is detected,
82 the new media cannot be opened until all open partitions
83 on the old media are closed.
85 Partitions are usually created using
89 the convention is to name non-Plan 9 partitions after their corresponding operating systems
92 and Plan 9 partitions according to their function
97 shows how this is done.
101 file returns at least one line of textual information about
103 The first line will always be prefixed by
105 and will give a manufacturer and model number if possible.
108 will be returned for appropriate media,
109 e.g. for ATA(PI) units the remainder of the line contains
110 configuration information from the device's
112 command (config and capabilities)
113 and also the available I/O transfer options;
114 this is a diagnostic aid.
117 will be returned for appropriate media;
118 at least two numbers will follow,
119 the first being the number of sectors contained in the unit
120 and the second the sector size in bytes.
121 Any remaining information on the
123 line is unit-dependent,
125 cylinder and sector counts for ATA discs.
126 If any partitions are defined for the media,
127 their name, start-sector and end-sector will be returned,
133 inquiry KENWOOD CD-ROM UCR-421 208E10/20/99 7.39 2 M0
134 config 85C0 capabilities 0F00 dma 00550004 dmactl 00000000
140 The use of DMA and multi-sector read/write commands may be
141 enabled and disabled on ATA(PI) units by writing to the
147 respectively followed by
151 For example, to enable DMA on a unit that supports it:
154 % echo 'dma on'>/dev/sd00/ctl
157 If supported by the unit,
158 the standby timer may be enabled:
161 % echo 'standby \f2T\fP'>/dev/sdC0/ctl
166 is the standby timer period in seconds.
168 must be between 30 and 1200,
169 or can be 0 to disable the timer.
173 file is used to execute an arbitrary command on the unit at
175 This is used by programs such as
177 to manipulate devices that do not fit the simple storage model
178 or for maintenance purposes.
179 The following steps may be taken to execute a command
181 Write the command to the
185 Read or write data associated with the command, according to the direction of the transfer.
189 file to retrieve the status of the command,
190 returned as a text integer.
194 yields information about each controller,
195 one line per controller.
196 Writing `\fLconfig \fImessage\fR' to
200 to the legacy configuration machinery,
201 used to set attributes such as IRQ, port and size.
202 Writing `\fIctltype message\fR' to
214 is a known controller type such as
219 .BI sd "ctlletter message\fR'
225 .BI sd ctlletter\fR's
229 argument corresponding to the named controller,
232 is a known controller letter such as
237 .B /sys/src/9/port/devsd.c
239 .B /sys/src/9/*/sd*.[hc]
243 LUNs (logical unit numbers) are not implemented.
245 LUNs are not merely ignored but are actively
246 prevented from working except for INQUIRY commands.
248 The 4 controller limit for ATA(PI) is not enforced.
250 No account is taken of some buggy ATA PCI controllers
253 ATA(PI) units come up with DMA and multi-sector read/write