![linux下查看硬盘型号等信息](https://1200zi.500zi.com/uploadfile/img/15/468/271cb50298845077a66cff565a4ae225.jpg)
linux下查看硬盘型号等信息
(-09-15 18:07:06)
转载▼在准备替换或加装硬盘时,如何得到硬盘信息?
可以用smartctl,hdparm等命令来查询。
在日志中显示硬盘有坏扇区
tail /var/log/messages
Mar1 09:42:55 c1gsmartd[1848]: Device: /dev/hda, 2 Currently unreadable (pending)sectorsMar1 09:42:55 c1g smartd[1848]: Device:/dev/hda, 2 Offline uncorrectable sectors
dmesg中也有错误信息
dmesg
ide: failed opcode was: unknownhda: no DRQ after issuing WRITEide0: reset: successhda: status timeout: status=0xd0 { Busy }
对硬盘做一下健康检查
smartctl -H /dev/hda
smartctl version 5.33[i386-redhat-linux-gnu] Copyright (C) 2002-4 Bruce AllenHome page is /=== START OF READ SMART DATA SECTION ===SMART overall-health self-assessment test result: PASSED
检测通过,保险起见还是准备换硬盘。
查看下当前硬盘的型号,可以得到硬盘接口为SATAII,及尺寸大小3.5"
smartctl -a /dev/hda
smartctl version 5.33[i386-redhat-linux-gnu] Copyright (C) 2002-4 Bruce AllenHome page is /=== START OF INFORMATION SECTION ===Device Model:ST3160815ASSerial Number:6RA7DWM4Firmware Version: 4.AABUser Capacity:160,040,803,840 bytesDevice is:Not in smartctl database [fordetails use: -P showall]ATA Version is:7ATA Standard is:Exact ATA specificationdraft version not indicatedLocal Time is:MonMar1 10:36:55 CSTSMART support is: Available - device has SMART capability.SMART support is: Enabled=== START OF READ SMART DATA SECTION ===SMART overall-health self-assessment test result: PASSED
hdparm也可以得到硬盘型号
hdparm -i /dev/hda
/dev/hda:Model=ST3160815AS, FwRev=4.AAB,SerialNo=6RA7DWM4Config={ HardSect NotMFMHdSw>15uSec Fixed DTR>10MbsRotSpdTol>.5% }RawCHS=16383/16/63, TrkSize=0, SectSize=0,ECCbytes=4BuffType=unknown, BuffSize=8192kB,MaxMultSect=16, MultSect=offCurCHS=16383/16/63, CurSects=16514064,LBA=yes, LBAsects=268435455IORDY=on/off, tPIO={min:120,w/IORDY:120},tDMA={min:120,rec:120}PIO modes:pio0 pio1 pio2pio3 pio4DMA modes:mdma0 mdma1mdma2UDMA modes: udma0 udma1 udma2AdvancedPM=no WriteCache=enabledDrive conforms to: device does not reportversion:* signifies the current active mode
也可以通过主板型号来得知支持的硬盘
dmidecode
System InformationManufacturer: Gigabyte Technology Co., Ltd.ProductName: 945GCM-S2L