In 2005, Canadian Mark Lord developed the small hdparm utility to test Linux drivers for IDE hard drives. Since then, the program has developed into a valuable tool for diagnosis and tuning of hard drives. For example, it tests the speed of hard drives and solid state disks, puts devices to sleep, and turns the energy-saving mode on or off. With modern devices, it can activate the acoustic mode and clean up SSDs. Before your first experiments with hdparm, you should read about safety concerns in the “Warning!” box.
Need for Communication
I thought hdparm would overwrite everything, so I should not be able to see file contents. Only after reboot I could not see the filesystem or mount anything; but while using same ubuntu session, I could still retrieve file contents for what should have been all overwritten. At this point I. (3) Erase it: hdparm -security-erase NULL /dev/sdX Yesterday I was trying to erase a hard drive before I used it for a new install. It may well have never been used, but I couldn't remember and, for the sake of a few minutes, it seemed sensible to do so first. Oct 26, 2018 Download hdparm for free. Hdparm - get/set ATA/SATA drive parameters under Linux. Hdparm has been written by Mark Lord, the original primary developer and maintainer of the (E)IDE driver for Linux, and current contributor to the libata subsystem, along with suggestions and patches from many netfolk. The disable Seagate auto-powersaving code is courtesy of Tomi Leppikangas([email protected]).
All reasonably new distributions already include hdparm in the basic installation. You only need to open a terminal and call up
as administrator (Figure 1).
Figure 1: Hdparm lists the hardware properties of a six-year-old hard disk with a 320GB capacity.
https://anfasr761.weebly.com/download-zoom-client-mac.html. The tool will deliver all available data about the chosen drive – in this case, the first hard disk sda. The | more option makes sure the large amount of information does not simply rush unread through the terminal.
Hdparm accepts any device as mass storage that is connected to an (E)IDE, SATA, or SAS interface, including, therefore, DVD drives and SSDs. USB-to-IDE adapters often cause problems because they do not transmit the (complete) ATA or ATAPI commands to the drive. The information that hdparm delivers is dependent on the device. The designation and firmware version number are always listed at the top under Model Number and Firmware Revision. Owners of an SSD especially can find out quickly whether they are running the current firmware version.
On newer hard disks, you should check whether Native Command Queuing (NCQ) is to be found under Commands/features. This technology makes it possible for the hard disk to sort queries from the system in such a way that the heads take the shortest possible path. SSDs, on the other hand, distribute write accesses more efficiently across storage blocks. Ideally, this leads to an increase in speed. If NCQ is deactivated, check the BIOS to find out whether the drive is running in AHCI mode, which is also necessary for other functions such as energy management.
Speedometer
To determine how fast a drive delivers data, use the
command. After a few seconds, the data transfer rate appears (in megabytes per second, MBps). The small program reads directly from the drive for a while regardless of the filesystem. The speed measured is therefore somewhat faster than in actual practice. To receive an untainted result, no other programs should be running during the measurement, and enough main memory should be free. Repeat the measurement at least three times and then calculate the average value. For a current model, the result should reach at least 80 MBps (Figure 2).
Figure 2: This SATA hard drive achieved an average read speed of 80.48 MBps.
The Linux kernel deposits the data retrieved from the hard drive into a buffer. To determine the speed of the unadorned drive, you can use the
command. Hdparm then reads the data directly from the disk. The values thus measured will be somewhat slower than without --direct, but at least you can see the pure transmission rate of the disk (Figure 3).
Figure 3: Without the buffer, transmission rate drops dramatically. At the middle of the 320GB hard drive, more speed losses are seen.
Hdparm always reads the data from the beginning of the storage device. Hard disks, however, tend to deliver data somewhat more slowly from the outer areas of magnetic disks; therefore, hdparm lets you set an offset (from software version 9.29 on):
The 500 stands for the number of gigabytes to skip. On a 1TB hard disk, the command above would therefore deliver data from the middle of the disk. As Figure 3 shows, reading speed drops quite markedly in the outer areas of a hard disk.
All the speed tests introduced here only give a first impression of possible problems and bottlenecks. For a complete benchmark, however, you would also need to determine the write speed, for example.
Faster, Faster
Some drive properties can be changed while the device is in operation; for example, most drives allow you to turn power management on and off. Just which functions hdparm can change and activate on a hard drive can be called up with
https://zxdwpo.weebly.com/http-www-mac-torrent-download-com.html. Mac Torrents - Torrents for Mac. Free Apps, Games & Plugins. Apple Final Cut Pro & Logic Pro X, Adobe Photoshop, Microsoft Office, Pixel Film Studios, OSX.
and are found under Commands/features (Figure 1). All functions found there and marked with an asterisk are currently active, and hdparm can use the rest or at least activate them.
To speed up data transmission, a hard disk usually reads several sectors at the same time. How many it can deliver at the same time is revealed by
and is listed after R/W multiple sector transfer: Max =. This value should also be found in the same line after Current =. If that is not the case, you can increase the value with:
This instructs the hard drive always to deliver 16 sectors at once.
Curiously, some hard drives run slower with higher values: The hdparm man page mentions primarily older Caviar drives from Western Digital. In such cases, you should reduce the number of sectors again or even turn the function off completely, which is done with:
Beyond this, modern drives can even retrieve a few sectors in advance (“read ahead”). To define how many, use the -a switch (Figure 4, top) – for example: Aeon cobra quad 100 service manual.
Figure 4: Here, the read-ahead is set to 256, and acoustic management is currently deactivated.
Here, the drive will read the 256 sectors in advance that are most likely the next to be requested. Higher values speed up above all the reading of large files – at the cost, however, that reading smaller ones takes longer. The current setting is shown with
Beyond that, many drives also possess a built-in, additional read-ahead function. As a rule, therefore, you can leave the setting at the default value.
How fast queries from the operating system reach the hard drive controller can be called up with
The value should be 32-bit; you can force this value with the -c3 switch.
Full Speed Ahead
Many modern hard drives allow you to slow down the head movement. Although doing so will increase access times, it will also reduce the noise level. To find out whether your own hard drive offers this “acoustic mode,” you can use this command:
If a number follows the equal sign, as shown in Figure 4 (bottom), the drive can be put into a quiet mode with:
To reach the highest speed, use the maximum value:
Values between 128 and 254 are allowed, resulting in a trade-off between noise level and speed. Incidentally, your Linux kernel must also support acoustic management, which should be the case for all current major distributions.
Some CD and DVD drives turn out to be more like turbines: Their high-speed rotation can hinder audio/video enjoyment. The
command will provide relief. The parameter 4 determines speed, and /dev/sr0 specifies the DVD drive. This example slows drive reading speed ninefold.
Write-Back Caching
With write-back caching, the hard drive first stores the data to be written in a buffer. In this way, it can accept data much faster, which in the end leads to a faster write speed. The
command shows whether write-back caching is active with a 1 after the equals sign; otherwise, you can activate the function with the -W1 switch.
If hdparm will not allow this change, you need to make sure that write-back caching has been activated in the BIOS. However, this function is not recommended for all situations: In the case of a power outage, the data in the buffer would be lost permanently.
If a program sensitive to data loss – such as a database – is running on the system, you should turn off the write-back cache with the -W0 switch. Documentation for the PostgreSQL database even explicitly recommends that this be done.
Live Wire
If a hard disk or SSD doesn’t have anything to do for a certain period of time, it automatically enters sleep mode. This power-saving feature can be influenced with the -B parameter. Thus, using:
would deactivate energy management; however, not all drives allow this.
Instead of 255, values between 1 and 254 are allowed. A higher value means more power is used but also promises higher performance or speed. Values between 1 and 128 allow the drive to shut down, whereas values from 129 to 254 forbid that from happening.
The most power can be saved with a value of 1; the highest rate of data transmission (I/O performance) is achieved with 254. You can call up the current value with:
The specific effect the different values will have depends on the drive itself. However, you should keep in mind that too many shutdowns are not good for desktop hard drives: Each time it shuts off, the drive must park the heads, which increases wear and tear. Consequently, you shouldn’t wake your hard drive up every two seconds – which always takes more than two seconds to do.
You can set how many seconds of idleness the hard drive should wait before it goes to sleep with the
switch; however, this value here is not in seconds but a number between 1 and 253. The hard drive multiplies this value by another. The value chosen in the example, 128, lies between 1 and 240, for which the drive uses a factor of five. Consequently, it would shut down after 640 seconds of idleness.
From 241 and up, the multiplication factor increases steadily. At 251, the waiting period has increased to 5.5 hours. At 253, the value is preset by the manufacturer, usually between eight and 12 hours. The value 254 is left out; at 255, the drive will wait 21 minutes and 15 seconds. A value of 0 will deactivate sleep mode completely. To send the hard drive to sleep immediately, enter:
With a capital Y, the drive will go into an even deeper state of sleep. Depending on the drive, the drive might only wake up from a deep sleep after a reset of the whole system.
Cleanup
SSDs track the location of the data deposited on them independently of the operating system. This can lead to the curious situation that a file has been deleted but the SSD still has its former location marked as occupied. To remedy such conflicts, newer versions of hdparm include the wiper.sh script. Entering
determines which blocks are being used and which are not and reports this to the SSD. However, this script must be used with caution: The documentation warns explicitly that data could be lost and advises against its use with the Btrfs filesystem. Drives with ext2/3/4, Reiser3, and XFS should be mounted as read-only before using the wiper command. It would be best to unmount the drive completely or start wiper.sh from a Live system. In any case, you should definitely make a backup of the SSD beforehand and use the script only in an emergency. Incidentally, because wiper is so dangerous, some distributions do not even include it.
Secure Deletion
To achieve higher transfer rates and spread use equally over the storage chips, SSDs also reserve some storage areas (wear leveling), so that simply formatting an SSD will seldom delete the whole drive. Most SSDs therefore offer a function called secure erase, which causes the drive to empty all its storage cells. This is especially useful should you decide to give up your used SSD.
Secure erase has two pitfalls: hdparm can only initiate a secure erase when the BIOS also allows it. Beyond that, the method is considered to be experimental. The documentation warns explicitly about using the procedure because, in the worst case, secure erase could make the whole SSD unusable. If you want to use this delete function anyway, first call up the identification information with:
Under Security, the line supported: enhanced erase should show up somewhere; otherwise, the SSD won’t support secure erase. Next, turn on the security function of the drive by (temporarily) setting a password like 123456:
When you call up the identification information again, you will now find enabled under Security. To erase the SSD now, enter:
In the process, hdparm also removes the password. The whole process takes a few minutes, depending on the size of the SSD, during which no feedback is given.
Afterward, when you call up the identification information, the area under Security should again look like it did before setting the password.
Relics
Hdparm For Mac Os
In the case of older hard drives with an IDE connector (also called PATA), you should take a look at the using_dma line in the identification output. With the help of DMA (Direct Memory Access) technology, the hard drive itself deposits data directly into main memory. If the respective flag is 0 (off), it will slow down the data transfer. Over the years, ever faster DMA standards have been introduced; the fastest possible can be activated with the command:
On some very old systems, however, the DMA mode can cause problems. After activating it, you should therefore copy a few larger test files to the drive. If problems arise or the drive crashes, deactivate the DMA mode again with:
Incidentally, modern SATA drives always use DMA.
While the hard drive is transferring the requested data, the rest of the system can go about completing other tasks – but only if an on appears after unmaskirq in the identification info output. You can force this mode with the -u1 switch.
Lasting Values
After restarting the system, all changes made with hdparm are lost. To activate them permanently, the respective hdparm commands must be entered in the start scripts. How this is done depends on the distribution you are running, but usually the entry must be made in /etc/rc.local.
Debian-based systems, on the other hand, read the /etc/hdparm.conf configuration file on system startup. In it is a section for each hard drive with the following format:
Modern Linux systems randomly allocate device names (sda, sdb). To assign the hdparm settings to a specific drive permanently, use its specific UUID:
![Hdparm Hdparm](/uploads/1/1/9/8/119875606/938083088.jpg)
The settings belong between the curly braces. Each parameter has its own name. Acoustic management is set, for example, to the value of 128 with:
Which name belongs to which hdparm parameter is revealed by the comments at the top of the file.
Conclusions
Hdparm also includes many other parameters that can be quite dangerous. For example, many SSDs can be protected with a password, which can lead to data loss in some situations. It’s not a coincidence that the man page (man hdparm) warns about the dangers.
Incidentally, hdparm is only one useful tool among many; for example, the smartmontools can determine the health status of a hard drive.
Table of ContentsName
hdparm - get/set hard disk parameters
Synopsis
hdparm [ flags ] [device] .
Hdparm For Mac Catalina
Description
hdparm provides a command line interface to various hard disk ioctlssupported by the Linux SATA/PATA/SAS “libata” subsystem and the olderIDE driver subsystem. Some options may work correctly only with thelatest kernels.
Options
![Mac Mac](/uploads/1/1/9/8/119875606/269102738.jpg)
When no flags are given, -acdgkmur is assumed.
- -a
- Get/set sector count for filesystem (software) read-ahead. Thisis used to improve performance in sequential reads of largefiles, by prefetching additional blocks in anticipation of thembeing needed by the running task. Many IDE drives also have aseparate built-in read-ahead function, which augments thisfilesystem (software) read-ahead function.
- -A
- Get/set the IDE drive´s read-lookahead feature (usually ON bydefault). Usage: -A0 (disable) or -A1 (enable).
- -b
- Get/set bus state.
- -B
- Set Advanced Power Management feature, if the drive supports it.A low value means aggressive power management and a high valuemeans better performance. A value of 255 will disable apm on thedrive.
- -c
- Query/enable (E)IDE 32-bit I/O support. A numeric parameter canbe used to enable/disable 32-bit I/O support: Currently supportedvalues include 0 to disable 32-bit I/O support, 1 toenable 32-bit data transfers, and 3 to enable 32-bit data transferswith a special sync sequence required by many chipsets.The value 3 works with nearly all 32-bit IDE chipsets, butincurs slightly more overhead. Note that “32-bit” refers todata transfers across a PCI or VLB bus to the interface cardonly; all (E)IDE drives still have only a 16-bit connection overthe ribbon cable from the interface card.
- -C
- Check the current IDE power mode status, which will always beone of unknown (drive does not support this command),active/idle (normal operation), standby (low power mode, drivehas spun down), or sleeping (lowest power mode, drive is completelyshut down). The -S,-y,-Y, and -Z flags can be used tomanipulate the IDE power modes.
- -d
- Disable/enable the “using_dma” flag for this drive. This optionnow works with most combinations of drives and PCI interfaceswhich support DMA and which are known to the kernel IDE driver.It is also a good idea to use the appropriate -X option in combinationwith -d1 to ensure that the drive itself is programmedfor the correct DMA mode, although most BIOSs should do this foryou at boot time. Using DMA nearly always gives the best performance,with fast I/O throughput and low CPU usage. But thereare at least a few configurations of chipsets and drives forwhich DMA does not make much of a difference, or may even slowthings down (on really messed up hardware!). Your mileage mayvary.
- --direct
- Use the kernel O_DIRECT flag when performing a -t timing test.This bypasses the page cache, causing the reads to go directlyfrom the drive into hdparm’s buffers, using so-called “raw” I/O.In many cases, this can produce results that appear much fasterthan the usual page cache method, giving a better indication ofraw device and driver performance.
- --drq-hsm-error
- VERY DANGEROUS, DON’T EVEN THINK ABOUT USING IT. This flagcauses hdparm to issue an IDENTIFY command to the kernel, butincorrectly marked as a “non-data” command. This results in thedrive being left with its DataReQust(DRQ) line “stuck” high.This confuses the kernel drivers, and may crash the system immediatelywith massive data loss. The option exists to help intesting and fortifying the kernel against similar real-worlddrive malfunctions. VERY DANGEROUS, DO NOT USE!!
- -D
- Enable/disable the on-drive defect management feature, wherebythe drive firmware tries to automatically manage defective sectorsby relocating them to “spare” sectors reserved by the factoryfor such. Control of this feature via the -D flag is notsupported for most modern drives since ATA-4; thus this commandmay fail.
- -E
- Set cdrom speed. This is NOT necessary for regular operation,as the drive will automatically switch speeds on its own. Butif you want to play with it, just supply a speed number afterthe option, usually a number like 2 or 4.
- -f
- Sync and flush the buffer cache for the device on exit. Thisoperation is also performed as part of the -t and -T timings.
- -F
- Flush the on-drive write cache buffer (older drives may notimplement this).
- -g
- Display the drive geometry (cylinders, heads, sectors), the size(in sectors) of the device, and the starting offset (in sectors)of the device from the beginning of the drive.
- -h
- Display terse usage information (help).
- -i
- Display the identification info that was obtained from the driveat boottime, if available. This is a feature of modern IDEdrives, and may not be supported by older devices. The datareturned may or may not be current, depending on activity sincebooting the system. However, the current multiple sector modecount is always shown. For a more detailed interpretation ofthe identification info, refer to ATAttachmentInterfaceforDiskDrives (ANSI ASC X3T9.2 working draft, revision 4a, April19/93).
- -I
- Request identification info directly from the drive, which isdisplayed in a new expanded format with considerably more detailthan with the older -i flag.
- --Istdin
- This is a special variation on the -I option, which accepts adrive identification block as standard input instead of using a/dev/hd* parameter. The format of this block must be exactlythe same as that found in the /proc/ide/*/hd*/identify “files',or that produced by the --Istdout option described below. Thisvariation is designed for use with collected “libraries” ofdrive identification information, and can also be used on ATAPIdrives which may give media errors with the standard mechanism.When --Istdin is used, it must be the *only* parameter given.
- --Istdout
- This option dumps the drive’s identify data in hex to stdout, ina format similar to that from /proc/ide/*/identify, and suitablefor later use with the --Istdin option.
- -k
- Get/set the keep_settings_over_reset flag for the drive. Whenthis flag is set, the driver will preserve the -dmu options overa soft reset, (as done during the error recovery sequence).This flag defaults to off, to prevent drive reset loops whichcould be caused by combinations of -dmu settings. The -k flagshould therefore only be set after one has achieved confidencein correct system operation with a chosen set of configurationsettings. In practice, all that is typically necessary to testa configuration (prior to using -k) is to verify that the drivecan be read/written, and that no error logs (kernel messages)are generated in the process (look in /var/adm/messages on mostsystems).
- -K
- Set the drive´s keep_features_over_reset flag. Setting thisenables the drive to retain the settings for -APSWXZ over a softreset (as done during the error recovery sequence). Not alldrives support this feature.
- -L
- Set the drive´s doorlock flag. Setting this to 1 will lock thedoor mechanism of some removable hard drives (eg. Syquest, ZIP,Jazz.), and setting it to 0 will unlock the door mechanism.Normally, Linux maintains the door locking mechanism automatically,depending on drive usage (locked whenever a filesystem ismounted). But on system shutdown, this can be a nuisance if theroot partition is on a removeable disk, since the root partitionis left mounted (read-only) after shutdown. So, by using thiscommand to unlock the door after the root filesystem isremounted read-only, one can then remove the cartridge from thedrive after shutdown.
- -m
- Get/set sector count for multiple sector I/O on the drive. Asetting of 0 disables this feature. Multiple sector mode (akaIDE Block Mode), is a feature of most modern IDE hard drives,permitting the transfer of multiple sectors per I/O interrupt,rather than the usual one sector per interrupt. When this featureis enabled, it typically reduces operating system overheadfor disk I/O by 30-50%. On many systems, it also providesincreased data throughput of anywhere from 5% to 50%. Somedrives, however (most notably the WD Caviar series), seem to runslower with multiple mode enabled. Your mileage may vary. Mostdrives support the minimum settings of 2, 4, 8, or 16 (sectors).Larger settings may also be possible, depending on the drive. Asetting of 16 or 32 seems optimal on many systems. Western Digitalrecommends lower settings of 4 to 8 on many of theirdrives, due tiny (32kB) drive buffers and non-optimized bufferingalgorithms. The -i flag can be used to find the maximumsetting supported by an installed drive (look for MaxMultSect inthe output). Some drives claim to support multiple mode, butlose data at some settings. Under rare circumstances, suchfailures can result in massivefilesystemcorruption.
- -M
- Get/set Automatic Acoustic Management (AAM) setting. Most modernharddisk drives have the ability to speed down the head movementsto reduce their noise output. The possible values arebetween 0 and 254. 128 is the most quiet (and therefore slowest)setting and 254 the fastest (and loudest). Some drives have onlytwo levels (quiet / fast), while others may have different levelsbetween 128 and 254. At the moment, most drives only support3 options, off, quiet, and fast. These have been assignedthe values 0, 128, and 254 at present, respectively, but integerspace has been incorporated for future expansion, should thischange.
- -n
- Get or set the “ignore write errors” flag in the driver. Do NOTplay with this without grokking the driver source code first.
- -p
- Attempt to reprogram the IDE interface chipset for the specifiedPIO mode, or attempt to auto-tune for the “best” PIO mode supportedby the drive. This feature is supported in the kernelfor only a few “known” chipsets, and even then the support isiffy at best. Some IDE chipsets are unable to alter the PIOmode for a single drive, in which case this flag may cause thePIO mode for both drives to be set. Many IDE chipsets supporteither fewer or more than the standard six (0 to 5) PIO modes,so the exact speed setting that is actually implemented willvary by chipset/driver sophistication. Usewithextremecau_tion!This feature includes zero protection for the unwary, andan unsuccessful outcome may result in severefilesystemcorrup_tion!
- -P
- Set the maximum sector count for the drive´s internal prefetchmechanism. Not all drives support this feature, and it wasdropped from the offical spec as of ATA-4.
- -q
- Handle the next flag quietly, suppressing normal output (but noterror messages). This is useful for reducing screen clutterwhen running from system startup scripts. Not applicable to the-i or -v or -t or -T flags.
- -Q
- Set tagged queue depth (1 or greater), or turn tagged queuingoff (0). This only works with the newer 2.5.xx (or later) kernels,and only with the few drives that currently support it.
- -r
- Get/set read-only flag for the device. When set, Linux disallowswrite operations on the device.
- -R
- Register an IDE interface (DANGEROUS). See the -U option formore information.
- -s
- Enable/disable the power-on in standby feature, if supported bythe drive. VERYDANGEROUS. Do not use unless you are absolutelycertain that both the system BIOS (or firmware) and theoperating system kernel (Linux >= 2.6.22) support probing fordrives that use this feature. When enabled, the drive is powered-upin the standby mode to allow the controller to sequencethe spin-up of devices, reducing the instantaneous current drawburden when many drives share a power supply. Primarily for usein large RAID setups. This feature is usually disabled and thedrive is powered-up in the active mode (see -C above). Notethat a drive may also allow enabling this feature by a jumper.Some SATA drives support the control of this feature by pin 11of the SATA power connector. In these cases, this command may beunsupported or may have no effect.
- -S
- Set the standby (spindown) timeout for the drive. This value isused by the drive to determine how long to wait (with no diskactivity) before turning off the spindle motor to save power.Under such circumstances, the drive may take as long as 30 secondsto respond to a subsequent disk access, though most drivesare much quicker. The encoding of the timeout value is somewhatpeculiar. A value of zero means “timeouts are disabled': thedevice will not automatically enter standby mode. Values from 1to 240 specify multiples of 5 seconds, yielding timeouts from 5seconds to 20 minutes. Values from 241 to 251 specify from 1 to11 units of 30 minutes, yielding timeouts from 30 minutes to 5.5hours. A value of 252 signifies a timeout of 21 minutes. Avalue of 253 sets a vendor-defined timeout period between 8 and12 hours, and the value 254 is reserved. 255 is interpreted as21 minutes plus 15 seconds. Note that some older drives mayhave very different interpretations of these values.
- -T
- Perform timings of cache reads for benchmark and comparison purposes.For meaningful results, this operation should berepeated 2-3 times on an otherwise inactive system (no otheractive processes) with at least a couple of megabytes of freememory. This displays the speed of reading directly from theLinux buffer cache without disk access. This measurement isessentially an indication of the throughput of the processor,cache, and memory of the system under test.
- -t
- Perform timings of device reads for benchmark and comparisonpurposes. For meaningful results, this operation should berepeated 2-3 times on an otherwise inactive system (no otheractive processes) with at least a couple of megabytes of freememory. This displays the speed of reading through the buffercache to the disk without any prior caching of data. This measurementis an indication of how fast the drive can sustainsequential data reads under Linux, without any filesystem overhead.To ensure accurate measurements, the buffer cache isflushed during the processing of -t using the BLKFLSBUF ioctl.
- -u
- Get/set interrupt-unmask flag for the drive. A setting of 1permits the driver to unmask other interrupts during processingof a disk interrupt, which greatly improves Linux´s responsivenessand eliminates “serial port overrun” errors. Usethisfeaturewithcaution: some drive/controller combinations do nottolerate the increased I/O latencies possible when this featureis enabled, resulting in massivefilesystemcorruption. In particular,CMD-640B and RZ1000 (E)IDE interfaces can be unreliable(due to a hardware flaw) when this option is used with kernelversions earlier than 2.0.13. Disabling the IDEprefetch featureof these interfaces (usually a BIOS/CMOS setting) providesa safe fix for the problem for use with earlier kernels.
- -U
- Un-register an IDE interface (DANGEROUS). The companion for the-R option. Intended for use with hardware made specifically forhot-swapping (very rare!). Use with knowledge and extremecautionas this can easily hang or damage your system. The hdparmsource distribution includes a ´contrib´ directory with someuser-donated scripts for hot-swapping on the UltraBay of aThinkPad 600E. Use at your own risk.
- -v
- Display some basic settings, similar to -acdgkmur for IDE. Thisis also the default behaviour when no flags are specified.
- --verbose
- Display extra diagnostics from some commands.
- -w
- Perform a device reset (DANGEROUS). Do NOT use this option. Itexists for unlikely situations where a reboot might otherwise berequired to get a confused drive back into a useable state.
- -W
- Get/set the IDE/SATA drive´s write-caching feature.
- -x
- Tristate device for hotswap (DANGEROUS).
- -X
- Set the IDE transfer mode for newer (E)IDE/ATA drives. This istypically used in combination with -d1 when enabling DMA to/froma drive on a supported interface chipset, where -Xmdma2 is usedto select multiword DMA mode2 transfers and -Xsdma1 is used toselect simple mode 1 DMA transfers. With systems which supportUltraDMA burst timings, -Xudma2 is used to select UltraDMAmode2 transfers (you´ll need to prepare the chipset for UltraDMAbeforehand). Apart from that, use of this flag is seldomneces_sarysince most/all modern IDE drives default to their fastestPIO transfer mode at power-on. Fiddling with this can be bothneedless and risky. On drives which support alternate transfermodes, -X can be used to switch the mode of the drive only.Prior to changing the transfer mode, the IDE interface should bejumpered or programmed (see -p flag) for the new mode setting toprevent loss and/or corruption of data. Usethiswithextremecaution! For the PIO (Programmed Input/Output) transfer modesused by Linux, this value is simply the desired PIO mode numberplus 8. Thus, a value of 09 sets PIO mode1, 10 enables PIOmode2, and 11 selects PIO mode3. Setting 00 restores thedrive´s “default” PIO mode, and 01 disables IORDY. For multiwordDMA, the value used is the desired DMA mode number plus 32.for UltraDMA, the value is the desired UltraDMA mode number plus64.
- -y
- Force an IDE drive to immediately enter the low power consumptionstandby mode, usually causing it to spin down. The currentpower mode status can be checked using the -C flag.
- -Y
- Force an IDE drive to immediately enter the lowest power consumptionsleep mode, causing it to shut down completely. A hardor soft reset is required before the drive can be accessed again(the Linux IDE driver will automatically handle issuing a resetif/when needed). The current power mode status can be checkedusing the -C flag.
- -z
- Force a kernel re-read of the partition table of the specifieddevice(s).
- -Z
- Disable the automatic power-saving function of certain Seagatedrives (ST3xxx models?), to prevent them from idling/spinningdownat inconvenient times.
- -H
- Read the temperature from some (mostly Hitachi) drives. Alsoreports if the temperature is within operating condition range(this may not be reliable). Does not cause the drive to spin upif idle.
ATASecurityFeatureSet
These switches are DANGEROUS to experiment with, and might not workwith every kernel. USEATYOUROWNRISK.
- --security-help
- Display terse usage info for all of the --security-* flags.
- --security-freeze
- Freeze the drive´s security settings. The drive does not acceptany security commands until next power-on reset. Use this functionin combination with --security-unlock to protect drive fromany attempt to set a new password. Can be used standalone, too.
- --security-unlockPWD
- Unlock the drive, using password PWD. Password is given as anASCII string and is padded with NULs to reach 32 bytes. Theapplicable drive password is selected with the --user-masterswitch. THISFEATUREISEXPERIMENTALANDNOTWELLTESTED.USEATYOUROWNRISK.
- --security-set-passPWD
- Lock the drive, using password PWD (Set Password) (DANGEROUS).Password is given as an ASCII string and is padded with NULs toreach 32 bytes. The applicable drive password is selected withthe --user-master switch and the applicable security mode withthe --security-mode switch. THISFEATUREISEXPERIMENTALANDNOTWELLTESTED.USEATYOUROWNRISK.
- --security-disablePWD
- Disable drive locking, using password PWD. Password is given asan ASCII string and is padded with NULs to reach 32 bytes. Theapplicable drive password is selected with the --user-masterswitch. THISFEATUREISEXPERIMENTALANDNOTWELLTESTED.USEATYOUROWNRISK.
- --security-erasePWD
- Erase (locked) drive, using password PWD (DANGEROUS). Passwordis given as an ASCII string and is padded with NULs to reach 32bytes. The applicable drive password is selected with the--user-master switch. THISFEATUREISEXPERIMENTALANDNOTWELLTESTED.USEATYOUROWNRISK.
- --security-erase-enhancedPWD
- Enhanced erase (locked) drive, using password PWD (DANGEROUS).Password is given as an ASCII string and is padded with NULs toreach 32 bytes. The applicable drive password is selected withthe --user-master switch. THISFEATUREISEXPERIMENTALANDNOTWELLTESTED.USEATYOUROWNRISK.
- --user-masterUSER
- Specifies which password (user/master) to select. Defaultstomaster. Only useful in combination with --security-unlock,--security-set-pass, --security-disable, --security-erase or--security-erase-enhanced.
- u
- user password
- m
- master password
- THIS
- FEATUREISEXPERIMENTALANDNOTWELLTESTED.USEATYOUROWNRISK.
- --security-modeMODE
- Specifies which security mode (high/maximum) to set. Defaultstohigh. Only useful in combination with --security-set-pass.
- h
- high security
- m
- maximum security
- THIS
- FEATUREISEXPERIMENTALANDNOTWELLTESTED.USEATYOUROWNRISK.
Bugs
As noted above, the -msectcount and -u1 options should be used withcaution at first, preferably on a read-only filesystem. Most driveswork well with these features, but a few drive/controller combinationsare not 100% compatible. Filesystem corruption may result. Backupeverything before experimenting!
Some options (eg. -r for SCSI) may not work with old kernels as necessaryioctl()´s were not supported.
Although this utility is intended primarily for use with (E)IDE harddisk devices, several of the options are also valid (and permitted) foruse with SCSI hard disk devices and MFM/RLL hard disks with XT interfaces.
The Linux kernel up until 2.6.12 (and probably later) doesn´t handlethe security unlock and disable commands gracefully and will segfaultand in some cases even panic. The security commands however mightindeed have been executed by the drive. This poor kernel behaviourmakes the PIO data security commands rather useless at the moment.
Note that the “security erase” and “security disable” commands havebeen implemented as two consecutive PIO data commands and will not succeedon a locked drive because the second command will not be issuedafter the segfault. See the code for hints how patch it to work aroundthis problem. Despite the segfault it is often still possible to runtwo instances of hdparm consecutively and issue the two necessary commandsthat way.
Hdparm For Mac Software
Author
hdparm has been written by Mark Lord <[email protected]>, the originalprimary developer and maintainer of the (E)IDE driver for Linux, withsuggestions from many netfolk.
The disable Seagate auto-powersaving code is courtesy of Tomi Leppikangas([email protected]).
Security freeze command by Benjamin Benz <[email protected]>, 2005.
PIO data out security commands by Leonard den Ottolander <leonard denottolander nl>, 2005. Parts by Benjamin Benz <[email protected]> and others.
SeeAlso
http://www.t13.org/ Technical Committee T13 AT Attachment (ATA/ATAPI)Interface.
http://www.serialata.org/ Serial ATA International Organization.
Hdparm Mac インストール
http://www.compactflash.org/ CompactFlash Association