Opened 3 years ago

Last modified 23 months ago

#734 assigned enhancement

-d megaraid,N is not implemented, FreeBSD 10.3 w/ LSI MegaRAID 9271-8i SATA/SAS and mrsas (4) driver

Reported by: Andrii Stesin Owned by: Alex Samorukov
Priority: minor Milestone: undecided
Component: all Version: 6.5
Keywords: megaraid freebsd Cc:

Description (last modified by Christian Franke)

FreeBSD 10.3 system with LSI MegaRAID 9271-8i SATA/SAS RAID controller.

Recommended (and supported) driver for this newer controller is mrsas (4) (and old mfi (4) driver is neither supported by LSI nor actively developed, it supports new controllers in some obsolete ineffective way).

mrsas (4) gives virtual drives to the OS as devices /dev/daXX although I found that /dev/passX devices are also created (/dev/daN has corresponding /dev/passN) in case it matters.

I have
smartctl 6.5 2016-05-07 r4318 [FreeBSD 10.3-STABLE amd64] (local build)

I want to get S.M.A.R.T. status of an SSD which MegaRAID-assigned device ID is 12, and it is hidden under /dev/da0 virtual drive.

Now what I get:

[root@chort /]# smartctl -a /dev/da0
smartctl 6.5 2016-05-07 r4318 [FreeBSD 10.3-STABLE amd64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               LSI
Product:              MR9271-8i
Revision:             3.46
User Capacity:        199,481,098,240 bytes [199 GB]
Logical block size:   512 bytes
>> Terminate command early due to bad response to IEC mode page
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.
[root@chort /]# 
[root@chort /]# smartctl -a /dev/pass0
smartctl 6.5 2016-05-07 r4318 [FreeBSD 10.3-STABLE amd64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               LSI
Product:              MR9271-8i
Revision:             3.46
User Capacity:        199,481,098,240 bytes [199 GB]
Logical block size:   512 bytes
>> Terminate command early due to bad response to IEC mode page
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.
[root@chort /]# 
[root@chort /]# smartctl -a -d megaraid,12 /dev/da0
smartctl 6.5 2016-05-07 r4318 [FreeBSD 10.3-STABLE amd64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

/dev/da0: Unknown device type 'megaraid,12'
=======> VALID ARGUMENTS ARE: ata, scsi, nvme[,NSID], sat[,auto][,N][+TYPE], usbcypress[,X], usbjmicron[,p][,x][,N], usbprolific, usbsunplus, 3ware,N, hpt,L/M/N, cciss,N, areca,N/E, atacam, auto, test <=======

Use smartctl -h to get a usage summary

[root@chort /]#

Can anything be done about this? I badly need to monitor S.M.A.R.T. status of my SAS/SATA drives under the MegaRAID...

Thanks in advance!
WBR,
Andrii

Change History (10)

comment:1 Changed 3 years ago by Andrii Stesin

And yes, smartd does not work either.

comment:2 Changed 3 years ago by Christian Franke

Description: modified (diff)
Keywords: megaraid freebsd added; MegaRAID removed
Milestone: undecided
Priority: majorminor
Type: defectenhancement

There is no -d megaraid,N device type in the FreeBSD version of smartmontools because in the past it worked with the mfip.ko module and /dev/passX device (see also Supported RAID-Controllers page).

If the new driver does not support this, please provide information about its SCSI pass-through I/O-control (if any).

comment:3 in reply to:  2 Changed 3 years ago by Andrii Stesin

Replying to chrfranke:

There is no -d megaraid,N device type in the FreeBSD version of smartmontools because in the past it worked with the mfip.ko module and /dev/passX device (see also Supported RAID-Controllers page).

If the new driver does not support this, please provide information about its SCSI pass-through I/O-control (if any).

Dear chrfranke, thank you much for your responsive reaction. Sorry I'm not a developer so I can't tell you for sure, but what FreeBSD man page for mrsas (4) actually states, "the mrsas name is derived from the phrase "MegaRAID SAS HBA", which is substantially different than the old "MegaRAID" Driver mfi(4) which does not connect targets to the cam(4) layer and thus requires a new driverwhich attaches targets to the cam(4) layer." This makes me guess that mrsas (4) behaves "better" right now.

comment:4 Changed 3 years ago by Andrii Stesin

One more word, as I see that MegaCLI command line utility is able to get SMART info from behind the MegaRAID - it is technically possible, am I correct?

comment:5 Changed 3 years ago by Andrii Stesin

Do we need any modifications to mrsas (4) in order to support the syntax like:

smartctl -a -d megaraid,12

or even better,

smartctl -a -d 'megaraid,[9:11]'

or both? Whom shall I ask for details? Thanks in advance!

comment:6 Changed 3 years ago by Alex Samorukov

  1. It is possible.
  2. Best think is to implement smth like mrsasp which exports drives.
  3. I think i can implement megaraid-like functionality if someone will provide me access to such hw

comment:7 Changed 3 years ago by Alex Samorukov

Few notes:

  1. https://github.com/freebsd/freebsd/blob/master/sys/dev/mrsas/mrsas_linux.c implements emulation of the linux ioctl used by MegaCli?.
  2. There is a native ioctl interface defined here: https://github.com/freebsd/freebsd/blob/master/sys/dev/mrsas/mrsas.h, probably it is MRSAS_REQ_TYPE_PASSTHRU and mrsas_pthru_frame structure.

From what i see - adding megaraid (or mrsas?) support should be trivial

comment:8 Changed 2 years ago by Alex Samorukov

If someone interesting to see progress on this ticket - please provide me ssh access to hardware :)

comment:9 Changed 23 months ago by Alex Samorukov

Owner: set to Alex Samorukov
Status: newassigned

Ok, i got access to such hw (one of my BSD servers works with a such controller) and will try to work on this.

comment:10 Changed 23 months ago by Alex Samorukov

Progress so far:

  1. I implemented quick & dirty port of the Linux megaraid code to the FreeBSD. truss shows that ioctl looks <> the same.
  2. Now server reboots on issuing identify command. Server is located remotely, so hard to tell what is the root cause.
  3. Need to find some time to play with dtrace and find the problem

As usual - help is wanted. I will attach my patch to this ticket.

Note: See TracTickets for help on using tickets.