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.
175
176
Sync and flush the buffer cache for the device on exit.
180
181
timings and other flags.
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.
192
Eg. Create a 10KByte file:
193
.B hdparm --fallocate 10 temp_file
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.
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.
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.
207
216
When used, this should be the only flag given.
214
223
or, if the drive supports it, transfer protocol 3 (segmented download).
216
225
.B EXTREMELY DANGEROUS
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.
229
.B --fwdownload-mode3
231
.B --fwdownload-mode3-max
233
.B --fwdownload-mode7
236
allow overriding automatic protocol detection in favour of
237
forcing hdparm to use a specific transfer protocol, for testing purposes only.
223
240
Flush the on-drive write cache buffer (older drives may not implement this).
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
563
580
using the BLKFLSBUF ioctl.
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!!
595
.B hdparm --trim-sector-ranges 1000:4 7894:16 /dev/sdz
597
.I --trim-sector-ranges-stdin
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).
566
607
Get/set interrupt-unmask flag for the drive. A setting of