我试图获取连接到Centos服务器的磁盘的磁盘序列号。 当没有raid0(在LSI下)时,我可以通过以下方式获得/dev/sdb
的序列号和型号:
smartctl -i /dev/sdb
输出是:
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-431.el6.x86_64] (local build) Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net === START OF INFORMATION SECTION === disk Model: WDC WD4000FYYZ-01UL1B2 Serial Number: WD-WMC130D3PEZ4 LU WWN disk Id: 5 0014ee 0ae93b565 Firmware Version: 01.01K03 User Capacity: 4,000,787,030,016 bytes [4.00 TB] Sector Size: 512 bytes logical/physical disk is: Not in smartctl database [for details use: -P showall] ATA Version is: 8 ATA Standard is: Exact ATA specification draft version not indicated Local Time is: Mon Apr 13 15:09:29 2015 CST SMART support is: Available - disk has SMART capability. SMART support is: Enabled
但是当/dev/sdb
后面的/dev/sdb
,输出变成:
# smartctl -i /dev/sdb smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-431.el6.x86_64] (local build) Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net Vendor: LSI Product: LSI Revision: 3.19 User Capacity: 2,999,999,004,672 bytes [2.99 TB] Logical block size: 512 bytes Logical Unit id: 0x6234567890abcde01b73bdde67c081d1 Serial number: 00d181c067debd731be0cdab90785634 Device type: disk Local Time is: Fri Apr 17 17:05:47 2015 CST Device does not support SMART
Serial number
不是磁盘规格上标示的实际序列号,所以我们不能使用它。 我添加了一些smartctl的参数:
smartctl -i -d sat+megaraid,N /dev/sdb
这里的非负整数N
(在0到127之间)表示控制器上的哪个磁盘被监视,并且我可以得到真正的序列号(另一个磁盘,而不是前面提到的那个):
# smartctl -i -d sat+megaraid,0 /dev/sda smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-431.el6.x86_64] (local build) Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net === START OF INFORMATION SECTION === Device Model: ST3000NM0033-9ZM178 Serial Number: Z1Z40MVG LU WWN Device Id: 5 000c50 066d78a8b Firmware Version: SN02 User Capacity: 3,000,592,982,016 bytes [3.00 TB] Sector Size: 512 bytes logical/physical Device is: Not in smartctl database [for details use: -P showall] ATA Version is: 8 ATA Standard is: ACS-2 (revision not indicated) Local Time is: Fri Apr 17 17:12:57 2015 CST SMART support is: Available - device has SMART capability. SMART support is: Enabled
但是,当我(只)将/dev/sda
更改为/dev/sdb
或任何其他设备存在,输出是相同的,这是一个错误?
/dev/sda
的容量只有278.5G:
# lsblk /dev/sda -io name,size -d NAME SIZE sda 278.5G
但是当我运行smartctl -i -d sat+megaraid,0 /dev/sda
, User Capacity
的输出是3TB,而不是真实磁盘的容量,并且在槽标签与N之间没有严格的映射(至less现在)如果/dev/sd*
不存在, smartctl
将失败:
Smartctl open device: /dev/sdx [megaraid_disk_12] [SAT] failed: No such device
这看起来像smartctl只检查磁盘的存在。
我有13个磁盘(包括系统磁盘),如何获得N
和/dev/sd*
之间的严格映射关系?
我想得到最后一个序列号,我运行smartctl -i -d sat+megaraid,12 /dev/sda
,但输出结果是:
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-431.el6.x86_64] (local build) Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net Smartctl: Device Read Identity Failed: megasas_cmd result: 0.12 = 0/45 A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.
这里0.12 = 0/45
是什么意思?