Latest web development tutorials

Linux hdparm command

Linux command Daquan Linux command Daquan

Linux hdparm command is used to display and set the hard disk parameters.

hdparm can detect, display and setting IDE or SCSI hard disk parameters.

grammar

hdparm [-CfghiIqtTvyYZ][-a <快取分区>][-A <0或1>][-c <I/O模式>][-d <0或1>][-k <0或1>][-K <0或1>][-m <分区数>][-n <0或1>][-p <PIO模式>][-P <分区数>][-r <0或1>][-S <时间>][-u <0或1>][-W <0或1>][-X <传输模式>][设备]

Parameter Description:

  • When -a <cache> Set to read the file, the number of partitions previously stored block area, plus if <cache partition> option displays the current settings.
  • -A Caching <0 or 1> enable or disable the read file.
  • -c <I / O mode> Preferences IDE32-bit I / O mode.
  • -C Detect IDE hard disk power management mode.
  • -d <0 or 1> Set disk DMA mode.
  • -f data memory buffer is written to the hard disk and clear the buffer.
  • -g Displays hard disk tracks, heads, magnetic domain and other parameters.
  • -h displays help.
  • -i shows the hard disk hardware specification information, which is provided in the boot from the hard disk itself.
  • -I Directly read the hard disk provided by hardware specifications.
  • -k <0 or 1> to reset the hard drive, retention settings -dmu parameters.
  • -K <0 or 1> to reset the hard drive, retention settings -APSWXZ parameters.
  • -m <magnetic zone number> Set the number of hard disk partitions multiple partitions to access.
  • -n <0 or 1> ignore the hard disk write error occurred.
  • -p <PIO Mode> set the hard disk PIO mode.
  • -P <Magnetic zone number> Set the number of the internal hard disk cache partitions.
  • -q parameter in the implementation of the follow-up, the screen does not display any information.
  • -r <0 or 1> Set the hard disk read-write mode.
  • -S <Time> Set the waiting time before the hard drive power saving mode.
  • -t assess the efficiency of the hard disk read.
  • -T Pinggu hard disk cache read efficiency.
  • -u <0 or 1> when the hard disk access, allow other interrupt requirements simultaneously.
  • -v displays set the hard disk.
  • -W <0 or 1> Set hard disk write cache.
  • -X <Transfer Mode> Set the hard disk transfer mode.
  • -y make IDE hard disk into power saving mode.
  • -Y Make IDE hard disk into sleep mode.
  • -Z Off certain Seagate HDD automatic power saving feature.

Examples

Display disk related settings:

# hdparm /dev/sda
 /dev/sda:
 IO_support = 0 (default 16-bit)
 readonly = 0 (off)
 readahead = 256 (on)
 geometry = 19929[柱面数]/255[磁头数]/63[扇区数], sectors = 320173056[总扇区数], start = 0[起始扇区数]

Display hard disk cylinder, head, sector number

# hdparm -g /dev/sda
 /dev/sda:
 geometry = 19929[柱面数]/255[磁头数]/63[扇区数], sectors = 320173056[总扇区数], start = 0[起始扇区数]

Hard disk read efficiency assessment

 hdparm -t /dev/sda
 /dev/sda:
 Timing buffered disk reads: 166 MB in 3.03 seconds = 54.85 MB/sec
 [[email protected] ~]# hdparm -t /dev/sda
 /dev/sda:
 Timing buffered disk reads: 160 MB in 3.01 seconds = 53.11 MB/sec
 [[email protected] ~]# hdparm -t /dev/sda
 /dev/sda:
 Timing buffered disk reads: 166 MB in 3.00 seconds = 55.31 MB/sec

Linux command Daquan Linux command Daquan