~ubuntu-branches/ubuntu/natty/hdparm/natty

1.1.14 by Stephen Gran
Import upstream version 9.32
1
.TH HDPARM 8 "September 2010" "Version 9.32"
1 by Chris Hanson
Import upstream version 4.5
2
3
.SH NAME
1.1.12 by Stephen Gran
Import upstream version 9.15
4
hdparm \- get/set SATA/IDE device parameters
1 by Chris Hanson
Import upstream version 4.5
5
.SH SYNOPSIS
6
.B hdparm
1.1.14 by Stephen Gran
Import upstream version 9.32
7
[options] [device ...]
1 by Chris Hanson
Import upstream version 4.5
8
.SH DESCRIPTION
9
.BI hdparm
1.1.10 by Daniel Hahler
Import upstream version 8.6
10
provides a command line interface to various kernel interfaces
1.1.8 by Michael Vogt
Import upstream version 7.5
11
supported by the Linux SATA/PATA/SAS "libata" subsystem
1.1.12 by Stephen Gran
Import upstream version 9.15
12
and the older IDE driver subsystem.  Many newer (2008 and later)
13
USB drive enclosures now also support "SAT" (SCSI-ATA Command Translation)
1.1.14 by Stephen Gran
Import upstream version 9.32
14
and therefore may also work with hdparm.  E.g. recent WD "Passport" models
1.1.12 by Stephen Gran
Import upstream version 9.15
15
and recent NexStar-3 enclosures.
1 by Chris Hanson
Import upstream version 4.5
16
Some options may work correctly only with the latest kernels.
17
.SH OPTIONS
1.1.14 by Stephen Gran
Import upstream version 9.32
18
When no options are given,
1.1.12 by Stephen Gran
Import upstream version 9.15
19
.B -acdgkmur
1 by Chris Hanson
Import upstream version 4.5
20
is assumed.
1.1.14 by Stephen Gran
Import upstream version 9.32
21
For "Get/set" options, a query without the optional parameter (e.g. \-d) will query (get)
1.1.12 by Stephen Gran
Import upstream version 9.15
22
the device state, and with a parameter (e.g., \-d0) will set the device state.
1 by Chris Hanson
Import upstream version 4.5
23
.TP
24
.I -a 
1.1.6 by Scott James Remnant
Import upstream version 6.9
25
Get/set sector count for filesystem (software) read-ahead.
26
This is used to improve performance in sequential reads of large files,
27
by prefetching additional
1 by Chris Hanson
Import upstream version 4.5
28
blocks in anticipation of them being needed by the running task.
1.1.6 by Scott James Remnant
Import upstream version 6.9
29
Many IDE drives also have a separate built-in read-ahead function,
30
which augments this filesystem (software) read-ahead function.
1 by Chris Hanson
Import upstream version 4.5
31
.TP
32
.I -A
1.1.7 by Michael Vogt
Import upstream version 7.1
33
Get/set the IDE drive\'s read-lookahead feature (usually ON by default).
1.1.2 by Jeff Bailey
Import upstream version 5.8
34
Usage:
35
.B -A0
36
(disable) or
37
.B -A1
38
(enable).
1 by Chris Hanson
Import upstream version 4.5
39
.TP
40
.I -b
41
Get/set bus state.
42
.TP
43
.I -B
1.1.14 by Stephen Gran
Import upstream version 9.32
44
Get/set Advanced Power Management feature, if the drive supports it. A low value
1.1.10 by Daniel Hahler
Import upstream version 8.6
45
means aggressive power management and a high value means better performance.
46
Possible settings range from values 1 through 127 (which permit spin-down),
47
and values 128 through 254 (which do not permit spin-down).
48
The highest degree of power management is attained with a setting of 1,
49
and the highest I/O performance with a setting of 254.
50
A value of 255 tells hdparm to disable Advanced Power Management altogether
51
on the drive (not all drives support disabling it, but most do).
1 by Chris Hanson
Import upstream version 4.5
52
.TP
53
.I -c
1.1.14 by Stephen Gran
Import upstream version 9.32
54
Get/set (E)IDE 32-bit I/O support.  A numeric parameter can be
55
used to enable/disable 32-bit I/O support.
1 by Chris Hanson
Import upstream version 4.5
56
Currently supported values include
1.1.12 by Stephen Gran
Import upstream version 9.15
57
.B 0
1 by Chris Hanson
Import upstream version 4.5
58
to disable 32-bit I/O support,
1.1.12 by Stephen Gran
Import upstream version 9.15
59
.B 1
1 by Chris Hanson
Import upstream version 4.5
60
to enable 32-bit data transfers, and
1.1.12 by Stephen Gran
Import upstream version 9.15
61
.B 3
1 by Chris Hanson
Import upstream version 4.5
62
to enable 32-bit data transfers with a special
1.1.12 by Stephen Gran
Import upstream version 9.15
63
.B sync
1 by Chris Hanson
Import upstream version 4.5
64
sequence required by many chipsets.  The value
1.1.12 by Stephen Gran
Import upstream version 9.15
65
.B 3
1 by Chris Hanson
Import upstream version 4.5
66
works with nearly all
67
32-bit IDE chipsets, but incurs slightly more overhead.
68
Note that "32-bit" refers to data transfers across a PCI or VLB bus to the
69
interface card only; all (E)IDE drives still have only a 16-bit connection
70
over the ribbon cable from the interface card.
71
.TP
72
.I -C
73
Check the current IDE power mode status, which will always be one of
74
.B unknown
75
(drive does not support this command),
76
.B active/idle
77
(normal operation),
78
.B standby
79
(low power mode, drive has spun down),
80
or
81
.B sleeping
82
(lowest power mode, drive is completely shut down).
83
The
84
.B -S, -y, -Y,
85
and
86
.B -Z
1.1.14 by Stephen Gran
Import upstream version 9.32
87
options can be used to manipulate the IDE power modes.
1 by Chris Hanson
Import upstream version 4.5
88
.TP
89
.I -d
1.1.14 by Stephen Gran
Import upstream version 9.32
90
Get/set the "using_dma" flag for this drive.  This option now works
1.1.1 by Nathaniel McCallum
Import upstream version 5.5
91
with most combinations of drives and PCI interfaces which support DMA
1.1.3 by Scott James Remnant
Import upstream version 6.1
92
and which are known to the kernel IDE driver.
1.1.1 by Nathaniel McCallum
Import upstream version 5.5
93
It is also a good idea to use the appropriate
1.1.12 by Stephen Gran
Import upstream version 9.15
94
.B -X
1 by Chris Hanson
Import upstream version 4.5
95
option in combination with
1.1.12 by Stephen Gran
Import upstream version 9.15
96
.B -d1
1.1.1 by Nathaniel McCallum
Import upstream version 5.5
97
to ensure that the drive itself is programmed for the correct DMA mode,
98
although most BIOSs should do this for you at boot time.
99
Using DMA nearly always gives the best performance,
100
with fast I/O throughput and low CPU usage.
101
But there are at least a few configurations of chipsets and drives
102
for which DMA does not make much of a difference, or may even slow
103
things down (on really messed up hardware!).  Your mileage may vary.
1 by Chris Hanson
Import upstream version 4.5
104
.TP
1.1.12 by Stephen Gran
Import upstream version 9.15
105
.I --dco-freeze
106
DCO stands for Device Configuration Overlay, a way for vendors to selectively
107
disable certain features of a drive.  The 
108
.B --dco-freeze
1.1.14 by Stephen Gran
Import upstream version 9.32
109
option will freeze/lock the current drive configuration,
1.1.12 by Stephen Gran
Import upstream version 9.15
110
thereby preventing software (or malware)
111
from changing any DCO settings until after the next power-on reset.
112
.TP
113
.I --dco-identify
114
Query and dump information regarding drive configuration settings
115
which can be disabled by the vendor or OEM installer.
116
These settings show capabilities of the drive which might be disabled
117
by the vendor for "enhanced compatibility".
118
When disabled, they are otherwise hidden and will not show in the
119
.B -I
120
identify output.  For example, system vendors sometimes disable 48_bit
121
addressing on large drives, for compatibility (and loss of capacity)
122
with a specific BIOS.  In such cases,
123
.B --dco-identify
124
will show that the drive is 48_bit capable, but
125
.B -I
126
will not show it, and nor will the drive accept 48_bit commands.
127
.TP
128
.I --dco-restore
129
Reset all drive settings, features, and accessible capacities back to factory defaults
130
and full capabilities.  This command will fail if DCO is frozen/locked,
131
or if a
132
.B -Np
133
maximum size restriction has also been set.
134
This is
135
.B EXTREMELY DANGEROUS
136
and will very likely cause massive loss of data.
137
.B DO NOT USE THIS COMMAND.
138
.TP
1.1.5 by Scott James Remnant
Import upstream version 6.6
139
.I --direct
1.1.14 by Stephen Gran
Import upstream version 9.32
140
Use the kernel\'s "O_DIRECT" flag when performing a
1.1.12 by Stephen Gran
Import upstream version 9.15
141
.B -t
1.1.5 by Scott James Remnant
Import upstream version 6.6
142
timing test.  This bypasses the page cache, causing the reads
143
to go directly from the drive into hdparm's buffers, using so-called
144
"raw" I/O.  In many cases, this can produce results that appear
145
much faster than the usual page cache method, giving a better indication
146
of raw device and driver performance.
147
.TP
1.1.8 by Michael Vogt
Import upstream version 7.5
148
.I --drq-hsm-error
1.1.12 by Stephen Gran
Import upstream version 9.15
149
.B VERY DANGEROUS, DON'T EVEN THINK ABOUT USING IT.
1.1.14 by Stephen Gran
Import upstream version 9.32
150
This option causes hdparm to issue an IDENTIFY command
1.1.8 by Michael Vogt
Import upstream version 7.5
151
to the kernel, but incorrectly marked as a "non-data" command.
152
This results in the drive being left with its DataReQust(DRQ) line
153
"stuck" high.  This confuses the kernel drivers, and may crash the system
154
immediately with massive data loss.  The option exists to help in testing
155
and fortifying the kernel against similar real-world drive malfunctions.
1.1.12 by Stephen Gran
Import upstream version 9.15
156
.B VERY DANGEROUS, DO NOT USE!!
1.1.8 by Michael Vogt
Import upstream version 7.5
157
.TP
1 by Chris Hanson
Import upstream version 4.5
158
.I -D
159
Enable/disable the on-drive defect management feature,
160
whereby the drive firmware tries to automatically manage
161
defective sectors by relocating them to "spare" sectors
1.1.7 by Michael Vogt
Import upstream version 7.1
162
reserved by the factory for such.  Control of this feature
163
via the
1.1.12 by Stephen Gran
Import upstream version 9.15
164
.B -D
1.1.14 by Stephen Gran
Import upstream version 9.32
165
option is not supported for most modern drives
1.1.7 by Michael Vogt
Import upstream version 7.1
166
since ATA-4; thus this command may fail.
1 by Chris Hanson
Import upstream version 4.5
167
.TP
168
.I -E
1.1.12 by Stephen Gran
Import upstream version 9.15
169
Set cd/dvd drive speed.  This is NOT necessary for regular operation,
1 by Chris Hanson
Import upstream version 4.5
170
as the drive will automatically switch speeds on its own.
171
But if you want to play with it, just supply a speed number
172
after the option, usually a number like 2 or 4.
1.1.13 by Stephen Gran
Import upstream version 9.27
173
This can be useful in some cases, though, to smooth out DVD video playback.
1 by Chris Hanson
Import upstream version 4.5
174
.TP
175
.I -f
176
Sync and flush the buffer cache for the device on exit.
1.1.10 by Daniel Hahler
Import upstream version 8.6
177
This operation is also performed internally as part of the
1.1.12 by Stephen Gran
Import upstream version 9.15
178
.B -t
1 by Chris Hanson
Import upstream version 4.5
179
and
1.1.12 by Stephen Gran
Import upstream version 9.15
180
.B -T
1.1.14 by Stephen Gran
Import upstream version 9.32
181
timings and other options.
1 by Chris Hanson
Import upstream version 4.5
182
.TP
1.1.13 by Stephen Gran
Import upstream version 9.27
183
.I --fallocate
1.1.14 by Stephen Gran
Import upstream version 9.32
184
This option currently works only on ext4 and xfs filesystem types.
185
When used, this must be the only option given.
1.1.13 by Stephen Gran
Import upstream version 9.27
186
It requires two parameters: the desired file size in kilo-bytes
187
(byte count divided by 1024), followed by the pathname for the new file.
188
It will create a new file of the specified size,
189
but without actually having to write any data to the file.
190
This will normally complete very quickly, and without thrashing the storage device.
191
.IP
1.1.14 by Stephen Gran
Import upstream version 9.32
192
E.g. Create a 10KByte file:
1.1.13 by Stephen Gran
Import upstream version 9.27
193
.B hdparm --fallocate 10 temp_file
194
.TP
1.1.11 by Michael Vogt
Import upstream version 8.9
195
.I --fibmap
1.1.14 by Stephen Gran
Import upstream version 9.32
196
When used, this must be the only option given.
1.1.11 by Michael Vogt
Import upstream version 8.9
197
It requires a file path as a parameter, and will print
1.1.13 by Stephen Gran
Import upstream version 9.27
198
out a list of the block extents (sector ranges)
199
occupied by that file on disk.
200
Sector numbers are given as absolute LBA numbers,
201
referenced from sector 0 of the physical device rather
202
than from the partition or filesystem.
1.1.11 by Michael Vogt
Import upstream version 8.9
203
This information can then be used for a variety of purposes,
1.1.12 by Stephen Gran
Import upstream version 9.15
204
such as examining the degree of fragmenation of larger files, or
205
determining appropriate sectors to deliberately corrupt
1.1.11 by Michael Vogt
Import upstream version 8.9
206
during fault-injection testing procedures.
1.1.13 by Stephen Gran
Import upstream version 9.27
207
.IP
1.1.14 by Stephen Gran
Import upstream version 9.32
208
This option uses the new FIEMAP (file extent map) ioctl() when available,
1.1.13 by Stephen Gran
Import upstream version 9.27
209
and falls back to the older FIBMAP (file block map) ioctl() otherwise.
210
Note that FIBMAP suffers from a 32-bit block-number interface,
211
and thus not work beyond 8TB or 16TB.  FIBMAP is also very slow,
212
and does not deal well with preallocated uncommitted extents
1.1.14 by Stephen Gran
Import upstream version 9.32
213
in ext4/xfs filesystems, unless a sync() is done before using this option.
1.1.11 by Michael Vogt
Import upstream version 8.9
214
.TP
1.1.12 by Stephen Gran
Import upstream version 9.15
215
.I --fwdownload
1.1.14 by Stephen Gran
Import upstream version 9.32
216
When used, this should be the only option given.
1.1.12 by Stephen Gran
Import upstream version 9.15
217
It requires a file path immediately after the
1.1.14 by Stephen Gran
Import upstream version 9.32
218
option, indicating where the new drive firmware should be read from.
1.1.12 by Stephen Gran
Import upstream version 9.15
219
The contents of this file will be sent to the drive using the
220
(S)ATA
221
.B DOWNLOAD MICROCODE
222
command, using either transfer protocol 7 (entire file at once),
223
or, if the drive supports it, transfer protocol 3 (segmented download).
224
This command is 
225
.B EXTREMELY DANGEROUS
1.1.13 by Stephen Gran
Import upstream version 9.27
226
and could destroy both the drive and all data on it.
1.1.12 by Stephen Gran
Import upstream version 9.15
227
.B DO NOT USE THIS COMMAND.
1.1.13 by Stephen Gran
Import upstream version 9.27
228
The 
229
.B --fwdownload-mode3
230
,
231
.B --fwdownload-mode3-max
232
, and
233
.B --fwdownload-mode7
234
variations on basic
235
.B --fwdownload
236
allow overriding automatic protocol detection in favour of
237
forcing hdparm to use a specific transfer protocol, for testing purposes only.
1.1.12 by Stephen Gran
Import upstream version 9.15
238
.TP
1.1.9 by Michael Vogt
Import upstream version 7.7
239
.I -F
240
Flush the on-drive write cache buffer (older drives may not implement this).
241
.TP
1 by Chris Hanson
Import upstream version 4.5
242
.I -g
243
Display the drive geometry (cylinders, heads, sectors),
244
the size (in sectors) of the device,
245
and the starting offset (in sectors) of the device from
246
the beginning of the drive.
247
.TP
248
.I -h
249
Display terse usage information (help).
250
.TP
1.1.14 by Stephen Gran
Import upstream version 9.32
251
.I -H
252
Read the temperature from some (mostly Hitachi) drives. 
253
Also reports if the temperature is within operating condition range
254
(this may not be reliable). Does not cause the drive to spin up if idle.
255
.TP
1 by Chris Hanson
Import upstream version 4.5
256
.I -i
1.1.12 by Stephen Gran
Import upstream version 9.15
257
Display the identification info which the kernel drivers (IDE, libata)
258
have stored from boot/configuration time.  This may differ from the
259
current information obtainable directly from the drive itself
260
with the
261
.B -I
1.1.14 by Stephen Gran
Import upstream version 9.32
262
option.
1 by Chris Hanson
Import upstream version 4.5
263
The data returned may or may not be current, depending on activity
264
since booting the system.
265
For a more detailed interpretation of the identification info,
266
refer to
1.1.12 by Stephen Gran
Import upstream version 9.15
267
.I AT Attachment Interface for Disk Drives, 
268
ANSI ASC X3T9.2 working draft, revision 4a, April 19/93, and later editions.
1 by Chris Hanson
Import upstream version 4.5
269
.TP
1.1.12 by Stephen Gran
Import upstream version 9.15
270
.I --idle-immediate
271
Issue an ATA IDLE_IMMEDIATE command, to put the drive into a lower power state.
272
Usually the device remains spun-up.
273
.TP
274
.I --idle-unload
275
Issue an ATA IDLE_IMMEDIATE_WITH_UNLOAD command, to unload or park the heads
276
and put the drive into a lower power state.  Usually the device remains spun-up.
277
.TP
1.1.14 by Stephen Gran
Import upstream version 9.32
278
.I -I
279
Request identification info directly from the drive,
280
which is displayed in a new expanded format with considerably
281
more detail than with the older
282
.B -i
283
option.
284
.TP
1.1.5 by Scott James Remnant
Import upstream version 6.6
285
.I --Istdin
1.1.7 by Michael Vogt
Import upstream version 7.1
286
This is a special variation on the
1.1.2 by Jeff Bailey
Import upstream version 5.8
287
.B -I
288
option,
1.1.1 by Nathaniel McCallum
Import upstream version 5.5
289
which accepts a drive identification block as standard input
290
instead of using a /dev/hd* parameter.
291
The format of this block must be
1.1.12 by Stephen Gran
Import upstream version 9.15
292
.B exactly
1.1.2 by Jeff Bailey
Import upstream version 5.8
293
the same as that found in the /proc/ide/*/hd*/identify "files",
294
or that produced by the
1.1.5 by Scott James Remnant
Import upstream version 6.6
295
.B --Istdout
1.1.2 by Jeff Bailey
Import upstream version 5.8
296
option described below.
297
This variation is designed for use with collected "libraries" of drive
1.1.1 by Nathaniel McCallum
Import upstream version 5.5
298
identification information, and can also be used on ATAPI
299
drives which may give media errors with the standard mechanism.
1.1.7 by Michael Vogt
Import upstream version 7.1
300
When
301
.B --Istdin
302
is used, it must be the *only* parameter given.
1 by Chris Hanson
Import upstream version 4.5
303
.TP
1.1.5 by Scott James Remnant
Import upstream version 6.6
304
.I --Istdout
1.1.7 by Michael Vogt
Import upstream version 7.1
305
This option dumps the drive's identify data in hex to stdout,
306
in a format similar to that from /proc/ide/*/identify, and suitable for
1.1.2 by Jeff Bailey
Import upstream version 5.8
307
later use with the
1.1.12 by Stephen Gran
Import upstream version 9.15
308
.B --Istdin
1.1.2 by Jeff Bailey
Import upstream version 5.8
309
option.
310
.TP
1 by Chris Hanson
Import upstream version 4.5
311
.I -k
1.1.14 by Stephen Gran
Import upstream version 9.32
312
Get/set the "keep_settings_over_reset" flag for the drive.
313
When this flag is set, the drive will preserve the
1.1.12 by Stephen Gran
Import upstream version 9.15
314
.B -dmu
1.1.14 by Stephen Gran
Import upstream version 9.32
315
settings over a soft reset, (as done during the error recovery sequence).
316
This option defaults to off,
1 by Chris Hanson
Import upstream version 4.5
317
to prevent drive reset loops which could be caused by combinations of
1.1.12 by Stephen Gran
Import upstream version 9.15
318
.B -dmu
1 by Chris Hanson
Import upstream version 4.5
319
settings.  The
1.1.12 by Stephen Gran
Import upstream version 9.15
320
.B -k
1.1.14 by Stephen Gran
Import upstream version 9.32
321
option should therefore only be set after one has achieved confidence in
1 by Chris Hanson
Import upstream version 4.5
322
correct system operation with a chosen set of configuration settings.
323
In practice, all that is typically necessary to test a configuration
324
(prior to using -k) is to verify that the drive can be read/written,
325
and that no error logs (kernel messages) are generated in the process
326
(look in /var/adm/messages on most systems).
327
.TP
328
.I -K
1.1.14 by Stephen Gran
Import upstream version 9.32
329
Set the drive\'s "keep_features_over_reset" flag.  Setting this enables
1 by Chris Hanson
Import upstream version 4.5
330
the drive to retain the settings for
1.1.12 by Stephen Gran
Import upstream version 9.15
331
.B -APSWXZ
1 by Chris Hanson
Import upstream version 4.5
332
over a soft reset (as done during the error recovery sequence).
333
Not all drives support this feature.
334
.TP
335
.I -L
1.1.4 by Scott James Remnant
Import upstream version 6.3
336
Set the drive\'s doorlock flag.  Setting this to
1.1.1 by Nathaniel McCallum
Import upstream version 5.5
337
.B 1
338
will lock the door mechanism of some removable hard drives
1.1.14 by Stephen Gran
Import upstream version 9.32
339
(e.g. Syquest, ZIP, Jazz..), and setting it to
1.1.1 by Nathaniel McCallum
Import upstream version 5.5
340
.B 0
341
will unlock the door mechanism.  Normally, Linux
1 by Chris Hanson
Import upstream version 4.5
342
maintains the door locking mechanism automatically, depending on drive usage
343
(locked whenever a filesystem is mounted).  But on system shutdown, this can
1.1.12 by Stephen Gran
Import upstream version 9.15
344
be a nuisance if the root partition is on a removable disk, since the root
1 by Chris Hanson
Import upstream version 4.5
345
partition is left mounted (read-only) after shutdown.  So, by using this
346
command to unlock the door
1.1.1 by Nathaniel McCallum
Import upstream version 5.5
347
.B after
1 by Chris Hanson
Import upstream version 4.5
348
the root filesystem is remounted read-only, one can then remove the cartridge
349
from the drive after shutdown.
350
.TP
351
.I -m
352
Get/set sector count for multiple sector I/O on the drive.  A setting of
353
.B 0
354
disables this feature.  Multiple sector mode (aka IDE Block Mode), is a feature
355
of most modern IDE hard drives, permitting the transfer of multiple sectors per
356
I/O interrupt, rather than the usual one sector per interrupt.  When this
357
feature is enabled, it typically reduces operating system overhead for disk
358
I/O by 30-50%.  On many systems, it also provides increased data throughput
359
of anywhere from 5% to 50%.  Some drives, however
360
(most notably the WD Caviar series),
361
seem to run slower with multiple mode enabled.  Your mileage may vary.
362
Most drives support the minimum settings of
363
2, 4, 8, or 16 (sectors).  Larger settings may also be possible, depending on
364
the drive.  A setting of 16 or 32 seems optimal on many systems.
365
Western Digital recommends lower settings of 4 to 8 on many of their drives,
366
due tiny (32kB) drive buffers and non-optimized buffering algorithms.
367
The
368
.B -i
1.1.14 by Stephen Gran
Import upstream version 9.32
369
option can be used to find the maximum setting supported by an installed drive
1 by Chris Hanson
Import upstream version 4.5
370
(look for MaxMultSect in the output).
371
Some drives claim to support multiple mode, but lose data at some settings.
372
Under rare circumstances, such failures can result in
373
.B massive filesystem corruption.
374
.TP
1.1.10 by Daniel Hahler
Import upstream version 8.6
375
.I --make-bad-sector
376
Deliberately create a bad sector (aka. "media error") on the disk.
1.1.14 by Stephen Gran
Import upstream version 9.32
377
.B EXCEPTIONALLY DANGEROUS.  DO NOT USE THIS OPTION!!
1.1.10 by Daniel Hahler
Import upstream version 8.6
378
This can be useful for testing of device/RAID error recovery mechanisms.
1.1.14 by Stephen Gran
Import upstream version 9.32
379
The sector number is given as a (base10) parameter after the option.
1.1.10 by Daniel Hahler
Import upstream version 8.6
380
Depending on the device, hdparm will choose one of two possible ATA commands for
381
corrupting the sector.  The WRITE_LONG works on most drives, but only up to the 28-bit
382
sector boundary.  Some very recent drives (2008) may support the new WRITE_UNCORRECTABLE_EXT
383
command, which works for any LBA48 sector.  If available, hdparm will use that in
384
preference to WRITE_LONG.  The WRITE_UNCORRECTABLE_EXT command itself presents a
385
choice of how the new bad sector should behave.
386
By default, it will look like any other bad sector, and the drive may take some
387
time to retry and fail on subsequent READs of the sector.
388
However, if a single letter
389
.B f
390
is prepended immediately in front of the first digit of the sector number parameter,
391
then hdparm will issue a "flagged" WRITE_UNCORRECTABLE_EXT, which causes the drive
392
to merely flag the sector as bad (rather than genuinely corrupt it), and subsequent
393
READs of the sector will fail immediately (rather than after several retries).
394
Note also that the
1.1.12 by Stephen Gran
Import upstream version 9.15
395
.B --repair-sector
1.1.14 by Stephen Gran
Import upstream version 9.32
396
option can be used to restore (any) bad sectors when they are no longer needed,
1.1.10 by Daniel Hahler
Import upstream version 8.6
397
including sectors that were genuinely bad (the drive will likely remap those
398
to a fresh area on the media).
399
.TP
1.1.1 by Nathaniel McCallum
Import upstream version 5.5
400
.I -M
401
Get/set Automatic Acoustic Management (AAM) setting. Most modern harddisk drives 
402
have the ability to speed down the head movements to reduce their noise output.
403
The possible values are between 0 and 254. 128 is the most quiet (and therefore
404
slowest) setting and 254 the fastest (and loudest). Some drives have only two 
405
levels (quiet / fast), while others may have different levels between 128 and 254.
1.1.4 by Scott James Remnant
Import upstream version 6.3
406
At the moment, most drives only support 3 options, off, quiet, and fast.
407
These have been assigned the values 0, 128, and 254 at present, respectively,
408
but integer space has been incorporated for future expansion, should this change.
1.1.1 by Nathaniel McCallum
Import upstream version 5.5
409
.TP
1.1.14 by Stephen Gran
Import upstream version 9.32
410
.I -n
411
Get or set the "ignore_write_errors" flag in the driver.
412
Do NOT play with this without grokking the driver source code first.
413
.TP
1.1.10 by Daniel Hahler
Import upstream version 8.6
414
.I -N
415
Get/set max visible number of sectors, also known as the
416
.B Host Protected Area
417
setting.  Without a parameter,
1.1.12 by Stephen Gran
Import upstream version 9.15
418
.B -N
1.1.10 by Daniel Hahler
Import upstream version 8.6
419
displays the current setting, which is reported as two values: the first
420
gives the current max sectors setting, and the second shows
421
the native (real) hardware limit for the disk.
422
The difference between these two values indicates how many sectors of the disk
423
are currently hidden from the operating system, in the form of a
424
.B Host Protected Area (HPA).
425
This area is often used by computer makers to hold diagnostic software,
426
and/or a copy of the originally provided operating system for recovery purposes.
1.1.14 by Stephen Gran
Import upstream version 9.32
427
Another possible use is to hide the true capacity of a very large disk
428
from a BIOS/system that cannot normally cope with drives of that size
429
(eg. most current {2010} BIOSs cannot deal with drives larger than 2TB,
430
so an HPA could be used to cause a 3TB drive to report itself as a 2TB drive).
1.1.10 by Daniel Hahler
Import upstream version 8.6
431
To change the current max (VERY DANGEROUS, DATA LOSS IS EXTREMELY LIKELY),
432
a new value should be provided (in base10) immediately
433
following the
1.1.12 by Stephen Gran
Import upstream version 9.15
434
.B -N
1.1.14 by Stephen Gran
Import upstream version 9.32
435
option.
1.1.10 by Daniel Hahler
Import upstream version 8.6
436
This value is specified as a count of sectors, rather than
437
the "max sector address" of the drive.
438
Drives have the concept of a temporary (volatile) setting which is
439
lost on the next hardware reset, as well as a more permanent (non-volatile)
440
value which survives resets and power cycles.  By default,
1.1.12 by Stephen Gran
Import upstream version 9.15
441
.B -N
1.1.10 by Daniel Hahler
Import upstream version 8.6
442
affects only the temporary (volatile) setting.  To change the permanent
443
(non-volatile) value, prepend a leading
1.1.12 by Stephen Gran
Import upstream version 9.15
444
.B p
1.1.10 by Daniel Hahler
Import upstream version 8.6
445
character immediately before the first digit of the value.
446
Drives are supposed to allow only a single permanent
447
change per session.  A hardware reset (or power cycle) is required
448
before another permanent
1.1.12 by Stephen Gran
Import upstream version 9.15
449
.B -N
1.1.10 by Daniel Hahler
Import upstream version 8.6
450
operation can succeed.  Note that any attempt to set this value
451
may fail if the disk is being accessed by other software at the same time.
452
This is because setting the value requires a pair of back-to-back drive commands,
453
but there is no way to prevent some other command from being inserted between
454
them by the kernel.  So if it fails initially, just try again.
1.1.12 by Stephen Gran
Import upstream version 9.15
455
Kernel support for
456
.B -N
457
is buggy for many adapter types across many kernel versions,
458
in that an incorrect (too small) max size value is sometimes reported.
459
As of the 2.6.27 kernel, this does finally seem to be working on most hardware.
1.1.10 by Daniel Hahler
Import upstream version 8.6
460
.TP
1.1.14 by Stephen Gran
Import upstream version 9.32
461
.I --offset
462
Offsets to given number of GiB (1024*1024*1024) when performing 
463
.B -t
464
timings of device reads. 
465
Speed changes (about twice) along many mechanical drives. 
466
Usually the maximum is at the beginning, but not always.
467
Solid-state drives (SSDs) should show similar timings regardless of offset.
1 by Chris Hanson
Import upstream version 4.5
468
.TP
469
.I -p
470
Attempt to reprogram the IDE interface chipset for the specified PIO mode,
471
or attempt to auto-tune for the "best" PIO mode supported by the drive.
472
This feature is supported in the kernel for only a few "known" chipsets,
473
and even then the support is iffy at best.  Some IDE chipsets are unable
1.1.14 by Stephen Gran
Import upstream version 9.32
474
to alter the PIO mode for a single drive, in which case this option may cause
1 by Chris Hanson
Import upstream version 4.5
475
the PIO mode for
476
.I both
477
drives to be set.  Many IDE chipsets support either fewer or more than the
478
standard six (0 to 5) PIO modes, so the exact speed setting that is actually
479
implemented will vary by chipset/driver sophistication.
480
.I Use with extreme caution!
481
This feature includes zero protection for the unwary,
482
and an unsuccessful outcome may result in
483
.I severe filesystem corruption!
484
.TP
485
.I -P
1.1.4 by Scott James Remnant
Import upstream version 6.3
486
Set the maximum sector count for the drive\'s internal prefetch mechanism.
1.1.7 by Michael Vogt
Import upstream version 7.1
487
Not all drives support this feature, and it was dropped from the offical spec
488
as of ATA-4.
1 by Chris Hanson
Import upstream version 4.5
489
.TP
1.1.12 by Stephen Gran
Import upstream version 9.15
490
.I --prefer-ata12
491
When using the SAT (SCSI ATA Translation) protocol, hdparm normally prefers
492
to use the 16-byte command format whenever possible.
493
But some USB drive enclosures don't work correctly with 16-byte commands.
1.1.14 by Stephen Gran
Import upstream version 9.32
494
This option can be used to force use of the smaller 12-byte command format
1.1.12 by Stephen Gran
Import upstream version 9.15
495
with such drives.  hdparm will still revert to 16-byte commands for things
1.1.14 by Stephen Gran
Import upstream version 9.32
496
that cannot be done with the 12-byte format (e.g. sector accesses beyond 28-bits).
1.1.12 by Stephen Gran
Import upstream version 9.15
497
.TP
1 by Chris Hanson
Import upstream version 4.5
498
.I -q
1.1.14 by Stephen Gran
Import upstream version 9.32
499
Handle the next option quietly, suppressing normal output (but not error messages).
1.1.7 by Michael Vogt
Import upstream version 7.1
500
This is useful for reducing screen clutter when running from system startup scripts.
1 by Chris Hanson
Import upstream version 4.5
501
Not applicable to the
1.1.12 by Stephen Gran
Import upstream version 9.15
502
.B -i
503
or
504
.B -v
505
or
506
.B -t
507
or
508
.B -T
1.1.14 by Stephen Gran
Import upstream version 9.32
509
options.
1 by Chris Hanson
Import upstream version 4.5
510
.TP
1.1.1 by Nathaniel McCallum
Import upstream version 5.5
511
.I -Q
1.1.11 by Michael Vogt
Import upstream version 8.9
512
Get or set the device's command queue_depth, if supported by the hardware.
513
This only works with 2.6.xx (or later) kernels, and only with
514
device and driver combinations which support changing the queue_depth.
515
For SATA disks, this is the Native Command Queuing (NCQ) queue depth.
1.1.1 by Nathaniel McCallum
Import upstream version 5.5
516
.TP
1 by Chris Hanson
Import upstream version 4.5
517
.I -r
1.1.2 by Jeff Bailey
Import upstream version 5.8
518
Get/set read-only flag for the device.  When set, Linux disallows write operations on the device.
1 by Chris Hanson
Import upstream version 4.5
519
.TP
1.1.10 by Daniel Hahler
Import upstream version 8.6
520
.I --read-sector
521
Reads from the specified sector number, and dumps the contents in hex to standard output.
1.1.14 by Stephen Gran
Import upstream version 9.32
522
The sector number must be given (base10) after this option.
1.1.10 by Daniel Hahler
Import upstream version 8.6
523
hdparm will issue a low-level read (completely bypassing the usual block layer read/write mechanisms)
524
for the specified sector.  This can be used to definitively check whether a given sector is bad
525
(media error) or not (doing so through the usual mechanisms can sometimes give false positives).
526
.TP
527
.I --repair-sector
528
This is an alias for the
1.1.12 by Stephen Gran
Import upstream version 9.15
529
.B --write-sector
1.1.14 by Stephen Gran
Import upstream version 9.32
530
option.  VERY DANGEROUS.
1 by Chris Hanson
Import upstream version 4.5
531
.TP
1.1.6 by Scott James Remnant
Import upstream version 6.9
532
.I -s
533
Enable/disable the power-on in standby feature, if supported by
1.1.8 by Michael Vogt
Import upstream version 7.5
534
the drive.
535
.B VERY DANGEROUS.
536
Do not use unless you are absolutely certain
537
that both the system BIOS (or firmware) and the operating system kernel
538
(Linux >= 2.6.22) support probing for drives that use this feature.
539
When enabled, the drive is powered-up in the
1.1.6 by Scott James Remnant
Import upstream version 6.9
540
.B standby
1.1.8 by Michael Vogt
Import upstream version 7.5
541
mode to allow the controller to sequence the spin-up of devices,
542
reducing the instantaneous current draw burden when many drives
543
share a power supply.  Primarily for use in large RAID setups.
1.1.6 by Scott James Remnant
Import upstream version 6.9
544
This feature is usually disabled and the drive is powered-up in the
545
.B active
546
mode (see -C above).
1.1.8 by Michael Vogt
Import upstream version 7.5
547
Note that a drive may also allow enabling this feature by a jumper.
1.1.6 by Scott James Remnant
Import upstream version 6.9
548
Some SATA drives support the control of this feature by pin 11 of
549
the SATA power connector. In these cases, this command may be
550
unsupported or may have no effect.
11 by Scott James Remnant
* Merge from debian unstable, remaining changes:
551
.TP
1 by Chris Hanson
Import upstream version 4.5
552
.I -S
1.1.12 by Stephen Gran
Import upstream version 9.15
553
Put the drive into idle (low-power) mode, and also set the standby
554
(spindown) timeout for the drive.  This timeout value is used
1.1.1 by Nathaniel McCallum
Import upstream version 5.5
555
by the drive to determine how long to wait (with no disk activity)
556
before turning off the spindle motor to save power.  Under such
557
circumstances, the drive may take as long as 30 seconds to respond to
558
a subsequent disk access, though most drives are much quicker.  The
559
encoding of the timeout value is somewhat peculiar.  A value of zero
560
means "timeouts are disabled": the device will not automatically enter
561
standby mode.  Values from 1 to 240 specify multiples of 5 seconds,
562
yielding timeouts from 5 seconds to 20 minutes.  Values from 241 to
563
251 specify from 1 to 11 units of 30 minutes, yielding timeouts from
564
30 minutes to 5.5 hours.  A value of 252 signifies a timeout of 21
565
minutes. A value of 253 sets a vendor-defined timeout period between 8
566
and 12 hours, and the value 254 is reserved.  255 is interpreted as 21
567
minutes plus 15 seconds.  Note that some older drives may have very
568
different interpretations of these values.
1 by Chris Hanson
Import upstream version 4.5
569
.TP
570
.I -t
571
Perform timings of device reads for benchmark and comparison purposes.
572
For meaningful results, this operation should be repeated 2-3 times on
573
an otherwise inactive system (no other active processes) with at least a
574
couple of megabytes of free memory.  This displays the speed of reading
575
through the buffer cache to the disk without any prior caching of data.
576
This measurement is an indication of how fast the drive can sustain
577
sequential data reads under Linux, without any filesystem overhead.  To
1.1.1 by Nathaniel McCallum
Import upstream version 5.5
578
ensure accurate measurements, the buffer cache is flushed during the
1 by Chris Hanson
Import upstream version 4.5
579
processing of
580
.I -t
581
using the BLKFLSBUF ioctl.
582
.TP
1.1.14 by Stephen Gran
Import upstream version 9.32
583
.I -T
584
Perform timings of cache reads for benchmark and comparison purposes.
585
For meaningful results, this operation should be repeated 2-3 times
586
on an otherwise inactive system (no other active processes) with at
587
least a couple of megabytes of free memory.  This displays the speed
588
of reading directly from the Linux buffer cache without disk access.
589
This measurement is essentially an indication of the throughput of the
590
processor, cache, and memory of the system under test.
591
.TP
1.1.13 by Stephen Gran
Import upstream version 9.27
592
.I --trim-sector-ranges
593
For Solid State Drives (SSDs).
1.1.14 by Stephen Gran
Import upstream version 9.32
594
.B EXCEPTIONALLY DANGEROUS.  DO NOT USE THIS OPTION!!
1.1.13 by Stephen Gran
Import upstream version 9.27
595
Tells the drive firmware 
596
to discard unneeded data sectors, destroying any data that may have
597
been present within them.  This makes those sectors available for
598
immediate use by the firmware's garbage collection mechanism, to
599
improve scheduling for wear-leveling of the flash media.
1.1.14 by Stephen Gran
Import upstream version 9.32
600
This option expects one or more sector range pairs immediately after the option:
1.1.13 by Stephen Gran
Import upstream version 9.27
601
an LBA starting address, a colon, and a sector count, with no intervening spaces.
1.1.14 by Stephen Gran
Import upstream version 9.32
602
.B EXCEPTIONALLY DANGEROUS.  DO NOT USE THIS OPTION!!
1.1.13 by Stephen Gran
Import upstream version 9.27
603
.IP
1.1.14 by Stephen Gran
Import upstream version 9.32
604
E.g.
1.1.13 by Stephen Gran
Import upstream version 9.27
605
.B hdparm --trim-sector-ranges 1000:4 7894:16 /dev/sdz
606
.TP
607
.I --trim-sector-ranges-stdin
608
Identical to
609
.B --trim-sector-ranges
610
above, except the list of lba:count pairs is read from stdin
611
rather than being specified on the command line.  This can be used
612
to avoid problems with excessively long command lines.  It also permits
613
batching of many more sector ranges into single commands to the drive,
614
up to the currently configured transfer limit (max_sectors_kb). 
615
.TP
1 by Chris Hanson
Import upstream version 4.5
616
.I -u
1.1.14 by Stephen Gran
Import upstream version 9.32
617
Get/set the interrupt-unmask flag for the drive.  A setting of
1 by Chris Hanson
Import upstream version 4.5
618
.B 1
619
permits the
620
driver to unmask other interrupts during processing of a disk interrupt,
1.1.4 by Scott James Remnant
Import upstream version 6.3
621
which greatly improves Linux\'s responsiveness and eliminates "serial port
1 by Chris Hanson
Import upstream version 4.5
622
overrun" errors.
623
.B Use this feature with caution:
624
some drive/controller combinations do
625
not tolerate the increased I/O latencies possible when this feature is enabled,
626
resulting in
627
.B massive filesystem corruption.
628
In particular,
629
.B CMD-640B
630
and
631
.B RZ1000
632
(E)IDE interfaces can be
633
.B unreliable
634
(due to a hardware flaw) when this option is used with kernel versions earlier
635
than 2.0.13.  Disabling the
636
.B IDE prefetch
637
feature of these interfaces (usually a BIOS/CMOS setting)
638
provides a safe fix for the problem for use with earlier kernels.
639
.TP
640
.I -v 
1.1.7 by Michael Vogt
Import upstream version 7.1
641
Display some basic settings, similar to -acdgkmur for IDE.
1.1.14 by Stephen Gran
Import upstream version 9.32
642
This is also the default behaviour when no options are specified.
1.1.7 by Michael Vogt
Import upstream version 7.1
643
.TP
644
.I --verbose 
645
Display extra diagnostics from some commands.
1.1.1 by Nathaniel McCallum
Import upstream version 5.5
646
.TP
1 by Chris Hanson
Import upstream version 4.5
647
.I -w
1.1.8 by Michael Vogt
Import upstream version 7.5
648
Perform a device reset
649
.B (DANGEROUS).
650
Do NOT use this option.
1 by Chris Hanson
Import upstream version 4.5
651
It exists for unlikely situations where a reboot might otherwise be
652
required to get a confused drive back into a useable state.
653
.TP
1.1.10 by Daniel Hahler
Import upstream version 8.6
654
.I --write-sector
655
Writes zeros to the specified sector number.  VERY DANGEROUS.
1.1.14 by Stephen Gran
Import upstream version 9.32
656
The sector number must be given (base10) after this option.
1.1.10 by Daniel Hahler
Import upstream version 8.6
657
hdparm will issue a low-level write (completely bypassing the usual block layer read/write mechanisms)
658
to the specified sector.  This can be used to force a drive to repair a bad sector (media error).
659
.TP
1 by Chris Hanson
Import upstream version 4.5
660
.I -W
1.1.7 by Michael Vogt
Import upstream version 7.1
661
Get/set the IDE/SATA drive\'s write-caching feature.
1 by Chris Hanson
Import upstream version 4.5
662
.TP
663
.I -X 
1.1.12 by Stephen Gran
Import upstream version 9.15
664
Set the IDE transfer mode for (E)IDE/ATA drives.
1 by Chris Hanson
Import upstream version 4.5
665
This is typically used in combination with
1.1.12 by Stephen Gran
Import upstream version 9.15
666
.B -d1
1.1.1 by Nathaniel McCallum
Import upstream version 5.5
667
when enabling DMA to/from a drive on a supported interface chipset, where
1.1.12 by Stephen Gran
Import upstream version 9.15
668
.B -X mdma2
1.1.1 by Nathaniel McCallum
Import upstream version 5.5
669
is used to select multiword DMA mode2 transfers and
1.1.12 by Stephen Gran
Import upstream version 9.15
670
.B -X sdma1 
1.1.1 by Nathaniel McCallum
Import upstream version 5.5
671
is used to select simple mode 1 DMA transfers.
1 by Chris Hanson
Import upstream version 4.5
672
With systems which support UltraDMA burst timings,
1.1.12 by Stephen Gran
Import upstream version 9.15
673
.B -X udma2
1.1.4 by Scott James Remnant
Import upstream version 6.3
674
is used to select UltraDMA mode2 transfers (you\'ll need to prepare
1 by Chris Hanson
Import upstream version 4.5
675
the chipset for UltraDMA beforehand).
1.1.14 by Stephen Gran
Import upstream version 9.32
676
Apart from that, use of this option is
1.1.12 by Stephen Gran
Import upstream version 9.15
677
.B seldom necessary
1 by Chris Hanson
Import upstream version 4.5
678
since most/all modern IDE drives default to their fastest PIO transfer mode
679
at power-on.  Fiddling with this can be both needless and risky.
680
On drives which support alternate transfer modes,
1.1.12 by Stephen Gran
Import upstream version 9.15
681
.B -X
1 by Chris Hanson
Import upstream version 4.5
682
can be used to switch the mode of the drive
1.1.12 by Stephen Gran
Import upstream version 9.15
683
.B only.
1 by Chris Hanson
Import upstream version 4.5
684
Prior to changing the transfer mode, the IDE interface should be jumpered
685
or programmed (see
1.1.12 by Stephen Gran
Import upstream version 9.15
686
.B -p
1.1.14 by Stephen Gran
Import upstream version 9.32
687
option)
1 by Chris Hanson
Import upstream version 4.5
688
for the new mode setting to prevent loss and/or corruption of data.
689
.I Use this with extreme caution!
690
For the PIO (Programmed Input/Output)
691
transfer modes used by Linux, this value is simply the desired
692
PIO mode number plus 8.
693
Thus, a value of 09 sets PIO mode1, 10 enables PIO mode2,
694
and 11 selects PIO mode3.
1.1.4 by Scott James Remnant
Import upstream version 6.3
695
Setting 00 restores the drive\'s "default" PIO mode, and 01 disables IORDY.
1 by Chris Hanson
Import upstream version 4.5
696
For multiword DMA, the value used is the desired DMA mode number
697
plus 32.  for UltraDMA, the value is the desired UltraDMA mode number
698
plus 64.
699
.TP
700
.I -y
701
Force an IDE drive to immediately enter the low power consumption
702
.B standby
703
mode, usually causing it to spin down.
704
The current power mode status can be checked using the
705
.B -C
1.1.14 by Stephen Gran
Import upstream version 9.32
706
option.
1 by Chris Hanson
Import upstream version 4.5
707
.TP
708
.I -Y
709
Force an IDE drive to immediately enter the lowest power consumption
710
.B sleep
711
mode, causing it to shut down completely.  A hard or soft reset
712
is required before the drive can be accessed again
713
(the Linux IDE driver will automatically handle issuing a reset if/when needed).
714
The current power mode status can be checked using the
715
.B -C
1.1.14 by Stephen Gran
Import upstream version 9.32
716
option.
1 by Chris Hanson
Import upstream version 4.5
717
.TP
1.1.1 by Nathaniel McCallum
Import upstream version 5.5
718
.I -z
719
Force a kernel re-read of the partition table of the specified device(s).
720
.TP
1 by Chris Hanson
Import upstream version 4.5
721
.I -Z
722
Disable the automatic power-saving function of certain Seagate drives
723
(ST3xxx models?), to prevent them from idling/spinning-down
724
at inconvenient times.
1.1.3 by Scott James Remnant
Import upstream version 6.1
725
.TP
1.1.4 by Scott James Remnant
Import upstream version 6.3
726
.SH ATA Security Feature Set
727
.PP
1.1.8 by Michael Vogt
Import upstream version 7.5
728
These switches are
729
.B DANGEROUS
1.1.14 by Stephen Gran
Import upstream version 9.32
730
to experiment with, and might not work with some kernels.
1.1.4 by Scott James Remnant
Import upstream version 6.3
731
.B USE AT YOUR OWN RISK.
732
.TP
733
.I --security-help             
1.1.14 by Stephen Gran
Import upstream version 9.32
734
Display terse usage info for all of the --security-* options.
1.1.4 by Scott James Remnant
Import upstream version 6.3
735
.TP
736
.I --security-freeze             
737
Freeze the drive\'s security settings.
1.1.3 by Scott James Remnant
Import upstream version 6.1
738
The drive does not accept any security commands until next power-on reset.
739
Use this function in combination with --security-unlock to protect drive
740
from any attempt to set a new password. Can be used standalone, too.
1.1.14 by Stephen Gran
Import upstream version 9.32
741
No other options are permitted on the command line with this one.
1.1.3 by Scott James Remnant
Import upstream version 6.1
742
.TP
743
.I --security-unlock PWD 
1.1.4 by Scott James Remnant
Import upstream version 6.3
744
Unlock the drive, using password PWD.
1.1.3 by Scott James Remnant
Import upstream version 6.1
745
Password is given as an ASCII string and is padded with NULs to reach 32 bytes.
1.1.14 by Stephen Gran
Import upstream version 9.32
746
The applicable drive password is selected with the --user-master switch
747
(default is "user" password).
748
No other options are permitted on the command line with this one.
1.1.3 by Scott James Remnant
Import upstream version 6.1
749
.TP
750
.I --security-set-pass PWD 
1.1.8 by Michael Vogt
Import upstream version 7.5
751
Lock the drive, using password PWD (Set Password)
752
.B (DANGEROUS).
1.1.3 by Scott James Remnant
Import upstream version 6.1
753
Password is given as an ASCII string and is padded with NULs to reach 32 bytes.
1.1.12 by Stephen Gran
Import upstream version 9.15
754
Use the special password
755
.B NULL
756
to set an empty password.
1.1.14 by Stephen Gran
Import upstream version 9.32
757
The applicable drive password is selected with the --user-master switch
758
(default is "user" password)
759
and the applicable security mode with the --security-mode switch.
760
No other options are permitted on the command line with this one.
1.1.3 by Scott James Remnant
Import upstream version 6.1
761
.TP
762
.I --security-disable PWD 
1.1.4 by Scott James Remnant
Import upstream version 6.3
763
Disable drive locking, using password PWD.
764
Password is given as an ASCII string and is padded with NULs to reach 32 bytes.
1.1.14 by Stephen Gran
Import upstream version 9.32
765
The applicable drive password is selected with the --user-master switch
766
(default is "user" password).
767
No other options are permitted on the command line with this one.
1.1.4 by Scott James Remnant
Import upstream version 6.3
768
.TP
769
.I --security-erase PWD
1.1.8 by Michael Vogt
Import upstream version 7.5
770
Erase (locked) drive, using password PWD
771
.B (DANGEROUS).
1.1.4 by Scott James Remnant
Import upstream version 6.3
772
Password is given as an ASCII string and is padded with NULs to reach 32 bytes.
1.1.12 by Stephen Gran
Import upstream version 9.15
773
Use the special password
774
.B NULL
775
to represent an empty password.
1.1.14 by Stephen Gran
Import upstream version 9.32
776
The applicable drive password is selected with the --user-master switch
777
(default is "user" password).
778
No other options are permitted on the command line with this one.
1.1.4 by Scott James Remnant
Import upstream version 6.3
779
.TP
780
.I --security-erase-enhanced PWD
1.1.8 by Michael Vogt
Import upstream version 7.5
781
Enhanced erase (locked) drive, using password PWD
782
.B (DANGEROUS).
1.1.4 by Scott James Remnant
Import upstream version 6.3
783
Password is given as an ASCII string and is padded with NULs to reach 32 bytes.
1.1.14 by Stephen Gran
Import upstream version 9.32
784
The applicable drive password is selected with the --user-master switch
785
(default is "user" password).
786
No other options are permitted on the command line with this one.
1.1.4 by Scott James Remnant
Import upstream version 6.3
787
.TP
788
.I --user-master USER
789
Specifies which password (user/master) to select.
1.1.14 by Stephen Gran
Import upstream version 9.32
790
.B Defaults to "user" password.
1.1.4 by Scott James Remnant
Import upstream version 6.3
791
Only useful in combination with --security-unlock, --security-set-pass,
792
--security-disable, --security-erase or --security-erase-enhanced.
793
        u       user password
794
        m       master password
795
1.1.3 by Scott James Remnant
Import upstream version 6.1
796
.TP
797
.I --security-mode MODE 
1.1.4 by Scott James Remnant
Import upstream version 6.3
798
Specifies which security mode (high/maximum) to set.
799
.B Defaults to high.
800
Only useful in combination with --security-set-pass.
801
        h       high security
802
        m       maximum security
803
804
.B THIS FEATURE IS EXPERIMENTAL AND NOT WELL TESTED. USE AT YOUR OWN RISK.
1.1.12 by Stephen Gran
Import upstream version 9.15
805
.SH FILES
806
/etc/hdparm.conf
1 by Chris Hanson
Import upstream version 4.5
807
.SH BUGS
808
As noted above, the
809
.B -m sectcount
810
and
811
.B -u 1
812
options should be used with caution at first, preferably on a
813
read-only filesystem.  Most drives work well with these features, but
814
a few drive/controller combinations are not 100% compatible.  Filesystem
815
corruption may result.  Backup everything before experimenting!
816
.PP
1.1.14 by Stephen Gran
Import upstream version 9.32
817
Some options (e.g. -r for SCSI) may not work with old kernels as 
1.1.4 by Scott James Remnant
Import upstream version 6.3
818
necessary ioctl()\'s were not supported.
1 by Chris Hanson
Import upstream version 4.5
819
.PP
1.1.12 by Stephen Gran
Import upstream version 9.15
820
Although this utility is intended primarily for use with SATA/IDE hard disk
1 by Chris Hanson
Import upstream version 4.5
821
devices, several of the options are also valid (and permitted) for use with 
822
SCSI hard disk devices and MFM/RLL hard disks with XT interfaces.
1.1.4 by Scott James Remnant
Import upstream version 6.3
823
.PP
824
The Linux kernel up until 2.6.12 (and probably later) doesn\'t handle the
825
security unlock and disable commands gracefully and will segfault and in some
826
cases even panic. The security commands however might indeed have been executed
827
by the drive. This poor kernel behaviour makes the PIO data security commands
828
rather useless at the moment.
829
.PP
830
Note that the "security erase" and "security disable" commands have been
831
implemented as two consecutive PIO data commands and will not succeed on a
832
locked drive because the second command will not be issued after the segfault.
833
See the code for hints how patch it to work around this problem. Despite the
834
segfault it is often still possible to run two instances of hdparm
835
consecutively and issue the two necessary commands that way.
1 by Chris Hanson
Import upstream version 4.5
836
.SH AUTHOR
837
.B hdparm
1.1.4 by Scott James Remnant
Import upstream version 6.3
838
has been written by Mark Lord <mlord@pobox.com>, the original primary
1.1.12 by Stephen Gran
Import upstream version 9.15
839
developer and maintainer of the (E)IDE driver for Linux, and current contributer
840
to the libata subsystem, along with suggestions and patches from many netfolk.
1 by Chris Hanson
Import upstream version 4.5
841
.PP
842
The disable Seagate auto-powersaving code
843
is courtesy of Tomi Leppikangas(tomilepp@paju.oulu.fi).
1.1.4 by Scott James Remnant
Import upstream version 6.3
844
.PP
1.1.10 by Daniel Hahler
Import upstream version 8.6
845
Security freeze command by Benjamin Benz, 2005.
1.1.4 by Scott James Remnant
Import upstream version 6.3
846
.PP
1.1.14 by Stephen Gran
Import upstream version 9.32
847
PIO data out security commands by Leonard den Ottolander, 2005.
1.1.10 by Daniel Hahler
Import upstream version 8.6
848
Some other parts by Benjamin Benz and others.
1 by Chris Hanson
Import upstream version 4.5
849
.SH SEE ALSO
1.1.5 by Scott James Remnant
Import upstream version 6.6
850
.B http://www.t13.org/
1.1.8 by Michael Vogt
Import upstream version 7.5
851
Technical Committee T13 AT Attachment (ATA/ATAPI) Interface.
1.1.5 by Scott James Remnant
Import upstream version 6.6
852
.PP
853
.B http://www.serialata.org/
854
Serial ATA International Organization.
1.1.8 by Michael Vogt
Import upstream version 7.5
855
.PP
856
.B http://www.compactflash.org/
1.1.14 by Stephen Gran
Import upstream version 9.32
857
CompactFlash Association.