Chinaunix首页 | 论坛 | 博客
  • 博客访问: 140116
  • 博文数量: 36
  • 博客积分: 127
  • 博客等级: 入伍新兵
  • 技术积分: 185
  • 用 户 组: 普通用户
  • 注册时间: 2012-08-05 00:06
文章分类

全部博文(36)

文章存档

2015年(1)

2014年(1)

2013年(3)

2012年(31)

我的朋友

分类:

2012-09-17 17:15:09


在准备替换或加装硬盘时,如何得到硬盘信息?
可以用smartctl,hdparm等命令来查询。

在日志中显示硬盘有坏扇区
tail /var/log/messages

  1. Mar  1 09:42:55 c1g smartd[1848]: Device: /dev/hda, 2 Currently unreadable (pending) sectors
  2. Mar  1 09:42:55 c1g smartd[1848]: Device: /dev/hda, 2 Offline uncorrectable sectors

dmesg中也有错误信息
dmesg

  1. ide: failed opcode was: unknown
  2. hda: no DRQ after issuing WRITE
  3. ide0: reset: success
  4. hda: status timeout: status=0xd0 { Busy }

对硬盘做一下健康检查
smartctl -H /dev/hda

  1. smartctl version 5.33 [i386-redhat-linux-gnu] Copyright (C) 2002-4 Bruce Allen
  2. Home page is
  3.  
  4. === START OF READ SMART DATA SECTION ===
  5. SMART overall-health self-assessment test result: PASSED

检测通过,保险起见还是准备换硬盘。
查看下当前硬盘的型号,可以得到硬盘接口为SATAII,及尺寸大小3.5"
smartctl -a /dev/hda

  1. smartctl version 5.33 [i386-redhat-linux-gnu] Copyright (C) 2002-4 Bruce Allen
  2. Home page is
  3.  
  4. === START OF INFORMATION SECTION ===
  5. Device Model:     ST3160815AS
  6. Serial Number:    6RA7DWM4
  7. Firmware Version: 4.AAB
  8. User Capacity:    160,040,803,840 bytes
  9. Device is:        Not in smartctl database [for details use: -P showall]
  10. ATA Version is:   7
  11. ATA Standard is:  Exact ATA specification draft version not indicated
  12. Local Time is:    Mon Mar  1 10:36:55 2010 CST
  13. SMART support is: Available - device has SMART capability.
  14. SMART support is: Enabled
  15.  
  16. === START OF READ SMART DATA SECTION ===
  17. SMART overall-health self-assessment test result: PASSED

hdparm也可以得到硬盘型号
hdparm -i /dev/hda

  1. /dev/hda:
  2.  
  3.  Model=ST3160815AS, FwRev=4.AAB, SerialNo=6RA7DWM4
  4.  Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }
  5.  RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
  6.  BuffType=unknown, BuffSize=8192kB, MaxMultSect=16, MultSect=off
  7.  CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=268435455
  8.  IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
  9.  PIO modes:  pio0 pio1 pio2 pio3 pio4
  10.  DMA modes:  mdma0 mdma1 mdma2
  11.  UDMA modes: udma0 udma1 udma2
  12.  AdvancedPM=no WriteCache=enabled
  13.  Drive conforms to: device does not report version:
  14.  
  15.  * signifies the current active mode

也可以通过主板型号来得知支持的硬盘
dmidecode

  1. System Information
  2.                 Manufacturer: Gigabyte Technology Co., Ltd.
  3.                 Product Name: 945GCM-S2L
阅读(1210) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~