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

« back to all changes in this revision

Viewing changes to hdparm.8

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Gran
  • Date: 2010-01-17 18:02:44 UTC
  • mto: (2.1.5 sid)
  • mto: This revision was merged to the branch mainline in revision 31.
  • Revision ID: james.westby@ubuntu.com-20100117180244-p53m2zbnkf9my7sp
Tags: upstream-9.27
ImportĀ upstreamĀ versionĀ 9.27

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.TH HDPARM 8 "April 2009" "Version 9.15"
 
1
.TH HDPARM 8 "September 2009" "Version 9.27"
2
2
 
3
3
.SH NAME
4
4
hdparm \- get/set SATA/IDE device parameters
170
170
as the drive will automatically switch speeds on its own.
171
171
But if you want to play with it, just supply a speed number
172
172
after the option, usually a number like 2 or 4.
 
173
This can be useful in some cases, though, to smooth out DVD video playback.
173
174
.TP
174
175
.I -f
175
176
Sync and flush the buffer cache for the device on exit.
179
180
.B -T
180
181
timings and other flags.
181
182
.TP
 
183
.I --fallocate
 
184
This flag currently works only on ext4 and xfs filesystem types.
 
185
When used, this must be the only flag given.
 
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
 
192
Eg. Create a 10KByte file:
 
193
.B hdparm --fallocate 10 temp_file
 
194
.TP
182
195
.I --fibmap
183
196
When used, this must be the only flag given.
184
197
It requires a file path as a parameter, and will print
185
 
out a list of the device extents (sector ranges) occupied by that file
186
 
on disk.  Sector numbers are given as absolute LBA numbers,
187
 
referenced from sector 0 of the physical device
188
 
(*not* the partition or filesystem).
 
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.
189
203
This information can then be used for a variety of purposes,
190
204
such as examining the degree of fragmenation of larger files, or
191
205
determining appropriate sectors to deliberately corrupt
192
206
during fault-injection testing procedures.
193
 
.TP
194
 
.I --fibmap-sector
195
 
When used, this must be the only flag given.
196
 
It requires a file path followed by a sector number as parameters.
197
 
This sector number is given relative to the start of the file itself,
198
 
not the device.  hdparm will scan the device extents occupied by the file,
199
 
and print out the absolute LBA number of the requested sector of the file.
200
 
This LBA number is referenced from sector 0 of the physical device
201
 
(not the partition or filesystem).
202
 
This LBA value can then be used for a variety of purposes,
203
 
including determining an appropriate sector to deliberately corrupt
204
 
during fault-injection testing procedures.
 
207
.IP
 
208
This flag uses the new FIEMAP (file extent map) ioctl() when available,
 
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
 
213
in ext4/xfs file systems, unless a sync() is done before using this flag.
205
214
.TP
206
215
.I --fwdownload
207
216
When used, this should be the only flag given.
214
223
or, if the drive supports it, transfer protocol 3 (segmented download).
215
224
This command is 
216
225
.B EXTREMELY DANGEROUS
217
 
and
218
 
.B HAS NEVER BEEN PROVEN TO WORK
219
 
and will probably destroy both the drive and all data on it.
 
226
and could destroy both the drive and all data on it.
220
227
.B DO NOT USE THIS COMMAND.
 
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.
221
238
.TP
222
239
.I -F
223
240
Flush the on-drive write cache buffer (older drives may not implement this).
352
369
.TP
353
370
.I --make-bad-sector
354
371
Deliberately create a bad sector (aka. "media error") on the disk.
355
 
EXCEPTIONALLY DANGEROUS.  DO NOT USE THIS FLAG!!
 
372
.B EXCEPTIONALLY DANGEROUS.  DO NOT USE THIS FLAG!!
356
373
This can be useful for testing of device/RAID error recovery mechanisms.
357
374
The sector number is given as a (base10) parameter after the flag.
358
375
Depending on the device, hdparm will choose one of two possible ATA commands for
562
579
.I -t
563
580
using the BLKFLSBUF ioctl.
564
581
.TP
 
582
.I --trim-sector-ranges
 
583
For Solid State Drives (SSDs).
 
584
.B EXCEPTIONALLY DANGEROUS.  DO NOT USE THIS FLAG!!
 
585
Tells the drive firmware 
 
586
to discard unneeded data sectors, destroying any data that may have
 
587
been present within them.  This makes those sectors available for
 
588
immediate use by the firmware's garbage collection mechanism, to
 
589
improve scheduling for wear-leveling of the flash media.
 
590
This option expects one or more sector range pairs immediately after the flag:
 
591
an LBA starting address, a colon, and a sector count, with no intervening spaces.
 
592
.B EXCEPTIONALLY DANGEROUS.  DO NOT USE THIS FLAG!!
 
593
.IP
 
594
Eg.
 
595
.B hdparm --trim-sector-ranges 1000:4 7894:16 /dev/sdz
 
596
.TP
 
597
.I --trim-sector-ranges-stdin
 
598
Identical to
 
599
.B --trim-sector-ranges
 
600
above, except the list of lba:count pairs is read from stdin
 
601
rather than being specified on the command line.  This can be used
 
602
to avoid problems with excessively long command lines.  It also permits
 
603
batching of many more sector ranges into single commands to the drive,
 
604
up to the currently configured transfer limit (max_sectors_kb). 
 
605
.TP
565
606
.I -u
566
607
Get/set interrupt-unmask flag for the drive.  A setting of
567
608
.B 1