3

I using a PERC H730 Mini raid controller :

# lspci -d::0104 -k
02:00.0 RAID bus controller: Broadcom / LSI MegaRAID SAS-3 3108 [Invader] (rev 02)
        Subsystem: Dell PERC H730 Mini
        Kernel driver in use: megaraid_sas
        Kernel modules: megaraid_sas

and here are the disks attached to the server :

# lsscsi -s
[0:2:0:0]    disk    DELL     PERC H730 Mini   4.28  /dev/sda    499GB
[0:2:1:0]    disk    DELL     PERC H730 Mini   4.28  /dev/sdb   8.00TB
[0:2:2:0]    disk    DELL     PERC H730 Mini   4.28  /dev/sdc   8.00TB
[0:2:3:0]    disk    DELL     PERC H730 Mini   4.28  /dev/sdd   8.00TB
[0:2:4:0]    disk    DELL     PERC H730 Mini   4.28  /dev/sde   8.00TB
[0:2:5:0]    disk    DELL     PERC H730 Mini   4.28  /dev/sdf   8.00TB
[0:2:6:0]    disk    DELL     PERC H730 Mini   4.28  /dev/sdg   8.00TB
[0:2:7:0]    disk    DELL     PERC H730 Mini   4.28  /dev/sdh   8.00TB
[0:2:8:0]    disk    DELL     PERC H730 Mini   4.28  /dev/sdi   8.00TB
[0:2:9:0]    disk    DELL     PERC H730 Mini   4.28  /dev/sdj   8.00TB
[0:2:10:0]   disk    DELL     PERC H730 Mini   4.28  /dev/sdk   8.00TB
[0:2:11:0]   disk    DELL     PERC H730 Mini   4.28  /dev/sdl   8.00TB
[0:2:12:0]   disk    DELL     PERC H730 Mini   4.28  /dev/sdp   8.00TB
[0:2:13:0]   disk    DELL     PERC H730 Mini   4.28  /dev/sdm   8.00TB
[0:2:14:0]   disk    DELL     PERC H730 Mini   4.28  /dev/sdn   8.00TB
[0:2:15:0]   disk    DELL     PERC H730 Mini   4.28  /dev/sdq   8.00TB
[0:2:16:0]   disk    DELL     PERC H730 Mini   4.28  /dev/sdo    399GB

On smartctl, I thought the device name was denoting which disk on the controller is monitored.

But then, when using one RAID controller smartctl also needs The non-negative integer N (in the range of 0 to 127 inclusive) denotes which disk on the controller is monitored. and gives a complete different result when the N value is different :

# smartctl -i /dev/sdq -d megaraid,0 -j | jq -r .model_name,.user_capacity.bytes
INTEL SSDSC2BX400G4R
400088457216
# smartctl -i /dev/sdq -d megaraid,1 -j | jq -r .model_name,.user_capacity.bytes
SEAGATE ST8000NM0075
8001563222016

It seems using N=0 returns the wrong disk because the capacity does not match that of lsscsi -s output.

How to choose the right N value with smartctl ?

SebMa
  • 2,035

1 Answers1

4

That's normal. Your results will never match the lsscsi output, because the SCSI devices you see in lsscsi are not your physical disks at all – those are are the logical RAID volumes, virtual "disks" emulated by your RAID controller (which don't have any SMART data due to being virtual).

The actual physical disks are not visible to the OS – they're hidden "behind" the RAID controller (that's literally the controller's job), which is why you need the -d megaraid "cheat code" to access them.

(If the controller worked like an ordinary HBA and exposed the disks directly, you wouldn't need any special syntax to access them, you'd just use their /dev names; but then the controller couldn't really implement RAID without interference.)

grawity
  • 501,077