4

I'm trying to get the disk serial number of disks attached to the Centos server. When there was no raid0 (under LSI), I can get the serial number and model of /dev/sdb by:

smartctl -i /dev/sdb

and the output is:

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

But when /dev/sdb behind raid0, the output changed to:

# 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

And the Serial number is no the real serial number labeled on the disk specification, so we can't using it. And I added some parameters of smartctl:

smartctl -i -d sat+megaraid,N /dev/sdb

Here the non-negative integer N (in the range of 0 to 127 inclusive) denotes which disk on the controller is monitored, and I can get the real serial number (another disk, not the one metioned before):

# 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

Question 1

But when I (only) changed the /dev/sda to /dev/sdb or any other device existed, the output is the same, Is it a bug?

Question 2

The capacity of /dev/sda is only 278.5G:

# lsblk /dev/sda -io name,size -d
NAME   SIZE
sda  278.5G

But when I run smartctl -i -d sat+megaraid,0 /dev/sda, the output of User Capacity is 3TB, NOT the real disk's capacity, and there was no strict map between slot label to N (at least now) but if /dev/sd* not exist, smartctl will fail:

Smartctl open device: /dev/sdx [megaraid_disk_12] [SAT] failed: No such device

It seems like the smartctl only check the disk's existence.

I have 13 disk (include the system disk) attached, how do I get the strict map relation between N and /dev/sd*?

Question 3

I want to get the last serial number and I run smartctl -i -d sat+megaraid,12 /dev/sda, but the output is:

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.

What 0.12 = 0/45 means here?

0

You must log in to answer this question.

Browse other questions tagged .