Hdparm For Mac



Jul 02, 2020 Choose Mac OS Extended (Journaled) for any disk that you plan to use as a Time Machine backup disk or as a bootable installer. Will you be using the disk with another Mac? If the other Mac isn't using macOS High Sierra or later, choose Mac OS Extended (Journaled). Earlier versions of macOS don't work with APFS-formatted volumes. A Mac utility for setting the power management (APM) level on SATA hard drives. It can be used to eliminate 'chirping' or 'clicking when idle' noises in some HDDs. OS X 10.5 or higher. Tested up to macOS 10.12 (Sierra). Should also work with 10.13 (High Sierra). SATA hard disk with APM support.

  1. Hdparm For Mac Os
  2. Hdparm For Macbook Pro
Hdparm For MacTable of Contents

Name

hdparm - get/set hard disk parameters

Synopsis

hdparm [ flags ] [device] . Download surat yasin arab dan latin mp3.

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

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 1.1 perfect squares and related patternsmr. macs page.

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.

Author

hdparm has been written by Mark Lord <mlord@pobox.com>, 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(tomilepp@paju.oulu.fi).

Security freeze command by Benjamin Benz <bbe@heise.de>, 2005.

PIO data out security commands by Leonard den Ottolander <leonard denottolander nl>, 2005. Parts by Benjamin Benz <bbe@heise.de> and others.

SeeAlso

http://www.t13.org/ Technical Committee T13 AT Attachment (ATA/ATAPI)Interface.

http://www.serialata.org/ Serial ATA International Organization.

http://www.compactflash.org/ CompactFlash Association

hdparm
Developer(s)Mark Lord
Stable release
Operating systemLinux
Size134 kB
TypeUtility software
LicenseBSD license
Websitesourceforge.net/projects/hdparm/

hdparm is a command line program for Linux to set and view ATAhard disk drive hardware parameters and test performance. It can set parameters such as drive caches, sleep mode, power management, acoustic management, and DMA settings. GParted and Parted Magic both include hdparm.[citation needed]

Changing hardware parameters from suboptimal conservative defaults to their optimal settings can improve performance greatly. For example, turning on DMA can, in some instances, double or triple data throughput. There is, however, no reliable method for determining the optimal settings for a given controller-drive combination, except careful trial and error.

hdparm has a serious drawback: With certain parameters, it can crash a computer and make data on its disk inaccessible. Several of the 67 parameters are dangerous and could result in massive filesystem corruption if used indiscriminately.

Usage examples[edit]

hdparm has to be run with special privileges, otherwise it will either not be found or the requested actions will not be executed properly.

Display information of the hard drive:[2]

Turn on DMA for the first hard drive:

Test device read performance speed (-t for timing buffered disk reads) of the first hard drive:

Enable energy saving spindown after inactivity (24*5=120 seconds):

Hdparm For Mac Os

To retain hdparm settings after a software reset, run: Screensaver for mac os.

Enable read-ahead:

If the disk is constantly too noisy, you can change its acoustic management at the cost of read/write performance (Some drives, such as newer WD drives and all SSDs, ignore this setting.):


If the disk synchronisation intervals are too short, then even small amounts of data will be written to disk which can have severe consequences for its lifespan. The better way would be to collect small data into bigger chunks and wait until the chunk is big enough to be written to disk.

Hdparm For Macbook Pro

Current web browsers like Chrome write regularly small chunks when browsing in order not to lose any important data when the application crashes. However, this lets the disk spin very often as the drive repeatedly needs to unleash and then park its heads. The generated noises can be thus regarded as distracting by the user. To circumvent this issue, you can switch the drive to the lowest degree of power management (next value, 255, turns power management off):[3]

Additionally, changing the value of /proc/sys/vm/dirty_expire_centisecs can have an effect on the performance. It sets the flush interval when dirty pages are written to disk.[4]

Note that all these commands are only effective in the long-run, if you make the changes persistent. However, the settings you can set via hdparm are reverted each time you reboot. Therefore, it might be wise to restore the personal settings upon boot. An appropriate place that exists in most Linux distributions is the /etc/rc.local script.

References[edit]

  1. ^hdparm / News
  2. ^'Tuning hard drive'.
  3. ^'ThinkWiki.org'.
  4. ^'Documentation for /proc/sys/vm/*'.

See also[edit]

  • ATATool for Windows

External links[edit]

  • hdparm on SourceForge.net
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Hdparm&oldid=920724277'