Opened 7 years ago

Closed 18 months ago

Last modified 18 months ago

#734 closed enhancement (fixed)

-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: Release 7.3
Component: all Version: 6.5
Keywords: megaraid freebsd Cc: Kyle Butt

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 (14)

comment:1 Changed 7 years ago by Andrii Stesin

And yes, smartd does not work either.

comment:2 Changed 7 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 7 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 7 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 7 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 6 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 6 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 6 years ago by Alex Samorukov

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

comment:9 Changed 6 years 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 6 years 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.

comment:11 Changed 3 years ago by Kyle Butt

Cc: Kyle Butt added

Was there any progress on this? I don't see the patch attached to the ticket. I have a megaraid 9361-8i that I would like to monitor. I'm a developer and would be glad to help out in any way that I can.

comment:12 Changed 18 months ago by Alex Samorukov

Patch to support mrsas could be found at https://github.com/smartmontools/smartmontools/pull/117. Testing is welcome.

Last edited 18 months ago by Alex Samorukov (previous) (diff)

comment:13 Changed 18 months ago by Alex Samorukov

Resolution: fixed
Status: assignedclosed

Done as r5247.

comment:14 Changed 18 months ago by Christian Franke

Milestone: undecidedRelease 7.3
Note: See TracTickets for help on using tickets.