Hard Drives going bad, how to get SATA/ATA device information.
# hdparm -tT /dev/sda
/dev/sda:
Timing cached reads: 582 MB in 2.00 seconds = 290.60 MB/sec
Timing buffered disk reads: 96 MB in 3.05 seconds = 31.49 MB/sec
Harddrives come in three kinds: Sata, Ide, and Scsi. Many type of hardware error will how up under linux if you use the command “dmesg”. In fact, almost any type of hardware error or information will show up there.
If you think your drive may be sub par, or you want to test it, then hdparm is a good command.
[~]# hdparm -tT /dev/sda
/dev/sda:
Timing cached reads: 270 MB in 2.01 seconds = 134.60 MB/sec
Timing buffered disk reads: 80 MB in 3.07 seconds = 26.10 MB/sec
If the second measurement is under 40MB/sec then you shoud change the drive for your server.
Below is the measurement for a new server.
[~]# hdparm -tT /dev/sda
/dev/sda:
Timing cached reads: 12252 MB in 2.00 seconds = 6135.69 MB/sec
Timing buffered disk reads: 212 MB in 3.01 seconds = 70.51 MB/sec
Note: SMART allows you to have a good degree of prediction on when the drive will reach its end of life.
hdparm get/set SATA/ATA device parameters
Hdparm is a tool that allows you to set IDE device settings. This includes things such as DMA modes, transfer settings and various other settings that can help improve the speed of your hard disks and CDROMs. These settings are not enabled by default, so you will probably want to enable them.
Getting information about your different drives.
Different drives have different capabilities, so in order to configure them you must know what they are capable of doing. # hdparm -i /dev/hdX should give you the information you need (replace hdX with your drive)
-i Display the identification info that was obtained from the drive at boot time, if available. This is a feature of modern IDE drives, and may not be supported by older devices.
Benchmarking devices
hdparm -tT
hdparm includes a handy benchmark mode, which should allow you to see how much of a speed. When running a benchmark it is recommended that you close all programs that could interfere with the results.
You can use the following command to check what your IDE chipset
To enable DMA on a device type the following:
Now run a benchmark and see how much of an improvement you have received.