# LSI SAS9341-8I trouble (was: SATA 3 PCIe HBA)



## FzZzT (Sep 3, 2018)

I'm trying to find a "cheap" ($200ish, preferably less) SATA-3 HBA (PCIe 2.0), and I'm having a hard time finding any SATA-3 HBA with a note anywhere that it's supported... I don't want RAID, it will be for ZFS, and I 4-16 ports (looking to add 8 ports total). By "supported" I mean it works, not necessarily official vendor support. I've found some chipsets but don't know what cards use them. Does anyone know of a list of actual retail cards or have recommendations?


----------



## sko (Sep 3, 2018)

If all you need is a cheap PCIe 2.0 HBA and performance isn't that big of a concern (i.e. you don't plan on using SSDs), go for LSI/Avago/Broadcom (or whatever they are called after the next acquisition...) 2008 based HBAs. They are widely available, well supported and battle-tested. If you plan on upgrading the platform soon (highly likely, given that the majority of PCIe 2.0 systems are already ~10 years old...) go for at least an LSI2308 based HBA - its basically the PCIe 3.0 variant of the 2008.
Main problem with the 2x08 controllers is performance - it is fast enough for HDD-only setups, but it quickly becomes a bottleneck when SSDs come into play.
So if you want to have a bit more headroom, go for a 3008 or 3200 based HBA - especially the 3008 aren't that much more expensive nowadays (and well within your budget), so I'd always opt for one of these if I have the choice.

For use with ZFS go for controllers with IT firmware - they are usually the cheapest variant anyways. Most controllers can be reflashed to that firmware though, so if you get a good deal on one with another firmware it's not a problem.

Controllers with the named chipsets are usually available as used parts by various brands (IBM, Dell, Fujitsu) and also as no-name parts from China. I don't have any experiences with the latter, but bought several used Dell and IBM ones for home/test servers. Never had any issues and all of them are still working fine, so especially for homelab/testing use I'd always prefer used enterprise HBAs over similar priced new consumer parts.


edit:
servethehome.com still has a list of HBAs for TrueNAS systems:
https://www.servethehome.com/buyers...s-freenas-nas-servers/top-picks-freenas-hbas/
Hasn't been updated in a while, but since you have asked for PCIe2.0, it's still viable...


----------



## FzZzT (Sep 3, 2018)

Thanks, I ended up getting one of these, hopefully it works with my board: https://www.ebay.com/itm/Dell-LSI-0WFN6R-WFN6R-SAS9341-8i-12GB-Raid-Controller/292609097360


----------



## FzZzT (Sep 8, 2018)

Unfortunately, the BIOS sees it and the disk attached but FreeBSD 11.2 doesn't work:


```
AVAGO MegaRAID SAS FreeBSD mrsas driver version: 06.712.04.00-fbsd
mfi0: <Fury> port 0xd000-0xd0ff mem 0xfe720000-0xfe72ffff,0xfe600000-0xfe6fffff irq 19 at device 0.0 on pci2
mfi0: Using MSI
mfi0: Megaraid SAS driver Ver 4.23
mfi0: FW MaxCmds = 240, limiting to 128
mfi0: MaxCmd = 240, Drv MaxCmd = 128, MaxSgl = 70, state = 0xbf3c00f0
mfi0: Init command Failed 0x3
mfi0: TB Init has failed with error 3
device_attach: mfi0 attach returned 3
```

I tried setting [FONT=Courier New]hw.mfi.mrsas_enable="1"[/FONT] in [FONT=Courier New]/boot/device.hints[/FONT] (the mfi() man page suggests that) but that didn't make a difference.

I am updating the firmware on the card to see if that helps...welp, can't do that, since it's not recognized there is no controller device for the util to talk to. Nuts.


----------



## FzZzT (Sep 8, 2018)

Tried 10.4, looks like it used the right driver this time, but still doesn't work...sigh.


```
AVAGO MegaRAID SAS FreeBSD mrsas driver version: 06.712.04.00-fbsd
mrsas0: <AVAGO Fury SAS Controller> port 0xd000-0xd0ff mem 0xfe720000-0xfe72ffff,0xfe600000-0xfe6fffff irq 19 at device 0.0 on pci2
mrsas0: Using MSI-X with 3 number of vectors
mrsas0: FW supports <96> MSIX vector,Online CPU 3 Current MSIX <3>
mrsas0: IOC Init failed, status = 0x3
mrsas0: Adapter initialize Fail.
device_attach: mrsas0 attach returned 6
```


----------



## FzZzT (Sep 8, 2018)

I found out the right combination of config changes to get mrsas to work on 11.x but got the same result as on 10.4.


----------



## phoenix (Sep 9, 2018)

I've only ever gotten a single MegaRAID controller to work with FreeBSD, and that was after doing a very dangerous firmware flash to remove all raid features.

Anytime I've tried to use a MegaRAID controller has ended in tears.

Remind me on Monday and I'll dig through my work email to find the cheat-sheet i used to flash it.


----------



## ralphbsz (Sep 9, 2018)

Do some search here on the forum.  We've had several discussions of using LSI SAS cards with FreeBSD, including some very knowledgeable posts by Terry Kennedy.  That might steer you in the right direction.

One warning right up front: The LSI cards can be flashed with one set of firmware (to become RAID controllers), or with another set of firmware (to become HBAs without RAID functionality).  I think the HBA only version is usually called the "IT" firmware (but when I worked with them, we had much more explicit instructions with version numbers and checksums).  They are also sold in vendor-specific versions: You can get them LSI-branded, or Dell-, IBM-, HP- or ... -branded.  If you mix the wrong firmware versions with the wrong cards, or if you screw up when doing the flashing, you can brick your LSI card.  In my case this was not a big problem: We were one of LSIs biggest customers, and LSIs headquarter's building is only a half hour drive away, so we just drove a box full of dead cards to their  engineering department and they fixed them for us, and then we went to lunch with their engineers.  Normal users who don't have the power of buying beer for engineers need to be a lot more careful.


----------



## FzZzT (Sep 9, 2018)

I read about the IR/IT stuff yesterday. I also tried making a single-disk RAID set versus JBOD but it didn't make any difference. At this point I don't care of it's JBOD/RAID/HBA; I just want it to find _something_ in FreeBSD. I think the problem (or at least _a_ problem) is that the card is PCIe 3.0 and my board is 2.0. I bought an IT-flashed card on eBay that is an older 2.0 card (older controller) for about $30 to see if that works.


----------



## SirDice (Sep 10, 2018)

FzZzT said:


> I think the problem (or at least _a_ problem) is that the card is PCIe 3.0 and my board is 2.0.


It's not a problem, PCIe 3.0 cards work just fine in PCIe 2.0 slots. You just don't get any of the benefits of 3.0.


----------



## phoenix (Sep 11, 2018)

phoenix said:


> I've only ever gotten a single MegaRAID controller to work with FreeBSD, and that was after doing a very dangerous firmware flash to remove all raid features.
> 
> Anytime I've tried to use a MegaRAID controller has ended in tears.
> 
> Remind me on Monday and I'll dig through my work email to find the cheat-sheet i used to flash it.



We have the 9341-8i MegaRAID controller.  We flashed it with the non-RAID firmware, basically turning it into a 9300-8i SAS HBA using the instructions from here and here.


----------



## Terry_Kennedy (Sep 11, 2018)

ralphbsz said:


> Do some search here on the forum.  We've had several discussions of using LSI SAS cards with FreeBSD, including some very knowledgeable posts by Terry Kennedy.  That might steer you in the right direction.


The 9341-8i wouldn't be my first choice for a plain old HBA (what LSI calls "IT mode"). One issue with that card is that it expects to be managed with OS-based utilities (the LSI download page for its firmware is just "naked" firmware files, without a flash utility included). As phoenix said, most people who use that card as a HBA flash it to a 9300-8i card.

But before you do that, make sure the card actually works. You could use a Linux LiveCD (relatively recent version) or a recent Windows installation CD (I don't know when built-in support for that card was added to Windows). Just boot and see if your disk(s) are detected.


----------

