Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the common command hdparm in Linux

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to use the Linux command hdparm, which is very detailed and has a certain reference value. Friends who are interested must finish reading it!

Linux common commands hdparm commands are used to display and set the parameters of the hard disk, and hdparm can detect, display and set the parameters of the IDE or SCSI hard disk.

Syntax hdparm [- CfghiIqtTvyYZ] [- a] [- A] [- c] [- d] [- k] [- K] [- m] [- n] [- p] [- P] [- r] [- S] [- u] [- W] [- X] [device] parameter description:

-a sets the number of partitions pre-stored in the block when reading the file. If no option is added, the current setting is displayed.

-A turns on or off the caching function when reading files.

-c sets the IDE32 bit Istroke O mode.

-C detects the power management mode of the IDE hard drive.

-d sets the DMA mode of the disk.

-f writes the data of the memory buffer to the hard disk and makes the buffer clear.

-g displays the parameters of the hard disk, such as track, head, sector, etc.

-h displays help.

-I displays the hardware specification information of the hard disk, which is provided by the hard disk itself at boot time.

-I directly read the hardware specification information provided by the hard disk.

When-k resets the hard drive, the setting of the-dmu parameter is retained.

When-K resets the hard drive, the setting of the-APSWXZ parameter is retained.

-m sets the number of partitions for multi-partition access of the hard disk.

-n ignores errors that occur when the hard disk is written.

-p sets the PIO mode of the hard drive.

-P sets the number of partitions for the internal cache of the hard disk.

-Q does not display any information on the screen when executing subsequent parameters.

-r sets the read and write mode of the hard disk.

-S sets the wait time before the hard drive enters power-saving mode.

-t evaluate the read efficiency of the hard disk.

-T evaluates the read efficiency of the hard disk cache.

When accessing the hard disk, other interrupt requirements are allowed to be executed at the same time.

-v displays the relevant settings of the hard drive.

-W turn off / enable disk write caching. Each disk has read cache and write cache. Sometimes we turn off disk write cache more efficiently than we enable disk write cache, so of course we choose the former.

-X sets the transfer mode of the hard drive.

-y puts the IDE hard drive into power saving mode.

-Y puts the IDE hard drive into sleep mode.

-Z turns off the automatic power saving feature of some Seagate hard drives.

An example displays the relevant settings of the hard disk:

# hdparm / dev/sda / dev/sda: IO_support = 0 (default 16-bit) readonly = 0 (off) readahead = 256 (on) geometry = 19929 [cylinders] / 255 [heads] / 63 [sectors], sectors = 320173056 [total sectors], start = 0 [starting sectors] shows the number of cylinders, heads and sectors of the hard disk

# hdparm-g / dev/sda / dev/sda: geometry = 19929 [number of cylinders] / 255 [number of heads] / 63 [number of sectors], sectors = 320173056 [total number of sectors], start = 0 [number of starting sectors] to evaluate the reading efficiency of the hard disk

Hdparm-t / dev/sda / dev/sda: Timing buffered disk reads: 166MB in 3.03seconds = 54.85MB/sec [root@linuxso.com ~] # hdparm-t / dev/sda / dev/sda: Timing buffered disk reads: 160MB in 3.01seconds = 53.11MB/sec [root@linuxso.com] # hdparm-t / dev/sda / dev/sda: Timing buffered disk reads: 166MB in 3.00seconds = 55.31MB/sec It is all the contents of the article "how to use Linux commands hdparm". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report