hdparm

Table of Contents

Developer Mark Lord
Version 9.53
Release Date 2018-01-05
Size 284KB
License BSD
Type Utility

개요

SATA/IDE 장치의 변수를 가져오거나 변경합니다.

소개

hdparm은 CLI 명령어로써, 리눅스 SATA/PATA/SAS "libata" 시스템, IDE 드라이브와 같이 다양한 커널 인터페이스를 제공합니다.

2008년 이후 출시된 USB 드라이버는 SAT(SCSI-ATA Command Translation)을 이용해서 지원합니다.

설치 방법

필요 사항

설치

Ubuntu

$ sudo apt-get install hdparm

CentOS

$ sudo yum install hdparm -y

using RPM

  • 32 bit
$ sudo rpm -Uvh http://mirrors.hostemo.com/CentOS/6.3/os/i386/Packages/hdparm-9.16-3.4.el6.i686.rpm
  • 64 bit
$ sudo rpm -Uvh http://mirrors.hostemo.com/CentOS/6.3/os/x86_64/Packages/hdparm-9.16-3.4.el6.x86_64.rpm

from Source

$ make
$ sudo make install

설치된 패키지

  • hdparm
  • powermgmt-base

확인

$ hdparm -V
hdparm v9.51

with RPM

$ rpm -qa | grep hdparm
hdparm-9.16-3.4.el6.i686

사용법

구조

hdparm [옵션] [장치 ...]

설정

  • /etc/hdparm.conf

옵션

9.51 버전을 기준으로 작성되었습니다.

  • -a :

Get/set fs readahead

  • -A :

Get/set the drive look-ahead flag (0/1)

  • -b : 버스 상태 값을 출력하거나 설정합니다. (0 = 꺼짐, 1 = 켜짐, 2 == tristate)
  • -B : Advanced Power Management 값을 설정합니다. (1-255 선택 가능)
  • -c : IDE 32비트 입출력을 가져오거나 설정합니다.
  • -C : 드라이브 파워 모드 상태를 확인합니다.
  • -d : using_dma 플래그를 가져오거나 설정합니다.
  • -D : 드라이브 결함을 관리 기능을 켜거나 끕니다.
  • -E : CD 혹은 DVD 드라이브 속도를 설정합니다.
  • -f : 장치를 종료할 때 버퍼 캐시를 지웁니다.
  • -F : 드라이브 입력 캐시를 지웁니다.
  • -g : 드라이브 구조를 보여줍니다.
  • -h :

Display terse usage information

  • -H :

Read temperature from drive (Hitachi only)

  • -i :

Display drive identification

  • -I :

Detailed/current information directly from drive

  • -J :

Get/set Western DIgital "Idle3" timeout for a WDC "Green" drive (DANGEROUS)

  • -k :

Get/set keep_settings_over_reset flag (0/1)

  • -K :

Set drive keep_features_over_reset flag (0/1)

  • -L :

Set drive doorlock (0/1) (removable harddisks only)

  • -m :

Get/set multiple sector count

  • -M :

Get/set acoustic management (0-254, 128: quiet, 254: fast)

  • -n :

Get/set ignore-write-errors flag (0/1)

  • -N :

Get/set max visible number of sectors (HPA) (VERY DANGEROUS)

  • -p :

Set PIO mode on IDE interface chipset (0,1,2,3,4,...)

  • -P :

Set drive prefetch count

  • -q :

Change next setting quietly

  • -Q :

Get/set DMA queue_depth (if supported)

  • -r :

Get/set device readonly flag (DANGEROUS to set)

  • -R :

Get/set device write-read-verify flag

  • -s :

Set power-up in standby flag (0/1) (DANGEROUS)

  • -S :

Set standby (spindown) timeout

  • -t :

Perform device read timings

  • -T :

Perform cache read timings

  • -u :

Get/set unmaskirq flag (0/1)

  • -U :

Obsolete

  • -v :

Use defaults; same as -acdgkmur for IDE drives

  • -V :

Display program version and exit immediately

  • -w :

Perform device reset (DANGEROUS)

  • -W :

Get/set drive write-caching flag (0/1)

  • -x :

Obsolete

  • -X :

Set IDE xfer mode (DANGEROUS)

  • -y :

Put drive in standby mode

  • -Y :

Put drive to sleep

  • -z :

Re-read partition table

  • -Z :

Disable Seagate auto-powersaving mode

  • --dco-freeze :

Freeze/lock current device configuration until next power cycle

  • --dco-identify :

Read/dump device configuration identify data

  • --dco-restore :

Reset device configuration back to factory defaults

  • --dco-setmax :

Use DCO to set maximum addressable sectors

  • --direct :

Use O_DIRECT to bypass page cache for timings

  • --drq-hsm-error :

Crash system with a "stuck DRQ" error (VERY DANGEROUS)

  • --fallocate :

Create a file without writing data to disk

  • --fibmap :

Show device extents (and fragmentation) for a file

  • --fwdownload :

Download firmware file to drive (EXTREMELY DANGEROUS)

  • --fwdownload-mode3 :

Download firmware using min-size segments (EXTREMELY DANGEROUS)

  • --fwdownload-mode3-max :

Download firmware using max-size segments (EXTREMELY DANGEROUS)

  • --fwdownload-mode7 :

Download firmware using a single segment (EXTREMELY DANGEROUS)

  • --fwdownload-modee :

Download firmware using mode E (min-size segments) (EXTREMELY DANGEROUS)

  • --fwdownload-modee-max :

Download firmware using mode E (max-size segments) (EXTREMELY DANGEROUS)

  • --idle-immediate :

Idle drive immediately

  • --idle-unload :

Idle immediately and unload heads

  • --Istdin :

Read identify data from stdin as ASCII hex

  • --Istdout :

Write identify data to stdout as ASCII hex

  • --make-bad-sector :

Deliberately corrupt a sector directly on the media (VERY DANGEROUS)

  • --offset :

use with -t, to begin timings at given offset (in GiB) from start of drive

  • --prefer-ata12 :

Use 12-byte (instead of 16-byte) SAT commands when possible

  • --read-sector :

Read and dump (in hex) a sector directly from the media

  • --repair-sector :

Alias for the --write-sector option (VERY DANGEROUS)

  • --sanitize-antifreeze-lock :

Block sanitize-freeze-lock command until next power cycle

  • --sanitize-block-erase :

Start block erase operation

  • --sanitize-crypto-scramble :

Change the internal encryption keys that used for used data

  • --sanitize-freeze-lock :

Lock drive's sanitize features until next power cycle

  • --sanitize-overwrite :

PATTERN Overwrite the internal media with constant PATTERN

  • --sanitize-status :

Show sanitize status information

  • --security-help :

Display help for ATA security commands

  • --trim-sector-ranges :

Tell SSD firmware to discard unneeded data sectors: lba:count ..

  • --trim-sector-ranges-stdin :

Same as above, but reads lba:count pairs from stdin

  • --verbose :

Display extra diagnostics from some commands

  • --write-sector :

Repair/overwrite a (possibly bad) sector directly on the media (VERY DANGEROUS)

참고자료

Date: 2018-02-20

Author: Dongsoo Lee

Created: 2018-12-10 Mon 03:13

Validate