linux下查看硬盘型号等信息

在准备替换或加装硬盘时,如何得到硬盘信息?
可以用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 http://smartmontools.sourceforge.net/
  3. === START OF READ SMART DATA SECTION ===
  4. 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 http://smartmontools.sourceforge.net/
  3. === START OF INFORMATION SECTION ===
  4. Device Model: ST3160815AS
  5. Serial Number: 6RA7DWM4
  6. Firmware Version: 4.AAB
  7. User Capacity: 160,040,803,840 bytes
  8. Device is: Not in smartctl database [for details use: -P showall]
  9. ATA Version is: 7
  10. ATA Standard is: Exact ATA specification draft version not indicated
  11. Local Time is: Mon Mar 1 10:36:55 2010 CST
  12. SMART support is: Available - device has SMART capability.
  13. SMART support is: Enabled
  14. === START OF READ SMART DATA SECTION ===
  15. SMART overall-health self-assessment test result: PASSED

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

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

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

  1. System Information
  2.    Manufacturer: Gigabyte Technology Co., Ltd.
  3.    Product Name: 945GCM-S2L
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值