Linux: View disk hardware information Hdparm,smartctl

Source: Internet
Author: User
Tags local time ide hard drive

Smartctl command

This is a command for controlling and monitoring hard drives that support smart technology. Usually with the-a option we can see more detailed hard drive information (such as serial number, hard disk capacity, elapsed time, hard drive health, etc.). Use the following:

Smartctl-a/DEV/SDA

CentOS Installation:
yum-y install smartmontools

smartctl 
-I specify device
-d specifies the device type, for example: ATA, SCSI, Marvell, Sat, 3ware,n
-A or a displays all information
-l specifies the type of log, for example: Type:error, selftest, selective, Directory,background, Scttemp[sts,hist]
-H View Hard disk health
-T short background detection hard disk, time-consuming
-t long background detection hard disk, long time consuming
-C-T short front-end detection of hard disk, low consumption time
-c-t long the hard drive, time consuming
-X Interrupt background detection HDD
-l selftest display hard disk detection log
HP hard drive:
Smartctl-s on-d  cciss,0/dev/cciss/c0d0 turn on smart
smartctl  -a -D cciss,0-i/dev/cciss/c0d0  Show all Smart info
smartctl -l error -D cciss,0-i/dev/cciss/c0d0 view Disk error log
+++++++++++++++++++++++smarted service +++++++++++++++++

Simply say SMARTCTL:SMARTD is installed by the Kernel-utils package by default. Use the command rpm-ql kernel-utils to list the files in the Kernel-utils package
It is a daemon (a helper) that monitors hard disks that have self-monitoring, analysis, and reporting techniques (self-monitoring, analytics, and Reporting Technology-smart).
Master configuration file:/etc/smartd.conf
Add a line/dev/cciss/c0d0-h-m [email protected]
The above configuration indicates that SMARTD is working in a silent state, and when smart reports passed in the failure, immediately notify the user of the specified mailbox by mail

SMARTCTL-A Displays all smart information on the hard drive.

Smartctl-i Display HDD model number, serial number, whether to turn on smart and other information.

Smartctl-s on if smart technology is not turned on, use this command to turn on smart technology.

SMARTCTL-T Short background detection hard disk, time consuming

Smartctl-t Long background detection hard disk, time consuming

Smartctl-c-T Short front desk detects hard drives and consumes less time

Smartctl-c-T Long front desk detects hard drive and consumes a long time

Smartctl-x interrupts the background detection drive.

Smartctl-l SelfTest Displays the hard drive detection log.

Smartctl-l Error displays a summary of the hard drive errors.

# smartctl-i/DEV/SDA
Smartctl version 5.38 [X86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen Home page is HTTP://SMARTMONTOOLS.SOURCEF Orge.net/start of Information section Model family:western Digital Caviar Second Generation Serial ATA Family Device Mod EL:WDC wd3200js-55pdb0 Serial number:wd-wcapd1876075 Firmware version:21.00m21 User capacity:320,072,933,376 bytes Dev Ice is:in SMARTCTL Database [for details use:-P show] ATA Version is:7 ATA Standard Is:exact ATA specification Draft v Ersion not indicated Local time Is:mon Dec 17:21:12 CST SMART support Is:available-device have smart capability . SMART Support is:enabled

Check to see if the hard drive has a SMART feature

# smartctl-h/DEV/SDA
Smartctl version 5.38 [X86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen Home page is HTTP://SMARTMONTOOLS.SOURCEF Orge.net/start of READ Smart DATA Section Smart overall-health self-assessment test result:passed

View hard disk health status

Note:The result is that PASSED does not mean that the hard drive is 100% secure, and if the result is failure, you need to back up your data or update your hard drive.
# smartctl-t SHORT/DEV/SDA
Smartctl version 5.38 [X86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen Home page is HTTP://SMARTMONTOOLS.SOURCEF Orge.net/start of OFFLINE IMMEDIATE and self-test sections sending command: "Execute SMART short self-test routine Immedia Tely in off-line mode ". Drive command ' Execute SMART short self-test routine immediately in off-line mode ' successful. Testing has begun. Please wait 2 minutes for test to complete. Test would complete after Mon Dec 17:33:51, use Smartctl-x to abort test.

Quickly detects hard drives.

# smartctl-l SELFTEST/DEV/SDA

View hard Drive test results

#smartctl-L ERROR/DEV/SDA

Viewing error logs

Hdparm command

This command is used to get or set the parameters of the Sata/ide device. In fact, Hdparm is a user-level program in Linux, and viewing the source will find that the command is to send some IOCTL commands to the disk. But notice that since you can get it, you can set it, so be careful when using this command. Of course, we just want to get a view of the hard disk information, so there is no damage to the hard disk and system. Typically, the-I or-I (uppercase i) option is used to obtain hardware information for the hard disk. such as serial code and so on ~ use as follows: Hdparm-i/dev/sdb

syntax:hdparm [-CFGHIIQTTVYYZ] [-a < cache partition >][-a <0 or 1>][-c <i/o mode >][-d <0 or 1>][-k <0 or 1 >][-k <0 or 1>][-m < partitions >][-n <0 or 1>][-p < PIO mode >][-p < number of partitions >][-r <0 or 1>][-s < time > ][-u <0 or 1>][-w <0 or 1>][-x < transfer mode >][device]

Supplemental Note:Hdparm can detect, display and set parameters for IDE or SCSI hard drives.

Parameters:
-a< Cache partition > Set the number of partitions that are pre-deposited into the chunk when the file is read, and if the < cache partition > option is not added, the current setting is displayed.
-a<0 or 1> to start or close the cache when the file is read.
-C&LT;I/O mode > Set IDE32 bit I/O mode.
-C detects the power management mode of the IDE hard drive.
-d<0 or 1> settingsDiskDMA mode.
-F writes the memory buffer's data to the hard disk, and the buffer is clear.
-G Displays the magnetic track, head, magnetic region and other parameters of the hard drive.
-h displays Help.
-I displays hardware specification information for the hard disk, which is provided by the hard disk itself at boot time.
-I directly reads the hardware specifications provided by the hard drive.
-k<0 or 1> when resetting the hard drive, the settings of the-DMU parameter are preserved.
-k<0 or 1> when resetting the hard drive, the settings of the-APSWXZ parameter are preserved.
-m< number of magnetic regions > Sets the number of partitions accessed by the hard disk.
-n<0 or 1> ignores errors that occur when the hard disk is written.
-p<pio mode > Set the PIO mode of the hard drive.
-p< number of magnetic regions > Set the number of partitions on the hard drive internal cache.
-Q does not display any information on the screen when the subsequent parameters are executed.
-r<0 or 1> sets the read/write mode of the hard drive.
-s< time > Set the wait time before the hard drive enters power save mode.
-T evaluates the read efficiency of the hard drive (without disk cache).
-T evaluation of the read efficiency of the hard drive cache.
-u<0 or 1> allows other interrupt requests to be performed while the hard disk is accessed.
-V Displays the relevant settings for the drive.
-w<0 or 1> sets the drive's write cache.
-x< Transfer Mode > set the transmission mode of the hard drive.
-y causes the IDE hard drive to enter power-saving mode.
-y causes the IDE hard drive to enter sleep mode.
-Z turns off the automatic power-down function for some Seagate hard drives.

----------------------------------------

Supplemental Note: Hdparm can detect, display and set parameters for IDE or SCSI hard drives.

Test each hard disk read speed to determine the hard disk failure
 
Execute the following command in the server-side command window
 
Hdparm-t/dev/hda (IDE hard disk)
 
Hdparm-t/dev/sda (SATA, SCSI, hard raid card array)
 
Hdparm-t/dev/md0 (soft RAID device)

Hdparm-tt/dev/sda1

Linux: View disk hardware information Hdparm,smartctl

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.