In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "the use of the hdparm hard disk detection tool in the Linux system". In the daily operation, I believe that many people have doubts about the use of the hdparm hard disk detection tool in the Linux system. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts about the use of the hdparm hard disk detection tool in the Linux system. Next, please follow the editor to study!
Under Linux, you can use the hdparm tool to view the relevant information of the hard disk or measure the speed of the hard disk, optimize and modify the relevant parameter settings of the hard disk. I mainly use this tool to test the speed of the hard drive.
Hdparm (hard disk parameters)
Function description: display and set hard disk parameters.
Syntax:
The code is as follows:
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 Pinggu hard disk cache read efficiency.
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 sets the write cache for the hard disk.
-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.
Examples of common parameters used in hdparm:
1. Display the relevant settings of the hard disk:
The code is as follows:
[root@oracle ~] # hdparm / dev/sda
/ dev/sda:
IO_support = 0 (default 16-bit)
Readonly = 0 (off)
Readahead = 256 (on)
Geometry = 19929 [number of cylinders] / 255 [number of heads] / 63 [number of sectors], sectors = 320173056 [total sectors], start = 0 [number of starting sectors]
2. Display the number of cylinders, heads and sectors of the hard disk:
The code is as follows:
[root@oracle] # hdparm-g / dev/sda
/ dev/sda:
Geometry = 19929 [number of cylinders] / 255 [number of heads] / 63 [number of sectors], sectors = 320173056 [total sectors], start = 0 [number of starting sectors]
3. Test the reading speed of the hard disk:
The code is as follows:
[root@oracle] # hdparm-t / dev/xvda
/ dev/xvda:
Timing buffered disk reads: 422 MB in 3.01 seconds = 140.20 MB/sec
[root@oracle] # hdparm-t / dev/xvda
/ dev/xvda:
Timing buffered disk reads: 408 MB in 3.01 seconds = 135.59 MB/sec
[root@oracle] # hdparm-t / dev/xvda
/ dev/xvda:
Timing buffered disk reads: 416 MB in 3.01 seconds = 138.24 MB/sec
4. Test the read speed of the hard disk cache:
The code is as follows:
[root@oracle] # hdparm-T / dev/xvda
/ dev/xvda:
Timing cached reads: 11154 MB in 1.98 seconds = 5633.44 MB/sec
[root@oracle] # hdparm-T / dev/xvda
/ dev/xvda:
Timing cached reads: 10064 MB in 1.98 seconds = 5077.92 MB/sec
[root@oracle] # hdparm-T / dev/xvda
/ dev/xvda:
Timing cached reads: 10600 MB in 1.98 seconds = 5351.73 MB/sec
5. Detect the power management mode of the hard disk:
The code is as follows:
[root@oracle] # hdparm-C / dev/sda
/ dev/sda:
Drive state is: standby [power saving mode]
6. Query and set the number of sectors accessed by multiple sectors of the hard disk to improve the access efficiency of the hard disk:
The code is as follows:
[root@oracle] # hdparm-m / dev/sda
[root@oracle ~] # hdparm-m parameter values are integer values such as 8 / dev/sda
Attached: repair method of bad track of hard disk
Check:
The code is as follows:
Smartctl-l selftest / dev/sda
Uninstall:
The code is as follows:
Umount / dev/sda*
Repair:
The code is as follows:
Badblocks / dev/sda
At this point, the study of "how to use the hdparm hard disk detection tool in the Linux system" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.