Penguin
Annotated edit history of hdparm(8) version 2, including all changes. View license author blame.
Rev Author # Line
1 perry 1 HDPARM
2 !!!HDPARM
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 OPTIONS
7 BUGS
8 AUTHOR
9 SEE ALSO
10 ----
11 !!NAME
12
13
14 hdparm - get/set hard disk parameters
15 !!SYNOPSIS
16
17
18 __hdparm__ [[ flags ] [[device] ..
19 !!DESCRIPTION
20
21
22 __hdparm__ provides a command line interface to various
23 hard disk ioctls supported by the stock Linux ATA/IDE device
24 driver subsystem. Some options may work correctly only with
25 the latest kernels. For best results, compile hdparm with
26 the include files from the latest kernel source
27 code.
28 !!OPTIONS
29
30
31 When no flags are given, ''-acdgkmnru'' is
32 assumed.
33
34
35 ''-a''
36
37
38 Get/set sector count for filesystem read-ahead. This is used
39 to improve performance in sequential reads of large files,
40 by prefetching additional blocks in anticipation of them
41 being needed by the running task. In the current kernel
42 version (2.0.10) this has a default setting of 8 sectors
43 (4KB). This value seems good for most purposes, but in a
44 system where most file accesses are random seeks, a smaller
45 setting might provide better performance. Also, many IDE
46 drives also have a separate built-in read-ahead function,
47 which alleviates the need for a filesystem read-ahead in
48 many situations.
49
50
51 ''-A''
52
53
54 Disable/enable the IDE drive's read-lookahead feature
55 (usually ON by default).
56
57
58 ''-b''
59
60
61 Get/set bus state.
62
63
64 ''-B''
65
66
67 Get setting of Advanced Power Management feature, if the
68 drive supports it.
69
70
71 ''-c''
72
73
74 Query/enable (E)IDE 32-bit I/O support. A numeric parameter
75 can be used to enable/disable 32-bit I/O support: Currently
76 supported values include ''0'' to disable 32-bit I/O
77 support, ''1'' to enable 32-bit data transfers, and
78 ''3'' to enable 32-bit data transfers with a special
79 ''sync'' sequence required by many chipsets. The value
80 ''3'' works with nearly all 32-bit IDE chipsets, but
81 incurs slightly more overhead. Note that
82 ''
83
84
85 ''-C''
86
87
88 Check the current IDE power mode status, which will always
89 be one of __unknown__ (drive does not support this
90 command), __active/idle__ (normal operation),
91 __standby__ (low power mode, drive has spun down), or
92 __sleeping__ (lowest power mode, drive is completely shut
93 down). The __-S, -y, -Y,__ and __-Z__ flags can be
94 used to manipulate the IDE power modes.
95
96
97 ''-d''
98
99
100 Disable/enable the
101 -X34'' option in
102 combination with ''-d1'' to ensure that the drive itself
103 is programmed for multiword DMA mode2. Using DMA does not
104 necessarily provide any improvement in throughput or system
105 performance, but many folks swear by it. Your mileage may
106 vary.
107
108
109 ''-D''
110
111
112 Enable/disable the on-drive defect management feature,
113 whereby the drive firmware tries to automatically manage
114 defective sectors by relocating them to
115
116
117 ''-E''
118
119
120 Set cdrom speed. This is NOT necessary for regular
121 operation, as the drive will automatically switch speeds on
122 its own. But if you want to play with it, just supply a
123 speed number after the option, usually a number like 2 or
124 4.
125
126
127 ''-f''
128
129
130 Sync and flush the buffer cache for the device on exit. This
131 operation is also performed as part of the ''-t'' and
132 ''-T'' timings.
133
134
135 ''-g''
136
137
138 Display the drive geometry (cylinders, heads, sectors), the
139 size (in sectors) of the device, and the starting offset (in
140 sectors) of the device from the beginning of the
141 drive.
142
143
144 ''-h''
145
146
147 Display terse usage information (help).
148
149
150 ''-i''
151
152
153 Display the identification info that was obtained from the
154 drive at ''boot time,'' if available. This is a feature
155 of modern IDE drives, and may not be supported by older
156 devices. The data returned may or may not be current,
157 depending on activity since booting the system. However, the
158 current multiple sector mode count is always shown. For a
159 more detailed interpretation of the identification info,
160 refer to ''AT Attachment Interface for Disk Drives''
161 (ANSI ASC X3T9.2 working draft, revision 4a, April
162 19/93).
163
164
165 ''-I''
166
167
168 Request identification info directly from the drive, which
169 is displayed in a new expanded format with considerably more
170 detail than with the older ''-i'' flag.
171
172
173 ''-k''
174
175
176 Get/set the keep_settings_over_reset flag for the drive.
177 When this flag is set, the driver will preserve the
178 ''-dmu'' options over a soft reset, (as done during the
179 error recovery sequence). This flag defaults to off, to
180 prevent drive reset loops which could be caused by
181 combinations of ''-dmu'' settings. The ''-k'' flag
182 should therefore only be set after one has achieved
183 confidence in correct system operation with a chosen set of
184 configuration settings. In practice, all that is typically
185 necessary to test a configuration (prior to using -k) is to
186 verify that the drive can be read/written, and that no error
187 logs (kernel messages) are generated in the process (look in
188 /var/adm/messages on most systems).
189
190
191 ''-K''
192
193
194 Set the drive's keep_features_over_reset flag. Setting this
195 enables the drive to retain the settings for ''-APSWXZ''
196 over a soft reset (as done during the error recovery
197 sequence). Not all drives support this feature.
198
199
200 ''-L''
201
202
203 Set the drive's doorlock flag. Setting this to will lock the
204 door mechanism of some removeable hard drives (eg. Syquest,
205 ZIP, Jazz..), and setting it to maintains the door locking
206 mechanism automatically, depending on drive usage (locked
207 whenever a filesystem is mounted). But on system shutdown,
208 this can be a nuisance if the root partition is on a
209 removeable disk, since the root partition is left mounted
210 (read-only) after shutdown. So, by using this command to
211 unlock the door the root filesystem is remounted read-only,
212 one can then remove the cartridge from the drive after
213 shutdown.
214
215
216 ''-m''
217
218
219 Get/set sector count for multiple sector I/O on the drive. A
220 setting of __0__ disables this feature. Multiple sector
221 mode (aka IDE Block Mode), is a feature of most modern IDE
222 hard drives, permitting the transfer of multiple sectors per
223 I/O interrupt, rather than the usual one sector per
224 interrupt. When this feature is enabled, it typically
225 reduces operating system overhead for disk I/O by 30-50%. On
226 many systems, it also provides increased data throughput of
227 anywhere from 5% to 50%. Some drives, however (most notably
228 the WD Caviar series), seem to run slower with multiple mode
229 enabled. Your mileage may vary. Most drives support the
230 minimum settings of 2, 4, 8, or 16 (sectors). Larger
231 settings may also be possible, depending on the drive. A
232 setting of 16 or 32 seems optimal on many systems. Western
233 Digital recommends lower settings of 4 to 8 on many of their
234 drives, due tiny (32kB) drive buffers and non-optimized
235 buffering algorithms. The __-i__ flag can be used to find
236 the maximum setting supported by an installed drive (look
2 perry 237 for !MaxMultSect in the output). Some drives claim to support
1 perry 238 multiple mode, but lose data at some settings. Under rare
239 circumstances, such failures can result in __massive
240 filesystem corruption.__
241
242
243 ''-n''
244
245
246 Get or set the
247
248
249 ''-p''
250
251
252 Attempt to reprogram the IDE interface chipset for the
253 specified PIO mode, or attempt to auto-tune for the
254 both'' drives to be set. Many IDE
255 chipsets support either fewer or more than the standard six
256 (0 to 5) PIO modes, so the exact speed setting that is
257 actually implemented will vary by chipset/driver
258 sophistication. ''Use with extreme caution!'' This
259 feature includes zero protection for the unwary, and an
260 unsuccessful outcome may result in ''severe filesystem
261 corruption!''
262
263
264 ''-P''
265
266
267 Set the maximum sector count for the drive's internal
268 prefetch mechanism. Not all drives support this
269 feature.
270
271
272 ''-q''
273
274
275 Handle the next flag quietly, supressing normal output. This
276 is useful for reducing screen clutter when running from
277 /etc/rc.c/rc.local. Not applicable to the ''-i'' or
278 ''-v'' or ''-t'' or ''-T'' flags.
279
280
281 ''-r''
282
283
284 Get/set read-only flag for device. When set, write
285 operations are not permitted on the device.
286
287
288 ''-R''
289
290
291 Register an IDE interface. __Dangerous.__ See the
292 __-U__ option for more information.
293
294
295 ''-S''
296
297
298 Set the standby (spindown) timeout for the drive. This value
299 is used by the drive to determine how long to wait (with no
300 disk activity) before turning off the spindle motor to save
301 power. Under such circumstances, the drive may take as long
302 as 30 seconds to respond to a subsequent disk access, though
303 most drives are much quicker. The encoding of the timeout
304 value is somewhat peculiar. A value of zero means
305
306
307 ''-T''
308
309
310 Perform timings of cache reads for benchmark and comparison
311 purposes. For meaningful results, this operation should be
312 repeated 2-3 times on an otherwise inactive system (no other
313 active processes) with at least a couple of megabytes of
314 free memory. This displays the speed of reading directly
315 from the Linux buffer cache without disk access. This
316 measurement is essentially an indication of the throughput
317 of the processor, cache, and memory of the system under
318 test. If the ''-t'' flag is also specified, then a
319 correction factor based on the outcome of ''-T'' will be
320 incorporated into the result reported for the ''-t''
321 operation.
322
323
324 ''-t''
325
326
327 Perform timings of device reads for benchmark and comparison
328 purposes. For meaningful results, this operation should be
329 repeated 2-3 times on an otherwise inactive system (no other
330 active processes) with at least a couple of megabytes of
331 free memory. This displays the speed of reading through the
332 buffer cache to the disk without any prior caching of data.
333 This measurement is an indication of how fast the drive can
334 sustain sequential data reads under Linux, without any
335 filesystem overhead. To ensure accurate measurments, the
336 buffer cache is flushed during the processing of ''-t''
337 using the BLKFLSBUF ioctl. If the ''-T'' flag is also
338 specified, then a correction factor based on the outcome of
339 ''-T'' will be incorporated into the result reported for
340 the ''-t'' operation.
341
342
343 ''-u''
344
345
346 Get/set interrupt-unmask flag for the drive. A setting of
347 __1__ permits the driver to unmask other interrupts
348 during processing of a disk interrupt, which greatly
349 improves Linux's responsiveness and eliminates
350 __Use this feature with
351 caution:__ some drive/controller combinations do not
352 tolerate the increased I/O latencies possible when this
353 feature is enabled, resulting in __massive filesystem
354 corruption.__ In particular, __CMD-640B__ and
355 __RZ1000__ (E)IDE interfaces can be __unreliable__
356 (due to a hardware flaw) when this option is used with
357 kernel versions earlier than 2.0.13. Disabling the __IDE
358 prefetch__ feature of these interfaces (usually a
359 BIOS/CMOS setting) provides a safe fix for the problem for
360 use with earlier kernels.
361
362
363 ''-U''
364
365
366 Un-register an IDE interface. __Dangerous.__ The
367 companion for the __-R__ option. Intended for use with
368 hardware made specifically for hot-swapping (very rare!).
369 Use with knowledge and __extreme caution__ as this can
370 easily hang or damage your system. The hdparm source
371 distribution includes a 'contrib' directory with some
2 perry 372 user-donated scripts for hot-swapping on the !UltraBay of a
373 !ThinkPad 600E. Use at your own risk.
1 perry 374
375
376 ''-v''
377
378
379 Display all settings, except -i (same as -acdgkmnru for IDE,
380 -gr for SCSI or -adgr for XT). This is also the default
381 behaviour when no flags are specified. -TP ''-w'' Perform
382 a device reset (DANGEROUS). Do NOT use this option. It
383 exists for unlikely situations where a reboot might
384 otherwise be required to get a confused drive back into a
385 useable state.
386
387
388 ''-W''
389
390
391 Disable/enable the IDE drive's write-caching feature
392 (default state is undeterminable; manufacturer/model
393 specific).
394
395
396 ''-X''
397
398
399 Set the IDE transfer mode for newer (E)IDE/ATA2 drives. This
400 is typically used in combination with ''-d1'' when
401 enabling DMA to/from a drive on a supported interface
402 chipset (such as the Intel 430FX Triton), where ''-X34''
403 is used to select multiword DMA mode2 transfers. With
404 systems which support UltraDMA burst timings, ''-X66'' is
405 used to select UltraDMA mode2 transfers (you'll need to
406 prepare the chipset for UltraDMA beforehand). Apart from
407 that, use of this flag is ''seldom necessary'' since
408 most/all modern IDE drives default to their fastest PIO
409 transfer mode at power-on. Fiddling with this can be both
410 needless and risky. On drives which support alternate
411 transfer modes, ''-X'' can be used to switch the mode of
412 the drive ''only.'' Prior to changing the transfer mode,
413 the IDE interface should be jumpered or programmed (see
414 ''-p'' flag) for the new mode setting to prevent loss
415 and/or corruption of data. ''Use this with extreme
416 caution!'' For the PIO (Programmed Input/Output) transfer
417 modes used by Linux, this value is simply the desired PIO
418 mode number plus 8. Thus, a value of 09 sets PIO mode1, 10
419 enables PIO mode2, and 11 selects PIO mode3. Setting 00
420 restores the drive's
421 ''
422
423
424 ''-y''
425
426
427 Force an IDE drive to immediately enter the low power
428 consumption __standby__ mode, usually causing it to spin
429 down. The current power mode status can be checked using the
430 __-C__ flag.
431
432
433 ''-Y''
434
435
436 Force an IDE drive to immediately enter the lowest power
437 consumption __sleep__ mode, causing it to shut down
438 completely. A hard or soft reset is required before the
439 drive can be accessed again (the Linux IDE driver will
440 automatically handle issuing a reset if/when needed). The
441 current power mode status can be checked using the __-C__
442 flag.
443
444
445 ''-Z''
446
447
448 Disable the automatic power-saving function of certain
449 Seagate drives (ST3xxx models?), to prevent them from
450 idling/spinning-down at inconvenient times.
451 !!BUGS
452
453
454 As noted above, the __-m sectcount__ and __-u 1__
455 options should be used with caution at first, preferably on
456 a read-only filesystem. Most drives work well with these
457 features, but a few drive/controller combinations are not
458 100% compatible. Filesystem corruption may result. Backup
459 everything before experimenting!
460
461
462 Some options (eg. -r for SCSI) may not work with old kernels
463 as necessary ioctl()'s were not supported.
464
465
466 Although this utility is intended primarily for use with
467 (E)IDE hard disk devices, several of the options are also
468 valid (and permitted) for use with SCSI hard disk devices
469 and MFM/RLL hard disks with XT interfaces.
470 !!AUTHOR
471
472
473 __hdparm__ has been written by Mark Lord
474 __
475
476
477 The disable Seagate auto-powersaving code is courtesy of
478 Tomi Leppikangas(tomilepp@paju.oulu.fi).
479 !!SEE ALSO
480
481
482 __AT Attachment Interface for Disk Drives,__ ANSI ASC
483 X3T9.2 working draft, revision 4a, April 19,
484 1993.
485
486
487 __AT Attachment Interface with Extensions (ATA-2),__ ANSI
488 ASC X3T9.2 working draft, revision 2f, July 26,
489 1994.
490
491
492 __AT Attachment with Packet Interface - 5
493 (ATA/ATAPI-5),__ T13-1321D working draft, revision 3,
494 February 29, 2000.
495
496
497 __Western Digital Enhanced IDE Implementation Guide,__ by
498 Western Digital Corporation, revision 5.0, November 10,
499 1993.
500
501
502 __Enhanced Disk Drive Specification,__ by Phoenix
503 Technologies Ltd., version 1.0, January 25,
504 1994.
505 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.